aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2018-07-13 19:31:56 +0200
committerBastien Bouclet2018-07-13 19:44:48 +0200
commitd91ac014195dea06e42daa7351c9a3844ef34aec (patch)
tree8e8c2bd56b169f8f1f1970a48b1b43320954b302 /engines/mohawk/riven.cpp
parent788574e751f89096ba580306818e5d999db9c016 (diff)
downloadscummvm-rg350-d91ac014195dea06e42daa7351c9a3844ef34aec.tar.gz
scummvm-rg350-d91ac014195dea06e42daa7351c9a3844ef34aec.tar.bz2
scummvm-rg350-d91ac014195dea06e42daa7351c9a3844ef34aec.zip
MOHAWK: RIVEN: Queue opening and closing the main menu as scripts
This way all the other actions are blocked while the card load scripts are executed. Expecially, it's not possible anymore to open the main menu while the scripts for returning from the main menu are still executing. Fixes Trac#10628.
Diffstat (limited to 'engines/mohawk/riven.cpp')
-rw-r--r--engines/mohawk/riven.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index 5d02317ec0..77d52f9aa5 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -341,15 +341,18 @@ void MohawkEngine_Riven::goToMainMenu() {
_menuTumbnail.reset(new Graphics::Surface());
createThumbnailFromScreen(_menuTumbnail.get());
- changeToStack(kStackAspit);
- changeToCard(1);
+ RivenCommand *go = new RivenStackChangeCommand(this, kStackAspit, 1, true, true);
+ RivenScriptPtr goScript = _scriptMan->createScriptWithCommand(go);
+ _scriptMan->runScript(goScript, true);
}
void MohawkEngine_Riven::resumeFromMainMenu() {
assert(_menuSavedStack != -1);
- changeToStack(_menuSavedStack);
- changeToCard(_menuSavedCard);
+ RivenCommand *resume = new RivenStackChangeCommand(this, _menuSavedStack, _menuSavedCard, true, true);
+ RivenScriptPtr resumeScript = _scriptMan->createScriptWithCommand(resume);
+ _scriptMan->runScript(resumeScript, true);
+
_menuSavedStack = -1;
_menuSavedCard = -1;
_menuTumbnail.reset();