diff options
-rw-r--r-- | engines/kyra/animator_v2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 45 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.h | 8 | ||||
-rw-r--r-- | engines/kyra/scene_v2.cpp | 4 | ||||
-rw-r--r-- | engines/kyra/script_v2.cpp | 52 |
5 files changed, 98 insertions, 13 deletions
diff --git a/engines/kyra/animator_v2.cpp b/engines/kyra/animator_v2.cpp index bda6be7ac3..5e78387c79 100644 --- a/engines/kyra/animator_v2.cpp +++ b/engines/kyra/animator_v2.cpp @@ -174,7 +174,7 @@ void KyraEngine_v2::refreshAnimObjects(int force) { height -= height + y - 144; _screen->hideMouse(); - _screen->copyRegion(x, y, x, y, width, height, 2, 0, Screen::CR_CLIPPED); + _screen->copyRegion(x, y, x, y, width, height, 2, 0, Screen::CR_CLIPPED | Screen::CR_NO_P_CHECK); _screen->showMouse(); curObject->needRefresh = false; diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 01c9c21a7b..b009b31f0f 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -397,10 +397,10 @@ void KyraEngine_v2::runLoop() { if (_system->getMillis() > _nextIdleAnim) showIdleAnim(); - //if (queryGameFlag(0x159) { - // sub_C86A(); - // resetGameFlag(0x159); - //} + if (queryGameFlag(0x159)) { + dinoRide(); + resetGameFlag(0x159); + } if (queryGameFlag(0x124) && !queryGameFlag(0x125)) { _mainCharacter.animFrame = 32; @@ -2134,6 +2134,43 @@ void KyraEngine_v2::listItemsInCauldron() { #pragma mark - +void KyraEngine_v2::dinoRide() { + _mainCharX = _mainCharY = -1; + + setGameFlag(0x15A); + enterNewScene(41, -1, 0, 0, 0); + resetGameFlag(0x15A); + + setGameFlag(0x15B); + enterNewScene(39, -1, 0, 0, 0); + resetGameFlag(0x15B); + + setGameFlag(0x16F); + + setGameFlag(0x15C); + enterNewScene(42, -1, 0, 0, 0); + resetGameFlag(0x15C); + + setGameFlag(0x15D); + enterNewScene(39, -1, 0, 0, 0); + resetGameFlag(0x15D); + + setGameFlag(0x15E); + enterNewScene(40, -1, 0, 0, 0); + resetGameFlag(0x15E); + + _mainCharX = 262; + _mainCharY = 28; + _mainCharacter.facing = 5; + _mainCharacter.animFrame = _characterFrameTable[5]; + enterNewScene(39, 4, 0, 0, 0); + setHandItem(0x61); + _screen->showMouse(); + resetGameFlag(0x159); +} + +#pragma mark - + void KyraEngine_v2::registerDefaultSettings() { KyraEngine::registerDefaultSettings(); diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index 70b8902c40..7a1c3e7044 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -307,6 +307,8 @@ protected: void updateMouse(); + void dinoRide(); + struct Button; int checkInput(Button *buttonList, bool mainLoop = false); void removeInputTop(); @@ -961,7 +963,9 @@ protected: int o2_getCharacterScene(ScriptState *script); int o2_setSceneComment(ScriptState *script); int o2_setCharacterAnimFrame(ScriptState *script); + int o2_setCharacterFacing(ScriptState *script); int o2_trySceneChange(ScriptState *script); + int o2_moveCharacter(ScriptState *script); int o2_customCharacterChat(ScriptState *script); int o2_soundFadeOut(ScriptState *script); int o2_showChapterMessage(ScriptState *script); @@ -1000,6 +1004,7 @@ protected: int o2_setScaleTableItem(ScriptState *script); int o2_setDrawLayerTableItem(ScriptState *script); int o2_setCharPalEntry(ScriptState *script); + int o2_loadZShapes(ScriptState *script); int o2_drawSceneShape(ScriptState *script); int o2_drawSceneShapeOnPage(ScriptState *script); int o2_disableAnimObject(ScriptState *script); @@ -1016,11 +1021,13 @@ protected: int o2_enterNewSceneEx(ScriptState *script); int o2_switchScene(ScriptState *script); int o2_getShapeFlag1(ScriptState *script); + int o2_setPathfinderFlag(ScriptState *script); int o2_setLayerFlag(ScriptState *script); int o2_setZanthiaPos(ScriptState *script); int o2_loadMusicTrack(ScriptState *script); int o2_playWanderScoreViaMap(ScriptState *script); int o2_playSoundEffect(ScriptState *script); + int o2_setSceneAnimPos(ScriptState *script); int o2_blockInRegion(ScriptState *script); int o2_blockOutRegion(ScriptState *script); int o2_setCauldronState(ScriptState *script); @@ -1075,6 +1082,7 @@ protected: int o2_enableTimer(ScriptState *script); int o2_setTimerCountdown(ScriptState *script); int o2_processPaletteIndex(ScriptState *script); + int o2_updateTwoSceneAnims(ScriptState *script); int o2_getBoolFromStack(ScriptState *script); int o2_setVocHigh(ScriptState *script); int o2_getVocHigh(ScriptState *script); diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp index b2fc770dfa..774f08b4e7 100644 --- a/engines/kyra/scene_v2.cpp +++ b/engines/kyra/scene_v2.cpp @@ -666,7 +666,7 @@ void KyraEngine_v2::initSceneAnims(int unk1) { void KyraEngine_v2::initSceneScreen(int unk1) { if (_unkSceneScreenFlag1) { - _screen->copyRegion(0, 0, 0, 0, 320, 144, 2, 0); + _screen->copyRegion(0, 0, 0, 0, 320, 144, 2, 0, Screen::CR_NO_P_CHECK); return; } @@ -675,7 +675,7 @@ void KyraEngine_v2::initSceneScreen(int unk1) { _screen->setScreenPalette(_screen->getPalette(0)); } - _screen->copyRegion(0, 0, 0, 0, 320, 144, 2, 0); + _screen->copyRegion(0, 0, 0, 0, 320, 144, 2, 0, Screen::CR_NO_P_CHECK); if (_noScriptEnter) { _screen->setScreenPalette(_screen->getPalette(1)); diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp index f29dedfb0f..beedeb41b0 100644 --- a/engines/kyra/script_v2.cpp +++ b/engines/kyra/script_v2.cpp @@ -125,6 +125,13 @@ int KyraEngine_v2::o2_setCharacterAnimFrame(ScriptState *script) { return 0; } +int KyraEngine_v2::o2_setCharacterFacing(ScriptState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setCharacterFacing(%p) (%d)", (const void *)script, stackPos(0)); + _mainCharacter.facing = stackPos(0); + _overwriteSceneFacing = 1; + return 0; +} + int KyraEngine_v2::o2_trySceneChange(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_trySceneChange(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); @@ -144,6 +151,12 @@ int KyraEngine_v2::o2_trySceneChange(ScriptState *script) { } } +int KyraEngine_v2::o2_moveCharacter(ScriptState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_moveCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); + moveCharacter(stackPos(0), stackPos(1), stackPos(2)); + return 0; +} + int KyraEngine_v2::o2_customCharacterChat(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_customCharacterChat(%p) ('%s', %d, %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4)); playVoice(_vocHigh, stackPos(4)); @@ -603,6 +616,12 @@ int KyraEngine_v2::o2_setCharPalEntry(ScriptState *script) { return 0; } +int KyraEngine_v2::o2_loadZShapes(ScriptState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_loadZShapes(%p) (%d)", (const void *)script, stackPos(0)); + loadZShapes(stackPos(0)); + return 0; +} + int KyraEngine_v2::o2_drawSceneShape(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_drawSceneShape(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); @@ -767,6 +786,12 @@ int KyraEngine_v2::o2_getShapeFlag1(ScriptState *script) { return _screen->getShapeFlag1(stackPos(0), stackPos(1)); } +int KyraEngine_v2::o2_setPathfinderFlag(ScriptState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setPathfinderFlag(%p) (%d)", (const void *)script, stackPos(0)); + _pathfinderFlag = stackPos(0); + return 0; +} + int KyraEngine_v2::o2_setLayerFlag(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setLayerFlag(%p) (%d)", (const void *)script, stackPos(0)); int layer = stackPos(0); @@ -806,6 +831,13 @@ int KyraEngine_v2::o2_playSoundEffect(ScriptState *script) { return 0; } +int KyraEngine_v2::o2_setSceneAnimPos(ScriptState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setSceneAnimPos(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2)); + _sceneAnims[stackPos(0)].x = stackPos(1); + _sceneAnims[stackPos(0)].y = stackPos(2); + return 0; +} + int KyraEngine_v2::o2_blockInRegion(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_blockInRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); _screen->blockInRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1); @@ -1449,6 +1481,14 @@ int KyraEngine_v2::o2_processPaletteIndex(ScriptState *script) { return 0; } +int KyraEngine_v2::o2_updateTwoSceneAnims(ScriptState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_updateTwoSceneAnims(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); + updateSceneAnim(stackPos(0), stackPos(1)); + updateSceneAnim(stackPos(2), stackPos(3)); + _specialSceneScriptRunFlag = false; + return 0; +} + int KyraEngine_v2::o2_getBoolFromStack(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getBoolFromStack(%p) ()", (const void *)script); return stackPos(0) ? 1 : 0; @@ -1564,9 +1604,9 @@ void KyraEngine_v2::setupOpcodeTable() { OpcodeUnImpl(), Opcode(o2_setCharacterAnimFrame), // 0x0c - OpcodeUnImpl(), + Opcode(o2_setCharacterFacing), Opcode(o2_trySceneChange), - OpcodeUnImpl(), + Opcode(o2_moveCharacter), Opcode(o2_customCharacterChat), // 0x10 Opcode(o2_soundFadeOut), @@ -1625,7 +1665,7 @@ void KyraEngine_v2::setupOpcodeTable() { Opcode(o2_setDrawLayerTableItem), // 0x3c Opcode(o2_setCharPalEntry), - OpcodeUnImpl(), + Opcode(o2_loadZShapes), Opcode(o2_drawSceneShape), Opcode(o2_drawSceneShapeOnPage), // 0x40 @@ -1652,7 +1692,7 @@ void KyraEngine_v2::setupOpcodeTable() { Opcode(o2_enterNewSceneEx), Opcode(o2_switchScene), Opcode(o2_getShapeFlag1), - OpcodeUnImpl(), + Opcode(o2_setPathfinderFlag), // 0x54 OpcodeUnImpl(), Opcode(o2_setLayerFlag), @@ -1661,7 +1701,7 @@ void KyraEngine_v2::setupOpcodeTable() { // 0x58 Opcode(o2_playWanderScoreViaMap), Opcode(o2_playSoundEffect), - OpcodeUnImpl(), + Opcode(o2_setSceneAnimPos), Opcode(o2_blockInRegion), // 0x5c Opcode(o2_blockOutRegion), @@ -1749,7 +1789,7 @@ void KyraEngine_v2::setupOpcodeTable() { Opcode(o2_setTimerCountdown), Opcode(o2_processPaletteIndex), // 0xa0 - OpcodeUnImpl(), + Opcode(o2_updateTwoSceneAnims), OpcodeUnImpl(), OpcodeUnImpl(), Opcode(o2_getBoolFromStack), |