diff options
author | Strangerke | 2016-05-19 07:59:07 +0200 |
---|---|---|
committer | Strangerke | 2016-05-19 07:59:07 +0200 |
commit | 9a2bc3c5720e807978fa8a302b5b3c532fb62d30 (patch) | |
tree | 8349a4075ab73882286d48955c14bca9353a3e25 /engines/gnap/scenes/arcade.cpp | |
parent | 97ac77b5f1b41b77b5e9a79bac0f6a11a4063386 (diff) | |
download | scummvm-rg350-9a2bc3c5720e807978fa8a302b5b3c532fb62d30.tar.gz scummvm-rg350-9a2bc3c5720e807978fa8a302b5b3c532fb62d30.tar.bz2 scummvm-rg350-9a2bc3c5720e807978fa8a302b5b3c532fb62d30.zip |
GNAP: Add several checks on _gameDone in order to quit the game quickly
Diffstat (limited to 'engines/gnap/scenes/arcade.cpp')
-rw-r--r-- | engines/gnap/scenes/arcade.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/engines/gnap/scenes/arcade.cpp b/engines/gnap/scenes/arcade.cpp index 80c7c656c6..84662507f3 100644 --- a/engines/gnap/scenes/arcade.cpp +++ b/engines/gnap/scenes/arcade.cpp @@ -718,10 +718,12 @@ bool Scene50::updateEnergyBars(int newLeftBarPos, int newRightBarPos) { } void Scene50::waitForAnim(int animationIndex) { - while (_vm->_gameSys->getAnimationStatus(animationIndex) != 2) { + GameSys& gameSys = *_vm->_gameSys; + + while (gameSys.getAnimationStatus(animationIndex) != 2 && !_vm->_gameDone) _vm->gameUpdateTick(); - } - _vm->_gameSys->setAnimation(0, 0, animationIndex); + + gameSys.setAnimation(0, 0, animationIndex); } int Scene50::checkInput() { @@ -945,7 +947,7 @@ void Scene50::run() { _vm->_timers[5] = 15; - while (!_fightDone) { + while (!_fightDone && !_vm->_gameDone) { /* TODO if (sceneXX_sub_4466B1()) _fightDone = true; @@ -1458,8 +1460,7 @@ bool Scene51::isJumping(int sequenceId) { } void Scene51::waitForAnim(int animationIndex) { - while (_vm->_gameSys->getAnimationStatus(animationIndex) != 2) { - // pollMessages(); + while (_vm->_gameSys->getAnimationStatus(animationIndex) != 2 && _vm->_gameDone) { updateItemAnimations(); _vm->gameUpdateTick(); } @@ -1605,10 +1606,9 @@ void Scene51::winMinigame() { void Scene51::playCashAppearAnim() { _vm->_gameSys->setAnimation(0xC8, 252, 0); _vm->_gameSys->insertSequence(0xC8, 252, 0, 0, kSeqNone, 0, -20, -20); - while (_vm->_gameSys->getAnimationStatus(0) != 2) { + + while (_vm->_gameSys->getAnimationStatus(0) != 2 && !_vm->_gameDone) _vm->gameUpdateTick(); - // checkGameAppStatus(); - } } void Scene51::updateCash(int amount) { @@ -1726,8 +1726,7 @@ void Scene51::run() { isIdle = false; } - while (_vm->isKeyStatus2(Common::KEYCODE_RIGHT) && _platypusNextSequenceId != 0x96) { - // pollMessages(); + while (_vm->isKeyStatus2(Common::KEYCODE_RIGHT) && _platypusNextSequenceId != 0x96 && !_vm->_gameDone) { if (_platypusNextSequenceId == 0xB6) _platypusNextSequenceId = 0x76; updateItemAnimations(); @@ -1780,8 +1779,7 @@ void Scene51::run() { _vm->gameUpdateTick(); } - while (_vm->isKeyStatus2(Common::KEYCODE_LEFT) && _platypusNextSequenceId != 0xB6) { - // pollMessages(); + while (_vm->isKeyStatus2(Common::KEYCODE_LEFT) && _platypusNextSequenceId != 0xB6 && !_vm->_gameDone) { updateItemAnimations(); if (startWalk) { _platypusNextSequenceId = 0xA5; @@ -1879,7 +1877,7 @@ void Scene52::updateHotspots() { } void Scene52::update() { - for (int rowNum = 0; rowNum < 7; ++rowNum) { + for (int rowNum = 0; rowNum < 7 && !_vm->_gameDone; ++rowNum) { _vm->gameUpdateTick(); if (_vm->_gameSys->getAnimationStatus(_alienRowAnims[rowNum]) == 2) { updateAlienRow(rowNum); @@ -1936,7 +1934,7 @@ void Scene52::update() { loseShip(); if (_shipsLeft != 0) { _vm->_timers[3] = 40; - while (_vm->_timers[3]) { + while (_vm->_timers[3] && !_vm->_gameDone) { updateAlienCannons(); if (_shipCannonFiring) updateShipCannon(); |