[Scummvm-cvs-logs] scummvm master -> 94176c7463d64d12bc74232058f445f367456ee5

Strangerke Strangerke at scummvm.org
Wed Feb 27 23:19:36 CET 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
94176c7463 HOPKINS: Some renaming in ScripManager


Commit: 94176c7463d64d12bc74232058f445f367456ee5
    https://github.com/scummvm/scummvm/commit/94176c7463d64d12bc74232058f445f367456ee5
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-02-27T14:18:43-08:00

Commit Message:
HOPKINS: Some renaming in ScripManager

Changed paths:
    engines/hopkins/script.cpp
    engines/hopkins/script.h



diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp
index 09555bd..440b4a4 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) {
diff --git a/engines/hopkins/script.h b/engines/hopkins/script.h
index cf719f5..3eba8d5 100644
--- a/engines/hopkins/script.h
+++ b/engines/hopkins/script.h
@@ -42,7 +42,7 @@ public:
 	void setParent(HopkinsEngine *vm);
 
 	int handleOpcode(byte *dataP);
-	int handleIf(const byte *dataP, int a2);
+	int handleIf(const byte *dataP, int offset);
 	int handleGoto(const byte *dataP);
 };
 






More information about the Scummvm-git-logs mailing list