Skip to content

Commit

Permalink
HOPKINS: Added extra shouldQuit check to animation player
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Sep 23, 2012
1 parent 4f40d98 commit 3fcff82
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions engines/hopkins/anim.cpp
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -225,7 +225,7 @@ void AnimationManager::PLAY_ANM(const Common::String &filename, uint32 rate1, ui

_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();
Expand Down
4 changes: 4 additions & 0 deletions engines/hopkins/hopkins.cpp
Expand Up @@ -473,6 +473,10 @@ Common::Error HopkinsEngine::run() {
return Common::kNoError;
}

bool HopkinsEngine::shouldQuit() const {
return g_system->getEventManager()->shouldQuit();
}

int HopkinsEngine::getRandomNumber(int maxNumber) {
return _randomSource.getRandomNumber(maxNumber);
}
Expand Down
1 change: 1 addition & 0 deletions engines/hopkins/hopkins.h
Expand Up @@ -113,6 +113,7 @@ class HopkinsEngine : public Engine {
Common::Language getLanguage() const;
uint16 getVersion() const;
bool getIsDemo() const;
bool shouldQuit() const;

int getRandomNumber(int maxNumber);

Expand Down

0 comments on commit 3fcff82

Please sign in to comment.