aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2017-07-29 18:20:45 +0200
committerBastien Bouclet2017-07-29 18:20:45 +0200
commit69c1f70818aaf83f97bf7131cdf9423c0a75027f (patch)
tree787e2293f0a2785cbb2c173a83106c5c3efb41c1 /engines/mohawk/riven.cpp
parent8c587b54ab92a5f21fae2c1db8ebdedaf61b521e (diff)
downloadscummvm-rg350-69c1f70818aaf83f97bf7131cdf9423c0a75027f.tar.gz
scummvm-rg350-69c1f70818aaf83f97bf7131cdf9423c0a75027f.tar.bz2
scummvm-rg350-69c1f70818aaf83f97bf7131cdf9423c0a75027f.zip
MOHAWK: Riven: Let the gameloop gracefully end when quitting
Prevents the quit confirmation dialog from being displayed at the end of the game's ending if it is enabled. Fixes #9943.
Diffstat (limited to 'engines/mohawk/riven.cpp')
-rw-r--r--engines/mohawk/riven.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index d3f9e61d9f..59a41f5258 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -58,6 +58,7 @@ MohawkEngine_Riven::MohawkEngine_Riven(OSystem *syst, const MohawkGameDescriptio
_showHotspots = false;
_activatedPLST = false;
_activatedSLST = false;
+ _gameEnded = false;
_extrasFile = nullptr;
_stack = nullptr;
_gfx = nullptr;
@@ -186,7 +187,7 @@ Common::Error MohawkEngine_Riven::run() {
}
- while (!shouldQuit())
+ while (!hasGameEnded())
doFrame();
return Common::kNoError;
@@ -424,7 +425,7 @@ Common::SeekableReadStream *MohawkEngine_Riven::getExtrasResource(uint32 tag, ui
void MohawkEngine_Riven::delay(uint32 ms) {
uint32 startTime = _system->getMillis();
- while (_system->getMillis() < startTime + ms && !shouldQuit()) {
+ while (_system->getMillis() < startTime + ms && !hasGameEnded()) {
doFrame();
}
}
@@ -497,6 +498,14 @@ bool MohawkEngine_Riven::canSaveGameStateCurrently() {
return canLoadGameStateCurrently();
}
+bool MohawkEngine_Riven::hasGameEnded() const {
+ return _gameEnded || shouldQuit();
+}
+
+void MohawkEngine_Riven::setGameEnded() {
+ _gameEnded = true;
+}
+
bool ZipMode::operator== (const ZipMode &z) const {
return z.name == name && z.id == id;
}