aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2013-02-03 10:27:53 +0100
committerStrangerke2013-02-03 10:27:53 +0100
commitc56efbb203d3a5b07070ee53bdb78a30526ac9ae (patch)
treea3103cc24f2d319170401df8089e4d4df6a50b99
parent3653f2b21463025b46cb5bcba87d96a72cc8d4ab (diff)
downloadscummvm-rg350-c56efbb203d3a5b07070ee53bdb78a30526ac9ae.tar.gz
scummvm-rg350-c56efbb203d3a5b07070ee53bdb78a30526ac9ae.tar.bz2
scummvm-rg350-c56efbb203d3a5b07070ee53bdb78a30526ac9ae.zip
HOPKINS: More refactoring in playAnim2: Get rid of another label and associated GOTO
-rw-r--r--engines/hopkins/anim.cpp56
1 files changed, 27 insertions, 29 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp
index 865a6812cd..24c300c210 100644
--- a/engines/hopkins/anim.cpp
+++ b/engines/hopkins/anim.cpp
@@ -318,33 +318,31 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 rate1, u
if (strncmp((const char *)ptr, "IMAGE=", 6))
v5 = true;
- if (v5)
- goto LABEL_88;
- f.read(screenP, READ_LE_UINT32(ptr + 8));
- if (_vm->_globals.iRegul == 1) {
- while (!_vm->_eventsManager._escKeyFl) {
- _vm->_eventsManager.refreshEvents();
- _vm->_soundManager.checkSoundEnd();
- if (_vm->_eventsManager._rateCounter >= rate2)
- break;
+ if (!v5) {
+ f.read(screenP, READ_LE_UINT32(ptr + 8));
+ if (_vm->_globals.iRegul == 1) {
+ while (!_vm->_eventsManager._escKeyFl) {
+ _vm->_eventsManager.refreshEvents();
+ _vm->_soundManager.checkSoundEnd();
+ if (_vm->_eventsManager._rateCounter >= rate2)
+ break;
+ }
}
- }
- _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);
+ _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);
}
- } else if (*screenP != kByteStop) {
- _vm->_graphicsManager.Copy_Video_Vbe16(screenP);
- }
- _vm->_graphicsManager.unlockScreen();
- _vm->_graphicsManager.DD_VBL();
- _vm->_soundManager.checkSoundEnd();
-LABEL_88:
- if (v5) {
+ _vm->_graphicsManager.unlockScreen();
+ _vm->_graphicsManager.DD_VBL();
+ _vm->_soundManager.checkSoundEnd();
+ } else {
if (_vm->_globals.iRegul == 1) {
while (!_vm->_eventsManager._escKeyFl) {
_vm->_eventsManager.refreshEvents();
@@ -353,7 +351,7 @@ LABEL_88:
break;
}
}
- goto LABEL_114;
+ break;
}
}
LABEL_114:
@@ -380,21 +378,21 @@ LABEL_114:
f.read(screenP, nbytes);
memcpy(ptra, screenP, 307200);
- int v6 = 0;
+ bool v6 = false;
do {
memset(&buf, 0, 6);
memset(ptr, 0, 19);
if (f.read(ptr, 16) != 16)
- v6 = -1;
+ v6 = true;
if (strncmp((const char *)ptr, "IMAGE=", 6))
- v6 = -1;
+ v6 = true;
if (!v6) {
f.read(screenP, READ_LE_UINT32(ptr + 8));
if (*screenP != kByteStop)
_vm->_graphicsManager.Copy_WinScan_Vbe3(screenP, ptra);
}
- } while (v6 != -1);
+ } while (!v6);
_vm->_graphicsManager.fadeOutDefaultLength(ptra);
ptra = _vm->_globals.freeMemory(ptra);
}