From 3fcff82dae63c3f45ad481c1038a7c7142b361c2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 23 Sep 2012 21:05:55 +1000 Subject: HOPKINS: Added extra shouldQuit check to animation player --- engines/hopkins/anim.cpp | 6 +++--- engines/hopkins/hopkins.cpp | 4 ++++ engines/hopkins/hopkins.h | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'engines/hopkins') diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp index 665f5590e1..33717eeb2f 100644 --- a/engines/hopkins/anim.cpp +++ b/engines/hopkins/anim.cpp @@ -170,7 +170,7 @@ void AnimationManager::PLAY_ANM(const Common::String &filename, uint32 rate1, ui _vm->_eventsManager.CONTROLE_MES(); _vm->_soundManager.VERIF_SOUND(); - } while (_vm->_eventsManager.lItCounter < rate2); + } while (_vm->_eventsManager.lItCounter < rate2 && !_vm->shouldQuit()); } _vm->_eventsManager.lItCounter = 0; @@ -196,7 +196,7 @@ void AnimationManager::PLAY_ANM(const Common::String &filename, uint32 rate1, ui _vm->_graphicsManager.DD_VBL(); _vm->_soundManager.VERIF_SOUND(); } - } while (!doneFlag); + } while (!doneFlag && !_vm->shouldQuit()); if (_vm->_globals.iRegul != 1) { _vm->_eventsManager.lItCounter = 0; @@ -225,7 +225,7 @@ REDRAW_ANIM: _vm->_eventsManager.CONTROLE_MES(); _vm->_soundManager.VERIF_SOUND(); - } while (_vm->_eventsManager.lItCounter < rate3); + } while (_vm->_eventsManager.lItCounter < rate3 && !_vm->shouldQuit()); _vm->_eventsManager.lItCounter = 0; _vm->_soundManager.VERIF_SOUND(); diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 61fb368794..9ab4d4cf27 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -473,6 +473,10 @@ LABEL_128: return Common::kNoError; } +bool HopkinsEngine::shouldQuit() const { + return g_system->getEventManager()->shouldQuit(); +} + int HopkinsEngine::getRandomNumber(int maxNumber) { return _randomSource.getRandomNumber(maxNumber); } diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h index 062fc1e191..6e7c3db020 100644 --- a/engines/hopkins/hopkins.h +++ b/engines/hopkins/hopkins.h @@ -113,6 +113,7 @@ public: Common::Language getLanguage() const; uint16 getVersion() const; bool getIsDemo() const; + bool shouldQuit() const; int getRandomNumber(int maxNumber); -- cgit v1.2.3