diff options
author | Bastien Bouclet | 2018-05-17 20:46:42 +0200 |
---|---|---|
committer | Bastien Bouclet | 2018-05-17 20:49:28 +0200 |
commit | 6798f9c77ebe9c436c16cd1525554eb49bc1ba1d (patch) | |
tree | 3a6d86bb9759ecc5a09e1fe47ebf54d080e076d8 /engines/mohawk/myst.cpp | |
parent | 44fd44ccc965b91a38c534e0a890772e83577c4b (diff) | |
download | scummvm-rg350-6798f9c77ebe9c436c16cd1525554eb49bc1ba1d.tar.gz scummvm-rg350-6798f9c77ebe9c436c16cd1525554eb49bc1ba1d.tar.bz2 scummvm-rg350-6798f9c77ebe9c436c16cd1525554eb49bc1ba1d.zip |
MOHAWK: Don't allow displaying the map when the game is not interactive
Fixes Trac#10526 and Trac#10531.
Diffstat (limited to 'engines/mohawk/myst.cpp')
-rw-r--r-- | engines/mohawk/myst.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index bda69183c3..f324c8cad4 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -91,7 +91,7 @@ MohawkEngine_Myst::MohawkEngine_Myst(OSystem *syst, const MohawkGameDescription _mouseClicked = false; _mouseMoved = false; _escapePressed = false; - _interactive = true; + _waitingOnBlockingOperation = false; _runExitScript = true; _needsPageDrop = false; @@ -310,7 +310,7 @@ void MohawkEngine_Myst::waitUntilMovieEnds(const VideoEntryPtr &video) { if (!video) return; - _interactive = false; + _waitingOnBlockingOperation = true; // Sanity check if (video->isLooping()) @@ -328,17 +328,17 @@ void MohawkEngine_Myst::waitUntilMovieEnds(const VideoEntryPtr &video) { // Ensure it's removed _video->removeEntry(video); - _interactive = true; + _waitingOnBlockingOperation = false; } void MohawkEngine_Myst::playSoundBlocking(uint16 id) { - _interactive = false; + _waitingOnBlockingOperation = true; _sound->playEffect(id); while (_sound->isEffectPlaying() && !shouldQuit()) { doFrame(); } - _interactive = true; + _waitingOnBlockingOperation = false; } Common::Error MohawkEngine_Myst::run() { @@ -389,10 +389,10 @@ Common::Error MohawkEngine_Myst::run() { void MohawkEngine_Myst::doFrame() { // Update any background videos _video->updateMovies(); - if (!_scriptParser->isScriptRunning() && _interactive) { - _interactive = false; + if (isInteractive()) { + _waitingOnBlockingOperation = true; _scriptParser->runPersistentScripts(); - _interactive = true; + _waitingOnBlockingOperation = false; } Common::Event event; @@ -446,7 +446,7 @@ void MohawkEngine_Myst::doFrame() { } if (_needsShowCredits) { - if (_interactive) { + if (isInteractive()) { _cursor->hideCursor(); changeToStack(kCreditsStack, 10000, 0, 0); _needsShowCredits = false; @@ -479,7 +479,7 @@ void MohawkEngine_Myst::doFrame() { } } - if (!_scriptParser->isScriptRunning() && _interactive) { + if (isInteractive()) { updateActiveResource(); checkCurrentResource(); } @@ -491,7 +491,7 @@ void MohawkEngine_Myst::doFrame() { } bool MohawkEngine_Myst::wait(uint32 duration, bool skippable) { - _interactive = false; + _waitingOnBlockingOperation = true; uint32 end = getTotalPlayTime() + duration; do { @@ -503,7 +503,7 @@ bool MohawkEngine_Myst::wait(uint32 duration, bool skippable) { } } while (getTotalPlayTime() < end && !shouldQuit()); - _interactive = true; + _waitingOnBlockingOperation = false; return false; } @@ -1165,8 +1165,12 @@ bool MohawkEngine_Myst::hasGameSaveSupport() const { return !(getFeatures() & GF_DEMO) && getGameType() != GType_MAKINGOF; } +bool MohawkEngine_Myst::isInteractive() { + return !_scriptParser->isScriptRunning() && !_waitingOnBlockingOperation; +} + bool MohawkEngine_Myst::canLoadGameStateCurrently() { - if (_scriptParser->isScriptRunning() || !_interactive) { + if (!isInteractive()) { return false; } |