aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2013-02-06 21:44:32 +0100
committerStrangerke2013-02-06 21:44:32 +0100
commit2e47d8fe7a1978078b2ccd54982401bb3add9f13 (patch)
tree28390ecfee20eb57d983fe9847fd5b1c5720c168 /engines
parent7d40d1e2e31d602f0db016040340cc55ff73f0b5 (diff)
downloadscummvm-rg350-2e47d8fe7a1978078b2ccd54982401bb3add9f13.tar.gz
scummvm-rg350-2e47d8fe7a1978078b2ccd54982401bb3add9f13.tar.bz2
scummvm-rg350-2e47d8fe7a1978078b2ccd54982401bb3add9f13.zip
HOPKINS: Renaming in ScriptManager and DialogManager
Diffstat (limited to 'engines')
-rw-r--r--engines/hopkins/script.cpp67
-rw-r--r--engines/hopkins/talk.cpp26
2 files changed, 46 insertions, 47 deletions
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp
index a4d768023a..cf4f296fff 100644
--- a/engines/hopkins/script.cpp
+++ b/engines/hopkins/script.cpp
@@ -2429,42 +2429,41 @@ int ScriptManager::handleGoto(const byte *dataP) {
}
int ScriptManager::handleIf(const byte *dataP, int a2) {
- int v2;
- int v3;
- int v4;
- int v6;
- bool v7;
int v20;
-
- v2 = a2;
-LABEL_2:
- v3 = v2;
- do {
- if (_vm->shouldQuit())
- return 0; // Exiting game
-
- ++v3;
- v4 = checkOpcode(dataP + 20 * v3);
- if (v3 > 400)
- error("Control if failed");
- } while (v4 != 4); // EIF
- v20 = v3;
- v6 = v2;
- v7 = false;
+ int v2 = a2;
+ bool loopFl;
do {
- if (_vm->shouldQuit())
- return 0; // Exiting game
-
- ++v6;
- if (checkOpcode(dataP + 20 * v6) == 3) // IIF
- v7 = true;
- if (v6 > 400)
- error("Control if failed ");
- if (v7) {
- v2 = v20;
- goto LABEL_2;
- }
- } while (v20 != v6);
+ loopFl = false;
+ int v3 = v2;
+ int opcodeType;
+ do {
+ if (_vm->shouldQuit())
+ return 0; // Exiting game
+
+ ++v3;
+ opcodeType = checkOpcode(dataP + 20 * v3);
+ if (v3 > 400)
+ error("Control if failed");
+ } while (opcodeType != 4); // EIF
+ v20 = v3;
+ int v6 = v2;
+ bool v7 = false;
+ do {
+ if (_vm->shouldQuit())
+ return 0; // Exiting game
+
+ ++v6;
+ if (checkOpcode(dataP + 20 * v6) == 3) // IIF
+ v7 = true;
+ if (v6 > 400)
+ error("Control if failed ");
+ if (v7) {
+ v2 = v20;
+ loopFl = true;
+ break;
+ }
+ } while (v20 != v6);
+ } while (loopFl);
const byte *buf = dataP + 20 * a2;
byte oper = buf[13];
diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp
index 29679fe547..12ad4d85f0 100644
--- a/engines/hopkins/talk.cpp
+++ b/engines/hopkins/talk.cpp
@@ -770,10 +770,10 @@ bool TalkManager::searchCharacterAnim(int idx, const byte *bufPerso, int animId,
void TalkManager::REPONSE(int zone, int verb) {
uint16 v7;
byte *v8;
- int v10;
+ int opcodeType;
uint16 v11;
int v12;
- int v13;
+ int lastOpcodeResult;
bool tagFound;
bool v16;
bool loopCond;
@@ -836,29 +836,29 @@ LABEL_2:
v7 = 0;
} while (!loopCond);
loopCond = false;
- v13 = 1;
+ lastOpcodeResult = 1;
do {
- v10 = _vm->_scriptManager.handleOpcode(ptr + 20 * v13);
+ opcodeType = _vm->_scriptManager.handleOpcode(ptr + 20 * lastOpcodeResult);
if (_vm->shouldQuit())
return;
- if (v10 == 2)
+ if (opcodeType == 2)
// GOTO
- v13 = _vm->_scriptManager.handleGoto(ptr + 20 * v13);
- else if (v10 == 3)
+ lastOpcodeResult = _vm->_scriptManager.handleGoto(ptr + 20 * lastOpcodeResult);
+ else if (opcodeType == 3)
// IF
- v13 = _vm->_scriptManager.handleIf(ptr, v13);
+ lastOpcodeResult = _vm->_scriptManager.handleIf(ptr, lastOpcodeResult);
- if (v13 == -1)
+ if (lastOpcodeResult == -1)
error("Invalid IFF function");
- if (v10 == 1 || v10 == 4)
+ if (opcodeType == 1 || opcodeType == 4)
// Already handled opcode or END IF
- ++v13;
- else if (!v10 || v10 == 5)
+ ++lastOpcodeResult;
+ else if (!opcodeType || opcodeType == 5)
// EXIT
loopCond = true;
- else if (v10 == 6) {
+ else if (opcodeType == 6) {
// JUMP
_vm->_globals.freeMemory(ptr);
zoneObj = _vm->_objectsManager._jumpZone;