From 63b669cfc4ec0cae7be83949f98ee3fd48607f90 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 25 Mar 2013 09:18:13 -0400 Subject: HOPKINS: Fix for not being able to quit during underater base entrance cutscene --- engines/hopkins/events.cpp | 6 +++--- engines/hopkins/hopkins.cpp | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'engines') diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp index 1f42bf120a..a73ce41a0b 100644 --- a/engines/hopkins/events.cpp +++ b/engines/hopkins/events.cpp @@ -420,11 +420,11 @@ void EventsManager::refreshScreenAndEvents() { bool externalLoopFl = false; do { while (!_vm->shouldQuit()) { - checkForNextFrameCounter(); + pollEvents(); bool innerLoopFl = false; - while (_breakoutFl || _vm->_globals->iRegul != 1) { - checkForNextFrameCounter(); + while (!_vm->shouldQuit() && (_breakoutFl || _vm->_globals->iRegul != 1)) { + pollEvents(); if (!_breakoutFl) { innerLoopFl = true; diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index a355226914..4051e5acf8 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -2039,7 +2039,7 @@ void HopkinsEngine::playUnderwaterBaseCutscene() { _graphicsManager->displayAllBob(); _objectsManager->loadLinkFile("IM92"); - for (int cpt = 0; cpt <= 4; cpt++) + for (int cpt = 0; cpt <= 4 && !shouldQuit(); cpt++) _eventsManager->refreshScreenAndEvents(); _graphicsManager->fadeInLong(); @@ -2047,14 +2047,16 @@ void HopkinsEngine::playUnderwaterBaseCutscene() { do _eventsManager->refreshScreenAndEvents(); - while (_objectsManager->getBobAnimDataIdx(8) != 22); + while (!shouldQuit() && _objectsManager->getBobAnimDataIdx(8) != 22); - _graphicsManager->fadeOutLong(); - _graphicsManager->endDisplayBob(); - _objectsManager->resetHidingItems(); - _globals->_disableInventFl = false; - _globals->_exitId = 93; - _globals->iRegul = 0; + if (!shouldQuit()) { + _graphicsManager->fadeOutLong(); + _graphicsManager->endDisplayBob(); + _objectsManager->resetHidingItems(); + _globals->_disableInventFl = false; + _globals->_exitId = 93; + _globals->iRegul = 0; + } } void HopkinsEngine::playEnding() { -- cgit v1.2.3