diff options
author | Travis Howell | 2005-10-15 10:31:18 +0000 |
---|---|---|
committer | Travis Howell | 2005-10-15 10:31:18 +0000 |
commit | 6e446ad46f1608bf8918e3e4f0184eb931d5aefe (patch) | |
tree | 9d15ec242c12eaf8c07e5b4648fd1f90ba0b7fcb | |
parent | 170521fb9b32a3bf06787fea01c48b6750e6498e (diff) | |
download | scummvm-rg350-6e446ad46f1608bf8918e3e4f0184eb931d5aefe.tar.gz scummvm-rg350-6e446ad46f1608bf8918e3e4f0184eb931d5aefe.tar.bz2 scummvm-rg350-6e446ad46f1608bf8918e3e4f0184eb931d5aefe.zip |
Use delay, not value in setSpriteGeneralProperty.
svn-id: r19096
-rw-r--r-- | scumm/sprite_he.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index 8fe6df1aff..081d77191f 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -747,7 +747,7 @@ void Sprite::setSpriteField84(int spriteId, int value) { void Sprite::setSpriteGeneralProperty(int spriteId, int type, int value) { debug(0, "setSpriteGeneralProperty: spriteId %d type 0x%x", spriteId, type); checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - int delay; + int32 delay; // XXX U32 related check @@ -762,9 +762,9 @@ void Sprite::setSpriteGeneralProperty(int spriteId, int type, int value) { break; case 0x7E: delay = MAX(0, value); - delay = MIN((int32)value, _spriteTable[spriteId].animSpeed); + delay = MIN(delay, _spriteTable[spriteId].animSpeed); - _spriteTable[spriteId].animProgress = value; + _spriteTable[spriteId].animProgress = delay; break; default: error("setSpriteGeneralProperty: Invalid value %d", type); @@ -1134,17 +1134,11 @@ void Sprite::setRedrawFlags(bool checkZOrder) { if (!(spi->flags & (kSFNeedRedraw | kSF30))) { if ((!checkZOrder || spi->priority >= 0) && (spi->flags & kSFMarkDirty)) { int lp = spi->bbox.left / 8; - if (lp < 0) { - lp = 0; - } else if (lp > 79) { - lp = 79; - } + lp = MAX(0, lp); + lp = MIN(lp, 79); int rp = (spi->bbox.right + 7) / 8; - if (rp < 0) { - rp = 0; - } else if (rp > 79) { - rp = 79; - } + rp = MAX(0, rp); + rp = MIN(rp, 79); for (; lp <= rp; ++lp) { if (vs->tdirty[lp] < vs->h && spi->bbox.bottom >= vs->tdirty[lp] && spi->bbox.top <= vs->bdirty[lp]) { spi->flags |= kSFNeedRedraw; |