[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.359,2.360 script_v100he.cpp,2.59,2.60 script_v90he.cpp,2.152,2.153 sprite_he.cpp,1.35,1.36
Eugene Sandulenko
sev at users.sourceforge.net
Wed Feb 23 04:27:20 CET 2005
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6986
Modified Files:
intern.h script_v100he.cpp script_v90he.cpp sprite_he.cpp
Log Message:
Fix spriteInfoGet_classFlags*.
Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.359
retrieving revision 2.360
diff -u -d -r2.359 -r2.360
--- intern.h 23 Feb 2005 11:15:41 -0000 2.359
+++ intern.h 23 Feb 2005 12:26:16 -0000 2.360
@@ -877,7 +877,7 @@
int spriteInfoGet_case15(int a, int b, int c, int d, int num, int *args);
int spriteInfoGet_classFlags(int spriteId, int num);
- int spriteInfoGet_classFlags2(int spriteId, int num, int *args);
+ int spriteInfoGet_classFlagsAnd(int spriteId, int num, int *args);
int spriteInfoGet_flags_1(int spriteId);
int spriteInfoGet_flags_2(int spriteId);
int spriteInfoGet_flags_3(int spriteId);
Index: script_v100he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v100he.cpp,v
retrieving revision 2.59
retrieving revision 2.60
diff -u -d -r2.59 -r2.60
--- script_v100he.cpp 23 Feb 2005 11:15:41 -0000 2.59
+++ script_v100he.cpp 23 Feb 2005 12:26:16 -0000 2.60
@@ -2384,7 +2384,7 @@
spriteId = pop();
if (spriteId) {
if (flags)
- push(spriteInfoGet_classFlags2(spriteId, flags, args));
+ push(spriteInfoGet_classFlagsAnd(spriteId, flags, args));
else
push(spriteInfoGet_classFlags(spriteId, -1));
} else {
Index: script_v90he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v90he.cpp,v
retrieving revision 2.152
retrieving revision 2.153
diff -u -d -r2.152 -r2.153
--- script_v90he.cpp 23 Feb 2005 11:15:41 -0000 2.152
+++ script_v90he.cpp 23 Feb 2005 12:26:17 -0000 2.153
@@ -918,7 +918,7 @@
spriteId = pop();
if (spriteId) {
if (flags)
- push(spriteInfoGet_classFlags2(spriteId, flags, args));
+ push(spriteInfoGet_classFlagsAnd(spriteId, flags, args));
else
push(spriteInfoGet_classFlags(spriteId, -1));
} else {
Index: sprite_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sprite_he.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- sprite_he.cpp 23 Feb 2005 12:04:42 -0000 1.35
+++ sprite_he.cpp 23 Feb 2005 12:26:17 -0000 1.36
@@ -51,24 +51,22 @@
return _spriteTable[spriteId].class_flags;
checkRange(32, 1, classId, "class %d out of range in statement");
- return ((_spriteTable[spriteId].class_flags & classId) != 0) ? 1 : 0;
+ return ((_spriteTable[spriteId].class_flags & (1 << classId)) != 0) ? 1 : 0;
}
-int ScummEngine_v90he::spriteInfoGet_classFlags2(int spriteId, int num, int *args) {
- int cls;
- bool b, cond = true;
-
+int ScummEngine_v90he::spriteInfoGet_classFlagsAnd(int spriteId, int num, int *args) {
checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d");
- while (--num >= 0) {
- cls = args[num];
- checkRange(32, 1, cls, "class %d out of range in statement");
- b = ((_spriteTable[spriteId].class_flags & cls) != 0) ? 1 : 0;
- if ((cls & 0x80 && !b) || (!(cls & 0x80) && b))
- cond = 0;
+ if (!num)
+ return 1;
+
+ for (int i = 0; i < num; i++) {
+ checkRange(32, 1, args[i], "class %d out of range in statement");
+ if (!(_spriteTable[spriteId].class_flags & (1 << args[i])))
+ return 0;
}
- return cond;
+ return 1;
}
int ScummEngine_v90he::spriteInfoGet_flags_1(int spriteId) {
More information about the Scummvm-git-logs
mailing list