diff options
author | Strangerke | 2013-02-03 07:59:48 +0100 |
---|---|---|
committer | Strangerke | 2013-02-03 07:59:48 +0100 |
commit | aa4f39e6666c6c49df76a926d80a6e2420cfffd4 (patch) | |
tree | 92444b13d99028b8216c70c92000ca7953f8835f /engines/hopkins | |
parent | 6797698af8fe90cd8cbfa02870e38f6ca47f7ca9 (diff) | |
download | scummvm-rg350-aa4f39e6666c6c49df76a926d80a6e2420cfffd4.tar.gz scummvm-rg350-aa4f39e6666c6c49df76a926d80a6e2420cfffd4.tar.bz2 scummvm-rg350-aa4f39e6666c6c49df76a926d80a6e2420cfffd4.zip |
HOPKINS: Remove two GOTOs in playAnim()
Diffstat (limited to 'engines/hopkins')
-rw-r--r-- | engines/hopkins/anim.cpp | 76 |
1 files changed, 41 insertions, 35 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp index 52212c6b45..529c4e6f34 100644 --- a/engines/hopkins/anim.cpp +++ b/engines/hopkins/anim.cpp @@ -108,53 +108,57 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui // Do pre-animation delay do { if (_vm->_eventsManager._escKeyFl) - goto EXIT; + break; _vm->_eventsManager.refreshEvents(); } while (!_vm->shouldQuit() && _vm->_eventsManager._rateCounter < rate1); } - _vm->_eventsManager._rateCounter = 0; - frameNumber = 0; - while (!_vm->shouldQuit()) { - ++frameNumber; - _vm->_soundManager.playAnimSound(frameNumber); + if (!_vm->_eventsManager._escKeyFl) { + _vm->_eventsManager._rateCounter = 0; + frameNumber = 0; + while (!_vm->shouldQuit()) { + ++frameNumber; + _vm->_soundManager.playAnimSound(frameNumber); - // Read frame header - if (f.read(ptr, 16) != 16) - break; + // Read frame header + if (f.read(ptr, 16) != 16) + break; - if (strncmp((char *)ptr, "IMAGE=", 6)) - break; + if (strncmp((char *)ptr, "IMAGE=", 6)) + break; - f.read(screenP, READ_LE_UINT32(ptr + 8)); + f.read(screenP, READ_LE_UINT32(ptr + 8)); - if (_vm->_globals.iRegul == 1) { - do { - if (_vm->_eventsManager._escKeyFl) - goto EXIT; + if (_vm->_globals.iRegul == 1) { + do { + if (_vm->_eventsManager._escKeyFl) + break; - _vm->_eventsManager.refreshEvents(); - _vm->_soundManager.checkSoundEnd(); - } while (!_vm->shouldQuit() && _vm->_eventsManager._rateCounter < rate2); - } + _vm->_eventsManager.refreshEvents(); + _vm->_soundManager.checkSoundEnd(); + } while (!_vm->shouldQuit() && _vm->_eventsManager._rateCounter < rate2); + } - _vm->_eventsManager._rateCounter = 0; - _vm->_graphicsManager.lockScreen(); - if (hasScreenCopy) { - if (*screenP != kByteStop) { - _vm->_graphicsManager.Copy_WinScan_Vbe3(screenP, screenCopy); - _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); + if (!_vm->_eventsManager._escKeyFl) { + _vm->_eventsManager._rateCounter = 0; + _vm->_graphicsManager.lockScreen(); + if (hasScreenCopy) { + if (*screenP != kByteStop) { + _vm->_graphicsManager.Copy_WinScan_Vbe3(screenP, screenCopy); + _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); + } + } else if (*screenP != kByteStop) { + _vm->_graphicsManager.Copy_Video_Vbe16(screenP); + } + _vm->_graphicsManager.unlockScreen(); + _vm->_graphicsManager.DD_VBL(); + _vm->_soundManager.checkSoundEnd(); } - } else if (*screenP != kByteStop) { - _vm->_graphicsManager.Copy_Video_Vbe16(screenP); } - _vm->_graphicsManager.unlockScreen(); - _vm->_graphicsManager.DD_VBL(); - _vm->_soundManager.checkSoundEnd(); } - if (_vm->_globals.iRegul == 1) { + if (_vm->_globals.iRegul == 1 && !_vm->_eventsManager._escKeyFl) { // Do post-animation delay do { if (_vm->_eventsManager._escKeyFl) @@ -165,9 +169,11 @@ void AnimationManager::playAnim(const Common::String &filename, uint32 rate1, ui } while (_vm->_eventsManager._rateCounter < rate3); } - _vm->_eventsManager._rateCounter = 0; - _vm->_soundManager.checkSoundEnd(); -EXIT: + if (!_vm->_eventsManager._escKeyFl) { + _vm->_eventsManager._rateCounter = 0; + _vm->_soundManager.checkSoundEnd(); + } + if (_vm->_graphicsManager.FADE_LINUX == 2 && !hasScreenCopy) { screenCopy = _vm->_globals.allocMemory(307200); |