[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.403,2.404 script_v100he.cpp,2.100,2.101 script_v72he.cpp,2.224,2.225 script_v90he.cpp,2.195,2.196 sprite_he.cpp,1.106,1.107

kirben kirben at users.sourceforge.net
Mon Mar 28 03:38:44 CEST 2005


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

Modified Files:
	intern.h script_v100he.cpp script_v72he.cpp script_v90he.cpp 
	sprite_he.cpp 
Log Message:

Check class of object number, not loop.
Cleanup.


Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.403
retrieving revision 2.404
diff -u -d -r2.403 -r2.404
--- intern.h	28 Mar 2005 10:02:21 -0000	2.403
+++ intern.h	28 Mar 2005 11:38:04 -0000	2.404
@@ -912,8 +912,7 @@
 	void copyHEPaletteColor(int palSlot, uint8 dstColor, uint8 srcColor);
 
 	int findSpriteWithClassOf(int x, int y, int spriteGroupId, int d, int num, int *args);
-	int spriteInfoGet_classFlags(int spriteId, int num);
-	int spriteInfoGet_classFlagsAnd(int spriteId, int num, int *args);
+	int spriteInfoGet_classFlags(int spriteId, int num, int *args);
 	int spriteInfoGet_flags_13(int spriteId);
 	int spriteInfoGet_flagYFlipped(int spriteId);
 	int spriteInfoGet_flagXFlipped(int spriteId);

Index: script_v100he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v100he.cpp,v
retrieving revision 2.100
retrieving revision 2.101
diff -u -d -r2.100 -r2.101
--- script_v100he.cpp	28 Mar 2005 10:02:21 -0000	2.100
+++ script_v100he.cpp	28 Mar 2005 11:38:04 -0000	2.101
@@ -2537,10 +2537,7 @@
 		flags = getStackList(args, ARRAYSIZE(args));
 		spriteId = pop();
 		if (spriteId) {
-			if (flags)
-				push(spriteInfoGet_classFlagsAnd(spriteId, flags, args));
-			else
-				push(spriteInfoGet_classFlags(spriteId, -1));
+			push(spriteInfoGet_classFlags(spriteId, flags, args));
 		} else {
 			push(0);
 		}

Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.224
retrieving revision 2.225
diff -u -d -r2.224 -r2.225
--- script_v72he.cpp	28 Mar 2005 10:02:21 -0000	2.224
+++ script_v72he.cpp	28 Mar 2005 11:38:04 -0000	2.225
@@ -683,7 +683,7 @@
 
 			// Check object class
 			cls = args[0];
-			b = getClass(i, cls);
+			b = getClass(_objs[i].obj_nr, cls);
 			if ((cls & 0x80 && b) || (!(cls & 0x80) && !b))
 				return result;
 		}

Index: script_v90he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v90he.cpp,v
retrieving revision 2.195
retrieving revision 2.196
diff -u -d -r2.195 -r2.196
--- script_v90he.cpp	28 Mar 2005 10:02:22 -0000	2.195
+++ script_v90he.cpp	28 Mar 2005 11:38:04 -0000	2.196
@@ -958,10 +958,7 @@
 		flags = getStackList(args, ARRAYSIZE(args));
 		spriteId = pop();
 		if (spriteId) {
-			if (flags)
-				push(spriteInfoGet_classFlagsAnd(spriteId, flags, args));
-			else
-				push(spriteInfoGet_classFlags(spriteId, -1));
+			push(spriteInfoGet_classFlags(spriteId, flags, args));
 		} else {
 			push(0);
 		}
@@ -1715,7 +1712,7 @@
 		tmp = num;
 		while (--tmp >= 0) {
 			cls = args[tmp];
-			b = getClass(i, cls);
+			b = getClass(_objs[i].obj_nr, cls);
 			if ((cls & 0x80 && !b) || (!(cls & 0x80) && b))
 				cond = 0;
 		}
@@ -1723,6 +1720,7 @@
 		if (cond)
 			writeArray(0, 0, j++, _objs[i].obj_nr);
 	}
+
 	writeArray(0, 0, 0, j);
 	
 	push(readVar(0));

Index: sprite_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sprite_he.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- sprite_he.cpp	24 Mar 2005 03:47:53 -0000	1.106
+++ sprite_he.cpp	28 Mar 2005 11:38:04 -0000	1.107
@@ -140,23 +140,12 @@
 	return 0;
 }
 
-int ScummEngine_v90he::spriteInfoGet_classFlags(int spriteId, int classId) {
+int ScummEngine_v90he::spriteInfoGet_classFlags(int spriteId, int num, int *args) {
 	checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d");
-
-	if (classId == -1)
-		return _spriteTable[spriteId].class_flags; 
-
-	checkRange(32, 1, classId, "class %d out of range in statement");
-	return ((_spriteTable[spriteId].class_flags & (1 << classId)) != 0) ? 1 : 0;
-}
-
-int ScummEngine_v90he::spriteInfoGet_classFlagsAnd(int spriteId, int num, int *args) {
 	int code, classId;
 
-	checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d");
-
-	if (!num)
-		return 1;
+	if (num == 0)
+		return _spriteTable[spriteId].class_flags; 
 
 	for (int i = 0; i < num; i++) {
 		code = classId = args[i];
@@ -647,9 +636,9 @@
 	checkRange(32, 1, classId, "class %d out of range in statement");
 	
 	if (toggle) {
-		_spriteTable[spriteId].class_flags |= (1 << (classId));
+		_spriteTable[spriteId].class_flags |= (1 << classId);
 	} else {
-		_spriteTable[spriteId].class_flags &= ~(1 << (classId));
+		_spriteTable[spriteId].class_flags &= ~(1 << classId);
 	}
 }
 





More information about the Scummvm-git-logs mailing list