diff options
author | Johannes Schickel | 2005-12-29 22:18:40 +0000 |
---|---|---|
committer | Johannes Schickel | 2005-12-29 22:18:40 +0000 |
commit | d1622557d9122a8c07d9c8e003a109ee4d934e3e (patch) | |
tree | 018a4d2b889976cc25f13cc9bd1fc663d3555559 | |
parent | e74799c32e57cd12839b8265ffbebfb7cb88e6d7 (diff) | |
download | scummvm-rg350-d1622557d9122a8c07d9c8e003a109ee4d934e3e.tar.gz scummvm-rg350-d1622557d9122a8c07d9c8e003a109ee4d934e3e.tar.bz2 scummvm-rg350-d1622557d9122a8c07d9c8e003a109ee4d934e3e.zip |
Implemented:
- cmd_pauseTicks
- cmd_setLogicPage
- cmd_fatPrint
- cmd_playWinterScrollSequence
Also implemented functionallity of the other three jewels of the amulet.
svn-id: r19847
-rw-r--r-- | kyra/kyra.cpp | 331 | ||||
-rw-r--r-- | kyra/kyra.h | 36 | ||||
-rw-r--r-- | kyra/script_v1.cpp | 22 | ||||
-rw-r--r-- | kyra/staticres.cpp | 46 |
4 files changed, 409 insertions, 26 deletions
diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp index 8a212950f4..9a2c8ab43e 100644 --- a/kyra/kyra.cpp +++ b/kyra/kyra.cpp @@ -352,6 +352,8 @@ int KyraEngine::init(GameDetector &detector) { _fadeText = false; _noDrawShapesFlag = 0; + _brandonStatusBit = 0; + _brandonStatusBit0x02Flag = _brandonStatusBit0x20Flag = 10; _brandonPosX = _brandonPosY = -1; _brandonDrawFrame = 113; _deathHandler = 0xFF; @@ -654,6 +656,18 @@ void KyraEngine::mainLoop() { while (!_quitFlag) { int32 frameTime = (int32)_system->getMillis(); + + if (_brandonStatusBit & 2) { + if (_brandonStatusBit0x02Flag) + animRefreshNPC(0); + } + if (_brandonStatusBit & 0x20) { + if (_brandonStatusBit0x20Flag) { + animRefreshNPC(0); + _brandonStatusBit0x20Flag = 0; + } + } + processButtonList(_buttonList); updateMousePointer(); updateGameTimers(); @@ -1163,6 +1177,248 @@ void KyraEngine::seq_playFluteAnimation() { } } +void KyraEngine::seq_winterScroll1() { + debug(9, "seq_winterScroll1()"); + _screen->hideMouse(); + checkAmuletAnimFlags(); + assert(_winterScrollTable); + assert(_winterScroll1Table); + assert(_winterScroll2Table); + setupShapes123(_winterScrollTable, 7, 0); + setBrandonAnimSeqSize(5, 66); + + for (int i = 123; i <= 129; ++i) { + _currentCharacter->currentAnimFrame = i; + animRefreshNPC(0); + delayWithTicks(8); + } + + freeShapes123(); + // snd_playSoundEffect(0x20); + setupShapes123(_winterScroll1Table, 35, 0); + + for (int i = 123; i <= 146; ++i) { + _currentCharacter->currentAnimFrame = i; + animRefreshNPC(0); + delayWithTicks(8); + } + + if (_currentCharacter->sceneId == 41 && !queryGameFlag(0xA2)) { + // snd_playSoundEffect(0x20); + _sprites->_anims[0].play = false; + _sprites->_animObjects[0].active = 0; + _sprites->_anims[1].play = true; + _sprites->_animObjects[1].active = 1; + } + + for (int i = 147; i <= 157; ++i) { + _currentCharacter->currentAnimFrame = i; + animRefreshNPC(0); + delayWithTicks(8); + } + + if (_currentCharacter->sceneId == 117 && !queryGameFlag(0xB3)) { + for (int i = 0; i <= 7; ++i) { + _sprites->_anims[i].play = false; + _sprites->_animObjects[i].active = 0; + } + uint8 tmpPal[768]; + memcpy(tmpPal, _screen->_currentPalette, 768); + memcpy(&tmpPal[684], palTable2()[0], 60); + _screen->fadePalette(tmpPal, 72); + } else { + delayWithTicks(120); + } + + freeShapes123(); + setupShapes123(_winterScroll2Table, 4, 0); + + for (int i = 123; i <= 126; ++i) { + _currentCharacter->currentAnimFrame = i; + animRefreshNPC(0); + delayWithTicks(8); + } + + resetBrandonAnimSeqSize(); + _currentCharacter->currentAnimFrame = 7; + animRefreshNPC(0); + freeShapes123(); + _screen->showMouse(); +} + +void KyraEngine::seq_winterScroll2() { + debug(9, "seq_winterScroll2()"); + _screen->hideMouse(); + checkAmuletAnimFlags(); + assert(_winterScrollTable); + setupShapes123(_winterScrollTable, 7, 0); + setBrandonAnimSeqSize(5, 66); + + for (int i = 123; i <= 128; ++i) { + _currentCharacter->currentAnimFrame = i; + animRefreshNPC(0); + delayWithTicks(8); + } + + delayWithTicks(120); + + for (int i = 127; i >= 123; --i) { + _currentCharacter->currentAnimFrame = i; + animRefreshNPC(0); + delayWithTicks(8); + } + + resetBrandonAnimSeqSize(); + _currentCharacter->currentAnimFrame = 7; + animRefreshNPC(0); + freeShapes123(); + _screen->showMouse(); +} + +void KyraEngine::seq_makeBrandonInv() { + debug(9, "seq_makeBrandonInv()"); + if (_deathHandler == 8) + return; + + if (_currentCharacter->sceneId == 210) { + //if (_unkSceneVar == 4 || _unkSceneVar == 6) + // return; + } + + _screen->hideMouse(); + checkAmuletAnimFlags(); + _brandonStatusBit |= 0x20; + setTimerCountdown(18, 2700); + _brandonStatusBit |= 0x40; + // snd_playSoundEffect(0x77); + _brandonInvFlag = 0; + while (_brandonInvFlag <= 0x100) { + animRefreshNPC(0); + delayWithTicks(10); + _brandonInvFlag += 0x10; + } + _brandonStatusBit &= 0xFFBF; + _screen->showMouse(); +} + +void KyraEngine::seq_makeBrandonNormal() { + debug(9, "seq_makeBrandonNormal()"); + _screen->hideMouse(); + _brandonStatusBit |= 0x40; + // snd_playSoundEffect(0x77); + _brandonInvFlag = 0x100; + while (_brandonInvFlag >= 0) { + animRefreshNPC(0); + delayWithTicks(10); + _brandonInvFlag -= 0x10; + } + _brandonStatusBit &= 0xFF9F; + _screen->showMouse(); +} + +void KyraEngine::seq_makeBrandonNormal2() { + debug(9, "seq_makeBrandonNormal2()"); + _screen->hideMouse(); + assert(_brandonToWispTable); + setupShapes123(_brandonToWispTable, 26, 0); + setBrandonAnimSeqSize(5, 48); + _brandonStatusBit &= 0xFFFD; + // snd_playSoundEffect(0x6C); + for (int i = 138; i >= 123; --i) { + _currentCharacter->currentAnimFrame = i; + animRefreshNPC(0); + delayWithTicks(8); + } + setBrandonAnimSeqSize(4, 48); + _currentCharacter->currentAnimFrame = 7; + animRefreshNPC(0); + if (_currentCharacter->sceneId >= 229 && _currentCharacter->sceneId <= 245) { + _screen->fadeSpecialPalette(31, 234, 13, 4); + } else if (_currentCharacter->sceneId >= 118 && _currentCharacter->sceneId <= 186) { + _screen->fadeSpecialPalette(14, 228, 15, 4); + } + freeShapes123(); + _screen->showMouse(); +} + +void KyraEngine::seq_makeBrandonWisp() { + debug(9, "seq_makeBrandonWisp()"); + if (_deathHandler == 8) + return; + + if (_currentCharacter->sceneId == 210) { + //if (_unkSceneVar == 4 || _unkSceneVar == 6) + // return; + } + _screen->hideMouse(); + checkAmuletAnimFlags(); + assert(_brandonToWispTable); + setupShapes123(_brandonToWispTable, 26, 0); + setBrandonAnimSeqSize(5, 48); + // snd_playSoundEffect(0x6C); + for (int i = 123; i <= 138; ++i) { + _currentCharacter->currentAnimFrame = i; + animRefreshNPC(0); + delayWithTicks(8); + } + _brandonStatusBit |= 2; + if (_currentCharacter->sceneId >= 109 && _currentCharacter->sceneId <= 198) { + setTimerCountdown(14, 18000); + } else { + setTimerCountdown(14, 7200); + } + _brandonDrawFrame = 113; + _brandonStatusBit0x02Flag = 1; + _currentCharacter->currentAnimFrame = 113; + animRefreshNPC(0); + updateAllObjectShapes(); + if (_currentCharacter->sceneId >= 229 && _currentCharacter->sceneId <= 245) { + _screen->fadeSpecialPalette(30, 234, 13, 4); + } else if (_currentCharacter->sceneId >= 118 && _currentCharacter->sceneId <= 186) { + _screen->fadeSpecialPalette(14, 228, 15, 4); + } + freeShapes123(); + _screen->showMouse(); +} + +void KyraEngine::seq_dispelMagicAnimation() { + debug(9, "seq_dispelMagicAnimation()"); + if (_deathHandler == 8) + return; + if (_currentCharacter->sceneId == 210) { + //if (_unkSceneVar == 4 || _unkSceneVar == 6) + // return; + } + _screen->hideMouse(); + if (_currentCharacter->sceneId == 210 && _currentCharacter->sceneId < 160) + _currentCharacter->facing = 3; + // XXX + checkAmuletAnimFlags(); + setGameFlag(0xEE); + assert(_magicAnimationTable); + setupShapes123(_magicAnimationTable, 5, 0); + setBrandonAnimSeqSize(8, 49); + // snd_playSoundEffect(0x15); + for (int i = 123; i <= 127; ++i) { + _currentCharacter->currentAnimFrame = i; + animRefreshNPC(0); + delayWithTicks(8); + } + + delayWithTicks(120); + + for (int i = 127; i >= 123; --i) { + _currentCharacter->currentAnimFrame = i; + animRefreshNPC(0); + delayWithTicks(10); + } + resetBrandonAnimSeqSize(); + _currentCharacter->currentAnimFrame = 7; + animRefreshNPC(0); + freeShapes123(); + _screen->showMouse(); +} + bool KyraEngine::seq_skipSequence() const { debug(9, "KyraEngine::seq_skipSequence()"); return _quitFlag || _abortIntroFlag; @@ -4085,21 +4341,17 @@ void KyraEngine::prepDrawAllObjects() { if (!_scaleMode) { if (flagUnk3 & 0x100) { - _screen->drawShape(drawPage, curObject->sceneAnimPtr, xpos, ypos, 2, curObject->flags | flagUnk1 | 0x100, (uint8*)_brandonPoisonFlagsGFX, 1, drawLayer); + _screen->drawShape(drawPage, curObject->sceneAnimPtr, xpos, ypos, 2, curObject->flags | flagUnk1 | 0x100, (uint8*)_brandonPoisonFlagsGFX, int(1), drawLayer); } else if (flagUnk3 & 0x4000) { - // XXX - int hackVar = 0; - _screen->drawShape(drawPage, curObject->sceneAnimPtr, xpos, ypos, 2, curObject->flags | flagUnk1 | 0x4000, hackVar, drawLayer); + _screen->drawShape(drawPage, curObject->sceneAnimPtr, xpos, ypos, 2, curObject->flags | flagUnk1 | 0x4000, _brandonInvFlag, drawLayer); } else { _screen->drawShape(drawPage, curObject->sceneAnimPtr, xpos, ypos, 2, curObject->flags | flagUnk1, drawLayer); } } else { if (flagUnk3 & 0x100) { - _screen->drawShape(drawPage, curObject->sceneAnimPtr, xpos, ypos, 2, curObject->flags | flagUnk1 | 0x104, (uint8*)_brandonPoisonFlagsGFX, 1, drawLayer, _brandonScaleX, _brandonScaleY); + _screen->drawShape(drawPage, curObject->sceneAnimPtr, xpos, ypos, 2, curObject->flags | flagUnk1 | 0x104, (uint8*)_brandonPoisonFlagsGFX, int(1), drawLayer, _brandonScaleX, _brandonScaleY); } else if (flagUnk3 & 0x4000) { - // XXX - int hackVar = 0; - _screen->drawShape(drawPage, curObject->sceneAnimPtr, xpos, ypos, 2, curObject->flags | flagUnk1 | 0x4004, 0, drawLayer, hackVar, _brandonScaleX, _brandonScaleY); + _screen->drawShape(drawPage, curObject->sceneAnimPtr, xpos, ypos, 2, curObject->flags | flagUnk1 | 0x4004, int(0), drawLayer, _brandonInvFlag, _brandonScaleX, _brandonScaleY); } else { _screen->drawShape(drawPage, curObject->sceneAnimPtr, xpos, ypos, 2, curObject->flags | flagUnk1 | 0x4, drawLayer, _brandonScaleX, _brandonScaleY); } @@ -4188,7 +4440,12 @@ void KyraEngine::animRefreshNPC(int character) { animObj->animFrameNumber = _brandonDrawFrame; ch->currentAnimFrame = _brandonDrawFrame; animObj->sceneAnimPtr = _shapes[4+_brandonDrawFrame]; - // XXX + if (_brandonStatusBit0x02Flag) { + ++_brandonDrawFrame; + if (_brandonDrawFrame >= 122) + _brandonDrawFrame = 113; + _brandonStatusBit0x02Flag = 0; + } } } @@ -4384,12 +4641,12 @@ void KyraEngine::setupShapes123(const Shape *shapeTable, int endShape, int flags shapeFlags = 3; for (int i = 123; i < 123+endShape; ++i) { uint8 newImage = shapeTable[i-123].imageIndex; - if (newImage != curImage) { + if (newImage != curImage && newImage != 0xFF) { assert(_characterImageTable); loadBitmap(_characterImageTable[newImage], 8, 8, 0); curImage = newImage; } - _shapes[4+i] = _screen->encodeShape(shapeTable[i-123].x<<3, shapeTable[i-123].y, shapeTable[i-123].w<<3, shapeTable[i-123].h, flags); + _shapes[4+i] = _screen->encodeShape(shapeTable[i-123].x<<3, shapeTable[i-123].y, shapeTable[i-123].w<<3, shapeTable[i-123].h, shapeFlags); assert(i-7 < _defaultShapeTableSize); _defaultShapeTable[i-7].xOffset = shapeTable[i-123].xOffset; _defaultShapeTable[i-7].yOffset = shapeTable[i-123].yOffset; @@ -5361,8 +5618,8 @@ void KyraEngine::setupTimers() { _timers[29].func = 0; //offset _timerDummy7, _timers[30].func = 0; //offset _timerDummy8, _timers[31].func = &KyraEngine::timerFadeText; //sub_151F8; - _timers[32].func = 0; //_nullsub61; - _timers[33].func = 0; //_nullsub62; + _timers[32].func = &KyraEngine::updateAnimFlag1; //_nullsub61; + _timers[33].func = &KyraEngine::updateAnimFlag2; //_nullsub62; _timers[0].countdown = _timers[1].countdown = _timers[2].countdown = _timers[3].countdown = _timers[4].countdown = -1; _timers[5].countdown = 5; @@ -5487,6 +5744,20 @@ void KyraEngine::timerFadeText(int timerNum) { _fadeText = true; } +void KyraEngine::updateAnimFlag1(int timerNum) { + debug(9, "updateAnimFlag1(%d)", timerNum); + if (_brandonStatusBit & 2) { + _brandonStatusBit0x02Flag = 1; + } +} + +void KyraEngine::updateAnimFlag2(int timerNum) { + debug(9, "updateAnimFlag2(%d)", timerNum); + if (_brandonStatusBit & 0x20) { + _brandonStatusBit0x20Flag = 1; + } +} + void KyraEngine::setTextFadeTimerCountdown(int16 countdown) { debug(9, "setTextFadeTimerCountdown(%i)", countdown); //if (countdown == -1) @@ -5520,14 +5791,12 @@ void KyraEngine::timerCheckAnimFlag2(int timerNum) { void KyraEngine::checkAmuletAnimFlags() { debug(9, "checkSpecialAnimFlags()"); if (_brandonStatusBit & 2) { - warning("STUB: playSpecialAnim1"); - // XXX + seq_makeBrandonNormal2(); setTimerCountdown(19, 300); } if (_brandonStatusBit & 0x20) { - warning("STUB: playSpecialAnim2"); - // XXX + seq_makeBrandonNormal(); setTimerCountdown(19, 300); } } @@ -6156,15 +6425,37 @@ int KyraEngine::buttonAmuletCallback(Button *caller) { break; case 1: - warning("jewel 1 STUB"); + seq_makeBrandonInv(); break; case 2: - warning("jewel 2 STUB"); + if (_brandonStatusBit & 1) { + assert(_wispJewelStrings); + characterSays(_wispJewelStrings[0], 0, -2); + } else { + if (_brandonStatusBit & 2) { + // XXX + seq_makeBrandonNormal2(); + // XXX + } else { + // do not check for item in hand again as in the original since some strings are missing + // in the cd version + if (_currentCharacter->sceneId >= 109 && _currentCharacter->sceneId <= 198) { + // XXX + seq_makeBrandonWisp(); + // XXX + } else { + seq_makeBrandonWisp(); + } + setGameFlag(0x9E); + } + } break; case 3: - warning("jewel 3 STUB"); + seq_dispelMagicAnimation(); + assert(_magicJewelString); + characterSays(_magicJewelString[0], 0, -2); break; default: diff --git a/kyra/kyra.h b/kyra/kyra.h index e415672d2c..cc5e0920a4 100644 --- a/kyra/kyra.h +++ b/kyra/kyra.h @@ -566,6 +566,13 @@ protected: void seq_poisonDeathNow(int now); void seq_poisonDeathNowAnim(); void seq_playFluteAnimation(); + void seq_winterScroll1(); + void seq_winterScroll2(); + void seq_makeBrandonInv(); + void seq_makeBrandonNormal(); + void seq_makeBrandonNormal2(); + void seq_makeBrandonWisp(); + void seq_dispelMagicAnimation(); void wsa_processFrame(WSAMovieV1 *wsa, int frameNum, uint8 *dst); @@ -609,11 +616,14 @@ protected: void timerUpdateHeadAnims(int timerNum); void timerSetFlags1(int timerNum); void timerSetFlags2(int timerNum); + void timerSetFlags3(int timerNum); void timerCheckAnimFlag1(int timerNum); void timerCheckAnimFlag2(int timerNum); void checkAmuletAnimFlags(); void timerRedrawAmulet(int timerNum); void timerFadeText(int timerNum); + void updateAnimFlag1(int timerNum); + void updateAnimFlag2(int timerNum); void drawAmulet(); void setTextFadeTimerCountdown(int16 countdown); @@ -676,8 +686,11 @@ protected: int16 _foyerItemTable[3]; uint16 _brandonStatusBit; + int _brandonStatusBit0x02Flag; + int _brandonStatusBit0x20Flag; uint8 _brandonPoisonFlagsGFX[256]; // this seem not to be posion flags, it is used for drawing once uint8 _deathHandler; + int _brandonInvFlag; int8 _poisonDeathCounter; int _brandonPosX; int _brandonPosY; @@ -788,6 +801,8 @@ protected: char **_healingTip; char **_thePoison; char **_fluteString; + char **_wispJewelStrings; + char **_magicJewelString; int _itemList_Size; int _takenList_Size; @@ -801,6 +816,8 @@ protected: int _healingTip_Size; int _thePoison_Size; int _fluteString_Size; + int _wispJewelStrings_Size; + int _magicJewelString_Size; char **_characterImageTable; int _characterImageTableSize; @@ -819,6 +836,25 @@ protected: Shape *_fluteAnimShapeTable; int _fluteAnimShapeTableSize; + Shape *_winterScrollTable; + int _winterScrollTableSize; + Shape *_winterScroll1Table; + int _winterScroll1TableSize; + Shape *_winterScroll2Table; + int _winterScroll2TableSize; + + Shape *_drinkAnimationTable; + int _drinkAnimationTableSize; + + Shape *_brandonToWispTable; + int _brandonToWispTableSize; + + Shape *_magicAnimationTable; + int _magicAnimationTableSize; + + Shape *_brandonStoneTable; + int _brandonStoneTableSize; + Room *_roomTable; int _roomTableSize; char **_roomFilenameTable; diff --git a/kyra/script_v1.cpp b/kyra/script_v1.cpp index 28beb26353..1cbb354028 100644 --- a/kyra/script_v1.cpp +++ b/kyra/script_v1.cpp @@ -329,7 +329,12 @@ int KyraEngine::cmd_characterSays(ScriptState *script) { } int KyraEngine::cmd_pauseTicks(ScriptState *script) { - warning("STUB: cmd_pauseTicks"); + debug(3, "cmd_pauseTicks(0x%X) (%d, %d)", script, stackPos(0), stackPos(1)); + if (stackPos(1)) { + warning("STUB: special cmd_pauseTicks"); + } else { + delayWithTicks(stackPos(0)); + } return 0; } @@ -1292,12 +1297,14 @@ int KyraEngine::cmd_specialEventRemoveBrynnsNote(ScriptState *script) { } int KyraEngine::cmd_setLogicPage(ScriptState *script) { - warning("STUB: cmd_setLogicPage"); - return 0; + debug(3, "cmd_setLogicPage(0x%X) (%d)", script, stackPos(0)); + _screen->_curPage = stackPos(0); + return stackPos(0); } int KyraEngine::cmd_fatPrint(ScriptState *script) { - warning("STUB: cmd_fatPrint"); + debug(3, "cmd_fatPrint(0x%X) ('%s', %d, %d, %d, %d, %d)", script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); + printText(stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); return 0; } @@ -1619,7 +1626,12 @@ int KyraEngine::cmd_playFluteAnimation(ScriptState *script) { } int KyraEngine::cmd_playWinterScrollSequence(ScriptState *script) { - warning("STUB: cmd_playWinterScrollSequence"); + debug(3, "cmd_playWinterScrollSequence(0x%X) (%d)", script, stackPos(0)); + if (!stackPos(0)) { + seq_winterScroll2(); + } else { + seq_winterScroll1(); + } return 0; } diff --git a/kyra/staticres.cpp b/kyra/staticres.cpp index 07ccb8773a..04dece3f1f 100644 --- a/kyra/staticres.cpp +++ b/kyra/staticres.cpp @@ -26,7 +26,7 @@ namespace Kyra { -#define RESFILE_VERSION 8 +#define RESFILE_VERSION 9 #define GAME_FLAGS (GF_FLOPPY | GF_TALKIE | GF_DEMO | GF_AUDIOCD) #define LANGUAGE_FLAGS (GF_ENGLISH | GF_FRENCH | GF_GERMAN | GF_SPANISH | GF_LNGUNK) @@ -227,6 +227,17 @@ void KyraEngine::res_loadResources(int type) { loadShapes(resFile, "POISONDEATH.SHP", &_posionDeathShapeTable, &_posionDeathShapeTableSize); loadShapes(resFile, "FLUTE.SHP", &_fluteAnimShapeTable, &_fluteAnimShapeTableSize); + + loadShapes(resFile, "WINTER1.SHP", &_winterScrollTable, &_winterScrollTableSize); + loadShapes(resFile, "WINTER2.SHP", &_winterScroll1Table, &_winterScroll1TableSize); + loadShapes(resFile, "WINTER3.SHP", &_winterScroll2Table, &_winterScroll2TableSize); + loadShapes(resFile, "DRINK.SHP", &_drinkAnimationTable, &_drinkAnimationTableSize); + loadShapes(resFile, "WISP.SHP", &_brandonToWispTable, &_brandonToWispTableSize); + loadShapes(resFile, "MAGICANIM.SHP", &_magicAnimationTable, &_magicAnimationTableSize); + loadShapes(resFile, "BRANSTONE.SHP", &_brandonStoneTable, &_brandonStoneTableSize); + + res_loadLangTable("WISPJEWEL.", &resFile, (byte***)&_wispJewelStrings, &_wispJewelStrings_Size, loadNativeLanguage); + res_loadLangTable("MAGICJEWEL.", &resFile, (byte***)&_magicJewelString, &_magicJewelString_Size, loadNativeLanguage); } #undef loadRooms @@ -264,6 +275,7 @@ void KyraEngine::res_unloadResources(int type) { res_freeLangTable(&_characterImageTable, &_characterImageTableSize); delete [] _defaultShapeTable; + _defaultShapeTable = 0; _defaultShapeTableSize = 0; res_freeLangTable(&_itemList, &_itemList_Size); @@ -287,19 +299,51 @@ void KyraEngine::res_unloadResources(int type) { res_freeLangTable(&_healingTip, &_healingTip_Size); delete [] _healingShapeTable; + _healingShapeTable = 0; _healingShapeTableSize = 0; delete [] _healingShape2Table; + _healingShape2Table = 0; _healingShape2TableSize = 0; res_freeLangTable(&_thePoison, &_thePoison_Size); res_freeLangTable(&_fluteString, &_fluteString_Size); delete [] _posionDeathShapeTable; + _posionDeathShapeTable = 0; _posionDeathShapeTableSize = 0; delete [] _fluteAnimShapeTable; + _fluteAnimShapeTable = 0; _fluteAnimShapeTableSize = 0; + + delete [] _winterScrollTable; + _winterScrollTable = 0; + _winterScrollTableSize = 0; + + delete [] _winterScroll1Table; + _winterScroll1Table = 0; + _winterScroll1TableSize = 0; + + delete [] _winterScroll2Table; + _winterScroll2Table = 0; + _winterScroll2TableSize = 0; + + delete [] _drinkAnimationTable; + _drinkAnimationTable = 0; + _drinkAnimationTableSize = 0; + + delete [] _brandonToWispTable; + _brandonToWispTable = 0; + _brandonToWispTableSize = 0; + + delete [] _magicAnimationTable; + _magicAnimationTable = 0; + _magicAnimationTableSize = 0; + + delete [] _brandonStoneTable; + _brandonStoneTable = 0; + _brandonStoneTableSize = 0; } } |