[Scummvm-cvs-logs] CVS: scummvm/scumm script_v100he.cpp,2.77,2.78 script_v6.cpp,1.422,1.423 script_v72he.cpp,2.213,2.214

kirben kirben at users.sourceforge.net
Sun Mar 6 22:38:23 CET 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv550/scumm

Modified Files:
	script_v100he.cpp script_v6.cpp script_v72he.cpp 
Log Message:

Minor cleanup


Index: script_v100he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v100he.cpp,v
retrieving revision 2.77
retrieving revision 2.78
diff -u -d -r2.77 -r2.78
--- script_v100he.cpp	7 Mar 2005 06:06:22 -0000	2.77
+++ script_v100he.cpp	7 Mar 2005 06:37:55 -0000	2.78
@@ -802,7 +802,7 @@
 
 void ScummEngine_v100he::o100_drawObject() {
 	byte subOp = fetchScriptByte();
-	int state = 0, y = -1, x = -1;
+	int state, y, x;
 
 	switch (subOp) {
 	case 6:
@@ -819,6 +819,7 @@
 		state = pop();
 		if (state == 0)
 			state = 1;
+		y = x = -100;
 		break;
 	default:
 		error("o100_drawObject: default case %d", subOp);
@@ -829,7 +830,7 @@
 	if (objnum == -1)
 		return;
 
-	if (y != -1 && x != -1) {
+	if (y != -100 && x != -100) {
 		_objs[objnum].x_pos = x * 8;
 		_objs[objnum].y_pos = y * 8;
 	}

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.422
retrieving revision 1.423
diff -u -d -r1.422 -r1.423
--- script_v6.cpp	1 Jan 2005 16:09:16 -0000	1.422
+++ script_v6.cpp	7 Mar 2005 06:37:55 -0000	1.423
@@ -2263,8 +2263,8 @@
 			return;
 		}
 	}
+
 	push(0);
-	return;
 }
 
 void ScummEngine_v6::o6_quitPauseRestart() {

Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.213
retrieving revision 2.214
diff -u -d -r2.213 -r2.214
--- script_v72he.cpp	7 Mar 2005 04:21:11 -0000	2.213
+++ script_v72he.cpp	7 Mar 2005 06:37:56 -0000	2.214
@@ -640,16 +640,17 @@
 }
 
 void ScummEngine_v72he::o72_isAnyOf() {
-	int args[128], i = 0;
-	int num = getStackList(args, ARRAYSIZE(args));
-	int value = pop();
+	int args[128];
+	int num, value;
 
-	while (i < num) {
+	num = getStackList(args, ARRAYSIZE(args));
+	value = pop();
+
+	for (int i = 0; i < num; i++) {
 		if (args[i] == value) {
 			push(1);
 			return;
 		}
-		i++;
 	}
 
 	push(0);
@@ -765,7 +766,7 @@
 
 void ScummEngine_v72he::o72_drawObject() {
 	byte subOp = fetchScriptByte();
-	int state = 0, y = -1, x = -1;
+	int state, y, x;
 
 	switch (subOp) {
 	case 62:
@@ -777,6 +778,7 @@
 		state = pop();
 		if (state == 0)
 			state = 1;
+		y = x = -100;
 		break;
 	case 65:
 		state = 1;
@@ -792,7 +794,7 @@
 	if (objnum == -1)
 		return;
 
-	if (y != -1 && x != -1) {
+	if (y != -100 && x != -100) {
 		_objs[objnum].x_pos = x * 8;
 		_objs[objnum].y_pos = y * 8;
 	}





More information about the Scummvm-git-logs mailing list