diff options
-rw-r--r-- | scumm/intern.h | 3 | ||||
-rw-r--r-- | scumm/script_v100he.cpp | 5 | ||||
-rw-r--r-- | scumm/script_v72he.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 8 | ||||
-rw-r--r-- | scumm/sprite_he.cpp | 21 |
5 files changed, 11 insertions, 28 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index f8d5b881e8..bcb4d02487 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -912,8 +912,7 @@ protected: 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); diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp index ed7d6b81b8..46aa32702c 100644 --- a/scumm/script_v100he.cpp +++ b/scumm/script_v100he.cpp @@ -2537,10 +2537,7 @@ void ScummEngine_v100he::o100_getSpriteInfo() { 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); } diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index ff6a25e96c..7d9f6dc954 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -683,7 +683,7 @@ int ScummEngine_v72he::findObject(int x, int y, int num, int *args) { // 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; } diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index c5e2904b20..02338b1978 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -958,10 +958,7 @@ void ScummEngine_v90he::o90_getSpriteInfo() { 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 @@ void ScummEngine_v90he::o90_findAllObjectsWithClassOf() { 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 @@ void ScummEngine_v90he::o90_findAllObjectsWithClassOf() { if (cond) writeArray(0, 0, j++, _objs[i].obj_nr); } + writeArray(0, 0, 0, j); push(readVar(0)); diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index eaac38abd6..1dc60e1619 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -140,23 +140,12 @@ int ScummEngine_v90he::findSpriteWithClassOf(int x_pos, int y_pos, int spriteGro 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 @@ void ScummEngine_v90he::spriteInfoSet_setClassFlag(int spriteId, int classId, in 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); } } |