aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/nebular/dialogs_nebular.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-03-13 21:54:20 -0400
committerPaul Gilbert2015-03-13 21:54:20 -0400
commitc0df1248b5a73f4b0f02d0712907878aa265dff4 (patch)
tree2c17ce7578bb081477f2e377855a8783ca70913d /engines/mads/nebular/dialogs_nebular.cpp
parented33dee7539c6b05f7dba18fb87cdd44c09ba3cd (diff)
downloadscummvm-rg350-c0df1248b5a73f4b0f02d0712907878aa265dff4.tar.gz
scummvm-rg350-c0df1248b5a73f4b0f02d0712907878aa265dff4.tar.bz2
scummvm-rg350-c0df1248b5a73f4b0f02d0712907878aa265dff4.zip
MADS: Properly handle reloading scenes when closing dialogs
Diffstat (limited to 'engines/mads/nebular/dialogs_nebular.cpp')
-rw-r--r--engines/mads/nebular/dialogs_nebular.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index 23aef6bdb5..6c57c85408 100644
--- a/engines/mads/nebular/dialogs_nebular.cpp
+++ b/engines/mads/nebular/dialogs_nebular.cpp
@@ -344,7 +344,7 @@ void DialogsNebular::showDialog() {
void DialogsNebular::showScummVMSaveDialog() {
Nebular::GameNebular &game = *(Nebular::GameNebular *)_vm->_game;
- Scene *scene = &(game._scene);
+ Scene &scene = game._scene;
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
int slot = dialog->runModalWithCurrentTarget();
@@ -356,24 +356,31 @@ void DialogsNebular::showScummVMSaveDialog() {
desc = dialog->createDefaultSaveDescription(slot);
}
- scene->_spriteSlots.reset();
- scene->loadScene(scene->_currentSceneId, game._aaName, true);
- scene->_userInterface.noInventoryAnim();
+ scene._spriteSlots.reset();
+ scene.loadScene(scene._currentSceneId, game._aaName, true);
+ scene._userInterface.noInventoryAnim();
game._scene.drawElements(kTransitionFadeIn, false);
game.saveGame(slot, desc);
}
+
+ // Flag for scene loading that we're returning from a dialog
+ scene._currentSceneId = RETURNING_FROM_DIALOG;
}
void DialogsNebular::showScummVMRestoreDialog() {
Nebular::GameNebular &game = *(Nebular::GameNebular *)_vm->_game;
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
+ Scene &scene = game._scene;
int slot = dialog->runModalWithCurrentTarget();
if (slot >= 0) {
game._loadGameSlot = slot;
- game._scene._currentSceneId = -1;
+ game._scene._currentSceneId = RETURNING_FROM_LOADING;
game._currentSectionNumber = -1;
+ } else {
+ // Flag for scene loading that we're returning from a dialog
+ scene._currentSceneId = RETURNING_FROM_DIALOG;
}
}
@@ -637,6 +644,7 @@ void GameDialog::display() {
GameDialog::~GameDialog() {
_vm->_screen.resetClipBounds();
+ _vm->_game->_scene._currentSceneId = RETURNING_FROM_DIALOG;
}
void GameDialog::clearLines() {