diff options
author | Travis Howell | 2005-03-28 11:38:04 +0000 |
---|---|---|
committer | Travis Howell | 2005-03-28 11:38:04 +0000 |
commit | 22affb0382ead2fed3bf44111320aa85d4d510f3 (patch) | |
tree | cf33d1ccb16b1cf13d5a5a7eb4eebb50e827b9d6 /scumm/sprite_he.cpp | |
parent | 2f2ca8ac21b778736742857b8a45741f9db47665 (diff) | |
download | scummvm-rg350-22affb0382ead2fed3bf44111320aa85d4d510f3.tar.gz scummvm-rg350-22affb0382ead2fed3bf44111320aa85d4d510f3.tar.bz2 scummvm-rg350-22affb0382ead2fed3bf44111320aa85d4d510f3.zip |
Check class of object number, not loop.
Cleanup.
svn-id: r17272
Diffstat (limited to 'scumm/sprite_he.cpp')
-rw-r--r-- | scumm/sprite_he.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
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); } } |