diff options
author | Strangerke | 2013-02-03 22:28:38 +0100 |
---|---|---|
committer | Strangerke | 2013-02-03 22:28:38 +0100 |
commit | cec23051b340cd112841e9f930f97b6ec1c0d01a (patch) | |
tree | 0b2425c9fe3535bbc85877c9f70f25ac5251727b /engines/hopkins | |
parent | 49afc87b883c89c01a8638e158a5a533279ef073 (diff) | |
download | scummvm-rg350-cec23051b340cd112841e9f930f97b6ec1c0d01a.tar.gz scummvm-rg350-cec23051b340cd112841e9f930f97b6ec1c0d01a.tar.bz2 scummvm-rg350-cec23051b340cd112841e9f930f97b6ec1c0d01a.zip |
HOPKINS: Fix the Esc key behavior in playSequence, remove several GOTOs
Diffstat (limited to 'engines/hopkins')
-rw-r--r-- | engines/hopkins/anim.cpp | 113 | ||||
-rw-r--r-- | engines/hopkins/events.cpp | 2 |
2 files changed, 72 insertions, 43 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp index 0115f854a0..e2980b3eae 100644 --- a/engines/hopkins/anim.cpp +++ b/engines/hopkins/anim.cpp @@ -606,6 +606,8 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui size_t nbytes; Common::File f; + bool skipFl = false; + if (_vm->shouldQuit()) return; @@ -665,9 +667,13 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui do { if (_vm->_eventsManager._escKeyFl) { if (!_vm->_eventsManager._disableEscKeyFl) - goto LABEL_59; - _vm->_eventsManager._escKeyFl = false; + skipFl = true; + else + _vm->_eventsManager._escKeyFl = false; } + if (skipFl) + break; + _vm->_eventsManager.refreshEvents(); _vm->_soundManager.checkSoundEnd(); } while (_vm->_eventsManager._rateCounter < rate1); @@ -682,9 +688,14 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui do { if (_vm->_eventsManager._escKeyFl) { if (!_vm->_eventsManager._disableEscKeyFl) - goto LABEL_59; - _vm->_eventsManager._escKeyFl = false; + skipFl = true; + else + _vm->_eventsManager._escKeyFl = false; } + + if (skipFl) + break; + _vm->_eventsManager.refreshEvents(); _vm->_soundManager.checkSoundEnd(); } while (_vm->_eventsManager._rateCounter < rate1); @@ -693,57 +704,73 @@ void AnimationManager::playSequence(const Common::String &file, uint32 rate1, ui _vm->_eventsManager._rateCounter = 0; readError = false; soundNumber = 0; - do { - ++soundNumber; - _vm->_soundManager.playAnimSound(soundNumber); - memset(v10, 0, 19); - if (f.read(v10, 16) != 16) - readError = true; - - if (strncmp((const char *)v10, "IMAGE=", 6)) - readError = true; - if (!readError) { - f.read(screenP, READ_LE_UINT32(v10 + 8)); - if (_vm->_globals.iRegul == 1) { - do { - if (_vm->_eventsManager._escKeyFl) { - if (!_vm->_eventsManager._disableEscKeyFl) - goto LABEL_59; - _vm->_eventsManager._escKeyFl = false; + if (!skipFl) { + do { + ++soundNumber; + _vm->_soundManager.playAnimSound(soundNumber); + memset(v10, 0, 19); + if (f.read(v10, 16) != 16) + readError = true; + + if (strncmp((const char *)v10, "IMAGE=", 6)) + readError = true; + if (!readError) { + f.read(screenP, READ_LE_UINT32(v10 + 8)); + if (_vm->_globals.iRegul == 1) { + do { + if (_vm->_eventsManager._escKeyFl) { + if (!_vm->_eventsManager._disableEscKeyFl) + skipFl = true; + else + _vm->_eventsManager._escKeyFl = false; + } + + if (skipFl) + break; + + _vm->_eventsManager.refreshEvents(); + _vm->_soundManager.checkSoundEnd(); + } while (_vm->_eventsManager._rateCounter < rate2); + } + + if (skipFl) + break; + + _vm->_eventsManager._rateCounter = 0; + _vm->_graphicsManager.lockScreen(); + if (hasScreenCopy) { + if (*screenP != kByteStop) { + _vm->_graphicsManager.Copy_WinScan_Vbe(screenP, screenCopy); + _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); } - _vm->_eventsManager.refreshEvents(); - _vm->_soundManager.checkSoundEnd(); - } while (_vm->_eventsManager._rateCounter < rate2); - } - _vm->_eventsManager._rateCounter = 0; - _vm->_graphicsManager.lockScreen(); - if (hasScreenCopy) { - if (*screenP != kByteStop) { - _vm->_graphicsManager.Copy_WinScan_Vbe(screenP, screenCopy); - _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); + } else if (*screenP != kByteStop) { + _vm->_graphicsManager.Copy_Video_Vbe16a(screenP); } - } else if (*screenP != kByteStop) { - _vm->_graphicsManager.Copy_Video_Vbe16a(screenP); + _vm->_graphicsManager.unlockScreen(); + _vm->_graphicsManager.DD_VBL(); + _vm->_soundManager.checkSoundEnd(); } - _vm->_graphicsManager.unlockScreen(); - _vm->_graphicsManager.DD_VBL(); - _vm->_soundManager.checkSoundEnd(); - } - } while (!readError); + } while (!readError); + } - if (_vm->_globals.iRegul == 1) { + if (_vm->_globals.iRegul == 1 && !skipFl) { do { if (_vm->_eventsManager._escKeyFl) { if (!_vm->_eventsManager._disableEscKeyFl) - goto LABEL_59; - _vm->_eventsManager._escKeyFl = false; + skipFl = true; + else + _vm->_eventsManager._escKeyFl = false; } + if (skipFl) + break; _vm->_eventsManager.refreshEvents(); _vm->_soundManager.checkSoundEnd(); } while (_vm->_eventsManager._rateCounter < rate3); } - _vm->_eventsManager._rateCounter = 0; -LABEL_59: + + if (!skipFl) + _vm->_eventsManager._rateCounter = 0; + _vm->_graphicsManager._skipVideoLockFl = false; f.close(); diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp index 31b972cdc3..98ce803e18 100644 --- a/engines/hopkins/events.cpp +++ b/engines/hopkins/events.cpp @@ -53,6 +53,8 @@ EventsManager::EventsManager() { Common::fill(&_keyState[0], &_keyState[256], false); _priorCounterTime = 0; _priorFrameTime = 0; + + _disableEscKeyFl = false; } EventsManager::~EventsManager() { |