diff options
-rw-r--r-- | engines/kyra/debugger.cpp | 3 | ||||
-rw-r--r-- | engines/kyra/gui.cpp | 18 | ||||
-rw-r--r-- | engines/kyra/kyra.cpp | 17 | ||||
-rw-r--r-- | engines/kyra/kyra.h | 1 | ||||
-rw-r--r-- | engines/kyra/script_v1.cpp | 20 | ||||
-rw-r--r-- | engines/kyra/staticres.cpp | 10 |
6 files changed, 47 insertions, 22 deletions
diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp index 7497a8f7aa..7e3b109448 100644 --- a/engines/kyra/debugger.cpp +++ b/engines/kyra/debugger.cpp @@ -79,13 +79,10 @@ bool Debugger::cmd_enterRoom(int argc, const char **argv) { direction = 2; } - // Dirty way of hiding the debug console while the room entry scripts are running, - // otherwise the graphics didn't update. _vm->_system->hideOverlay(); _vm->_currentCharacter->facing = direction; _vm->enterNewScene(room, _vm->_currentCharacter->facing, 0, 0, 1); - _vm->_system->showOverlay(); _vm->_screen->_mouseLockCount = 0; _detach_now = true; diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index 1b41135767..db9f249485 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -414,22 +414,24 @@ int KyraEngine::buttonMenuCallback(Button *caller) { _screen->savePageToDisk("SEENPAGE.TMP", 0); gui_fadePalette(); - calcCoords(_menu[0]); - calcCoords(_menu[1]); - calcCoords(_menu[2]); - calcCoords(_menu[3]); + for ( int i = 0; i < 5; i++) + calcCoords(_menu[i]); _menuRestoreScreen = true; + _toplevelMenu = 0; if (_menuDirectlyToLoad) gui_loadGameMenu(0); else { - initMenu(_menu[0]); + if (!caller) + _toplevelMenu = 4; + + initMenu(_menu[_toplevelMenu]); processAllMenuButtons(); } while (_displayMenu) { - gui_processHighlights(_menu[0]); + gui_processHighlights(_menu[_toplevelMenu]); processButtonList(_menuButtonList); gui_getInput(); } @@ -723,7 +725,7 @@ int KyraEngine::gui_loadGameMenu(Button *button) { _screen->savePageToDisk("SEENPAGE.TMP", 0); if (_cancelSubMenu) { - initMenu(_menu[0]); + initMenu(_menu[_toplevelMenu]); processAllMenuButtons(); } else { gui_restorePalette(); @@ -854,7 +856,7 @@ int KyraEngine::gui_quitPlaying(Button *button) { if (gui_quitConfirm("Are you sure you want to quit playing?")) quitGame(); else { - initMenu(_menu[0]); + initMenu(_menu[_toplevelMenu]); processAllMenuButtons(); } diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp index d63038d727..40f8ddf944 100644 --- a/engines/kyra/kyra.cpp +++ b/engines/kyra/kyra.cpp @@ -668,10 +668,13 @@ void KyraEngine::mainLoop() { } if (_deathHandler != 0xFF) { - // this is only used until the original gui is implemented - GUI::MessageDialog dialog("Brandon is dead! Game over!", "Quit"); - dialog.runModal(); - break; + _deathHandler = 0xFF; + snd_playWanderScoreViaMap(0, 1); + // This causes a failed assert in playWanderScoreViaMap. + //snd_playSoundEffect(49); + // Playing the track directly instead. + _sound->playTrack(29); + buttonMenuCallback(0); } if (_brandonStatusBit & 2) { @@ -699,6 +702,8 @@ void KyraEngine::mainLoop() { } void KyraEngine::quitGame() { + debugC(9, kDebugLevelMain, "KyraEngine::quitGame()"); + res_unloadResources(RES_ALL); for (int i = 0; i < ARRAYSIZE(_movieObjects); ++i) { @@ -823,13 +828,15 @@ void KyraEngine::waitForEvent() { void KyraEngine::delayWithTicks(int ticks) { uint32 nextTime = _system->getMillis() + ticks * _tickLength; - while (_system->getMillis() < nextTime && !_skipFlag) { + while (_system->getMillis() < nextTime) { _sprites->updateSceneAnims(); _animator->updateAllObjectShapes(); if (_currentCharacter->sceneId == 210) { updateKyragemFading(); seq_playEnd(); } + if (_skipFlag) + break; } } diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h index d65849348c..119cfe4c80 100644 --- a/engines/kyra/kyra.h +++ b/engines/kyra/kyra.h @@ -817,6 +817,7 @@ protected: bool _menuRestoreScreen; bool _displaySubMenu; bool _cancelSubMenu; + uint8 _toplevelMenu; int _savegameOffset; int _gameToLoad; char _savegameName[31]; diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp index 5eb487dd4c..5d83b36e73 100644 --- a/engines/kyra/script_v1.cpp +++ b/engines/kyra/script_v1.cpp @@ -484,9 +484,12 @@ int KyraEngine::cmd_displayWSAFrame(ScriptState *script) { _movieObjects[wsaIndex]->displayFrame(frame); _animator->_updateScreen = true; uint32 continueTime = waitTime * _tickLength + _system->getMillis(); - while (_system->getMillis() < continueTime && !_skipFlag) { + while (_system->getMillis() < continueTime) { _sprites->updateSceneAnims(); _animator->updateAllObjectShapes(); + if (_skipFlag) + break; + if (continueTime - _system->getMillis() >= 10) delay(10); } @@ -719,6 +722,9 @@ int KyraEngine::cmd_displayWSAFrameOnHidPage(ScriptState *script) { while (_system->getMillis() < continueTime) { _sprites->updateSceneAnims(); _animator->updateAllObjectShapes(); + if (_skipFlag) + break; + if (continueTime - _system->getMillis() >= 10) delay(10); } @@ -752,9 +758,12 @@ int KyraEngine::cmd_displayWSASequentialFrames(ScriptState *script) { _movieObjects[wsaIndex]->displayFrame(frame); _animator->_updateScreen = true; uint32 continueTime = waitTime * _tickLength + _system->getMillis(); - while (_system->getMillis() < continueTime && !_skipFlag) { + while (_system->getMillis() < continueTime) { _sprites->updateSceneAnims(); _animator->updateAllObjectShapes(); + if (_skipFlag) + break; + if (continueTime - _system->getMillis() >= 10) delay(10); } @@ -766,16 +775,19 @@ int KyraEngine::cmd_displayWSASequentialFrames(ScriptState *script) { _movieObjects[wsaIndex]->displayFrame(frame); _animator->_updateScreen = true; uint32 continueTime = waitTime * _tickLength + _system->getMillis(); - while (_system->getMillis() < continueTime && !_skipFlag) { + while (_system->getMillis() < continueTime) { _sprites->updateSceneAnims(); _animator->updateAllObjectShapes(); + if (_skipFlag) + break; + if (continueTime - _system->getMillis() >= 10) delay(10); } --frame; } } - if (!_skipFlag) + if (_skipFlag) break; else ++curTime; diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index a6d1e7920b..63e2cc12ab 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -946,11 +946,17 @@ Menu KyraEngine::_menu[] = { { {1, 0, 0, "Save", 24, 0, 44, 72, 15, 252, 253, -1, 255, 248, 249, 250, &KyraEngine::gui_savegameConfirm, -1, 0, 0, 0, 0, 0}, - // {1, 0, 0, "Cancel", 110, 0, 44, 72, 15, 252, 253, -1, 255, - // 248, 249, 250, /*&menu_cancelconfirmsave*/ 0, -1, 0, 0, 0, 0, 0}, {1, 0, 0, "Cancel", 192, 0, 44, 72, 15, 252, 253, -1, 255, 248, 249, 250, &KyraEngine::gui_cancelSubMenu, -1, 0, 0, 0, 0, 0} } + }, + { -1, -1, 208, 76, 248, 249, 250, "Rest in peace, Brandon.", 251, -1, 8, 0, 2, -1, -1, -1, -1, + { + {1, 0, 0, "Load a game", -1, -1, 30, 148, 15, 252, 253, 24, 0, + 248, 249, 250, &KyraEngine::gui_loadGameMenu, -1, 0, 0, 0, 0, 0}, + {1, 0, 0, "Quit playing", -1, -1, 47, 148, 15, 252, 253, 24, 0, + 248, 249, 250, &KyraEngine::gui_quitPlaying, -1, 0, 0, 0, 0, 0} + } } }; |