diff options
author | Travis Howell | 2005-03-29 09:24:41 +0000 |
---|---|---|
committer | Travis Howell | 2005-03-29 09:24:41 +0000 |
commit | 7c4b5b2a58659734e16fce30211e5c0c48fdfc57 (patch) | |
tree | 1ecfc03de89aa5490a3c95713e51d8afdf409076 /scumm | |
parent | 56a2f204a53e650cbe422ed84b2416c47d7595c2 (diff) | |
download | scummvm-rg350-7c4b5b2a58659734e16fce30211e5c0c48fdfc57.tar.gz scummvm-rg350-7c4b5b2a58659734e16fce30211e5c0c48fdfc57.tar.bz2 scummvm-rg350-7c4b5b2a58659734e16fce30211e5c0c48fdfc57.zip |
Should continue the main loop, not inner loop.
Fixes using sprites in circdemo
svn-id: r17282
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/sprite_he.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index 1dc60e1619..b0514b54df 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -38,9 +38,10 @@ void ScummEngine_v90he::allocateArrays() { // // spriteInfoGet functions // -int ScummEngine_v90he::findSpriteWithClassOf(int x_pos, int y_pos, int spriteGroupId, int d, int num, int *args) { +int ScummEngine_v90he::findSpriteWithClassOf(int x_pos, int y_pos, int spriteGroupId, int type, int num, int *args) { + bool cond; int code, classId, x, y; - debug(1, "findSprite: x %d, y %d, spriteGroup %d, d %d, num %d", x_pos, y_pos, spriteGroupId, d, num); + debug(1, "findSprite: x %d, y %d, spriteGroup %d, type %d, num %d", x_pos, y_pos, spriteGroupId, type, num); for (int i = (_numSpritesToProcess - 1); i >= 0; i--) { SpriteInfo *spi = _activeSpritesTable[i]; @@ -50,20 +51,23 @@ int ScummEngine_v90he::findSpriteWithClassOf(int x_pos, int y_pos, int spriteGro if (spriteGroupId && spi->group_num != spriteGroupId) continue; + cond = true; for (int j = 0; j < num; j++) { code = classId = args[j]; classId &= 0x7F; checkRange(32, 1, classId, "class %d out of range in statement"); if (code & 0x80) { - if (!(spi->class_flags & (1 << classId))) - continue; + if (!(spi->class_flags & (1 << (classId - 1)))) + cond = 0; } else { - if ((spi->class_flags & (1 << classId))) - continue; + if ((spi->class_flags & (1 << (classId - 1)))) + cond = 0; } } + if (!cond) + continue; - if (d) { + if (type) { if (spi->bbox.left > spi->bbox.right) continue; if (spi->bbox.top > spi->bbox.bottom) @@ -152,10 +156,10 @@ int ScummEngine_v90he::spriteInfoGet_classFlags(int spriteId, int num, int *args classId &= 0x7F; checkRange(32, 1, classId, "class %d out of range in statement"); if (code & 0x80) { - if (!(_spriteTable[spriteId].class_flags & (1 << classId))) + if (!(_spriteTable[spriteId].class_flags & (1 << (classId - 1)))) return 0; } else { - if ((_spriteTable[spriteId].class_flags & (1 << classId))) + if ((_spriteTable[spriteId].class_flags & (1 << (classId - 1)))) return 0; } } @@ -636,9 +640,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 - 1)); } else { - _spriteTable[spriteId].class_flags &= ~(1 << classId); + _spriteTable[spriteId].class_flags &= ~(1 << (classId - 1)); } } |