From c80c74e49926daed108f73e115fda7ba5901eb61 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 7 Mar 2015 17:01:07 -0500 Subject: MADS: Refactoring of text/animation views to show outside game loop --- engines/mads/nebular/game_nebular.cpp | 56 ++++++++++++++++++-------------- engines/mads/nebular/menu_nebular.cpp | 2 ++ engines/mads/nebular/nebular_scenes8.cpp | 6 ++-- 3 files changed, 36 insertions(+), 28 deletions(-) (limited to 'engines/mads/nebular') diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp index 965ef7fad2..8c8d4ab974 100644 --- a/engines/mads/nebular/game_nebular.cpp +++ b/engines/mads/nebular/game_nebular.cpp @@ -61,6 +61,35 @@ ProtectionResult GameNebular::checkCopyProtection() { } void GameNebular::startGame() { + // First handle any ending credits from a just finished game session. + // Note that, with the exception of the decompression ending, which doesn't + // use animations, the remaining animations will automatically launch their + // own text view credits when the animation is completed + switch (_winStatus) { + case 1: + // No shields failure ending + AnimationView::execute(_vm, "rexend1"); + break; + case 2: + // Shields, but no targetting failure ending + AnimationView::execute(_vm, "rexend2"); + break; + case 3: + // Completed game successfully, so activate quotes item on the main menu + ConfMan.setBool("ShowQuotes", true); + ConfMan.flushToDisk(); + + AnimationView::execute(_vm, "rexend3"); + break; + case 4: + // Decompression ending + TextView::execute(_vm, "ending4"); + break; + } + + checkShowDialog(); + _winStatus = 0; + /* // Check copy protection ProtectionResult protectionResult = checkCopyProtection(); @@ -310,32 +339,9 @@ void GameNebular::setSectionHandler() { } void GameNebular::checkShowDialog() { - // Handling to start endgame sequences if the win/lose type has been set - switch (_winStatus) { - case 1: - // No shields failure ending - AnimationView::execute(_vm, "rexend1"); - break; - case 2: - // Shields, but no targetting failure ending - AnimationView::execute(_vm, "rexend2"); - break; - case 3: - // Completed game successfully, so activate quotes item on the main menu - ConfMan.setBool("ShowQuotes", true); - ConfMan.flushToDisk(); - - AnimationView::execute(_vm, "rexend3"); - break; - case 4: - // Decompression ending - TextView::execute(_vm, "ending4"); - break; - } - _winStatus = 0; - // Loop for showing dialogs, if any need to be shown - if (_vm->_dialogs->_pendingDialog && _player._stepEnabled && !_globals[kCopyProtectFailed]) { + if (_vm->_dialogs->_pendingDialog && (_player._stepEnabled || _winStatus) + && !_globals[kCopyProtectFailed]) { _player.releasePlayerSprites(); // Make a thumbnail in case it's needed for making a savegame diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp index 2fdef3443d..358a978cfa 100644 --- a/engines/mads/nebular/menu_nebular.cpp +++ b/engines/mads/nebular/menu_nebular.cpp @@ -136,12 +136,14 @@ void MainMenu::doFrame() { addSpriteSlot(); } + _vm->_events->setCursor(CURSOR_ARROW); _vm->_events->showCursor(); } else { if ((_menuItemIndex == -1) || (_frameIndex == 0)) { if (++_menuItemIndex == 6) { // Reached end of display animation + _vm->_events->setCursor(CURSOR_ARROW); _vm->_events->showCursor(); return; } else if (_menuItemIndex == 4 && !shouldShowQuotes()) { diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index 4b8d7d5dd8..8a30f88548 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -719,7 +719,7 @@ void Scene803::step() { else _game._winStatus = 3; - _vm->quitGame(); + return; } } @@ -957,7 +957,7 @@ void Scene804::step() { assert(!_globals[kCopyProtectFailed]); _game._winStatus = 4; - _vm->quitGame(); + return; } break; @@ -969,7 +969,7 @@ void Scene804::step() { assert(!_globals[kCopyProtectFailed]); _game._winStatus = 4; - _vm->quitGame(); + return; } } -- cgit v1.2.3