HOPKINS: Renaming in ScriptManager and DialogManager

This commit is contained in:
Strangerke 2013-02-06 21:44:32 +01:00
parent 7d40d1e2e3
commit 2e47d8fe7a
2 changed files with 44 additions and 45 deletions

View File

@ -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;
int v2 = a2;
bool loopFl;
do {
if (_vm->shouldQuit())
return 0; // Exiting game
loopFl = false;
int v3 = v2;
int opcodeType;
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;
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;
goto LABEL_2;
}
} while (v20 != v6);
++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];

View File

@ -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;