aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins/script.cpp
diff options
context:
space:
mode:
authorStrangerke2013-02-27 23:18:43 +0100
committerStrangerke2013-02-27 23:18:43 +0100
commit94176c7463d64d12bc74232058f445f367456ee5 (patch)
treeae9727e297cb9826def58efb2ef9272c7be39184 /engines/hopkins/script.cpp
parent203aead81175e4c5985890b16222131d7befd59b (diff)
downloadscummvm-rg350-94176c7463d64d12bc74232058f445f367456ee5.tar.gz
scummvm-rg350-94176c7463d64d12bc74232058f445f367456ee5.tar.bz2
scummvm-rg350-94176c7463d64d12bc74232058f445f367456ee5.zip
HOPKINS: Some renaming in ScripManager
Diffstat (limited to 'engines/hopkins/script.cpp')
-rw-r--r--engines/hopkins/script.cpp41
1 files changed, 19 insertions, 22 deletions
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp
index 09555bd236..440b4a4d2b 100644
--- a/engines/hopkins/script.cpp
+++ b/engines/hopkins/script.cpp
@@ -2437,44 +2437,41 @@ int ScriptManager::handleGoto(const byte *dataP) {
return READ_LE_INT16(dataP + 5);
}
-int ScriptManager::handleIf(const byte *dataP, int a2) {
- int v20;
- int v2 = a2;
+int ScriptManager::handleIf(const byte *dataP, int offset) {
+ int newOffset;
+ int curOffset = offset;
bool loopFl;
do {
loopFl = false;
- int v3 = v2;
+ int tmpOffset = curOffset;
int opcodeType;
do {
if (_vm->shouldQuit())
return 0; // Exiting game
- ++v3;
- opcodeType = checkOpcode(dataP + 20 * v3);
- if (v3 > 400)
+ ++tmpOffset;
+ if (tmpOffset > 400)
error("Control if failed");
+ opcodeType = checkOpcode(dataP + 20 * tmpOffset);
} while (opcodeType != 4); // EIF
- v20 = v3;
- int v6 = v2;
- bool v7 = false;
+ newOffset = tmpOffset;
+ tmpOffset = curOffset;
do {
if (_vm->shouldQuit())
return 0; // Exiting game
- ++v6;
- if (checkOpcode(dataP + 20 * v6) == 3) // IIF
- v7 = true;
- if (v6 > 400)
+ ++tmpOffset;
+ if (tmpOffset > 400)
error("Control if failed ");
- if (v7) {
- v2 = v20;
+ if (checkOpcode(dataP + 20 * tmpOffset) == 3) { // IIF
+ curOffset = newOffset;
loopFl = true;
break;
}
- } while (v20 != v6);
+ } while (newOffset != tmpOffset);
} while (loopFl);
- const byte *buf = dataP + 20 * a2;
+ const byte *buf = dataP + 20 * offset;
byte oper = buf[13];
byte oper2 = buf[14];
byte operType = buf[15];
@@ -2503,14 +2500,14 @@ int ScriptManager::handleIf(const byte *dataP, int a2) {
}
if ((operType == 3) && check1Fl) {
- return (a2 + 1);
+ return (offset + 1);
} else if ((operType == 1) && check1Fl && check2Fl) {
- return (a2 + 1);
+ return (offset + 1);
} else if ((operType == 2) && (check1Fl || check2Fl)) {
- return (a2 + 1);
+ return (offset + 1);
}
- return (v20 + 1);
+ return (newOffset + 1);
}
int ScriptManager::checkOpcode(const byte *dataP) {