diff options
| author | Strangerke | 2013-02-06 21:44:32 +0100 |
|---|---|---|
| committer | Strangerke | 2013-02-06 21:44:32 +0100 |
| commit | 2e47d8fe7a1978078b2ccd54982401bb3add9f13 (patch) | |
| tree | 28390ecfee20eb57d983fe9847fd5b1c5720c168 /engines/hopkins/script.cpp | |
| parent | 7d40d1e2e31d602f0db016040340cc55ff73f0b5 (diff) | |
| download | scummvm-rg350-2e47d8fe7a1978078b2ccd54982401bb3add9f13.tar.gz scummvm-rg350-2e47d8fe7a1978078b2ccd54982401bb3add9f13.tar.bz2 scummvm-rg350-2e47d8fe7a1978078b2ccd54982401bb3add9f13.zip | |
HOPKINS: Renaming in ScriptManager and DialogManager
Diffstat (limited to 'engines/hopkins/script.cpp')
| -rw-r--r-- | engines/hopkins/script.cpp | 67 |
1 files changed, 33 insertions, 34 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]; |
