Use delay, not value in setSpriteGeneralProperty.

svn-id: r19096
This commit is contained in:
Travis Howell 2005-10-15 10:31:18 +00:00
parent 170521fb9b
commit 6e446ad46f

View File

@ -747,7 +747,7 @@ void Sprite::setSpriteField84(int spriteId, int value) {
void Sprite::setSpriteGeneralProperty(int spriteId, int type, int value) { void Sprite::setSpriteGeneralProperty(int spriteId, int type, int value) {
debug(0, "setSpriteGeneralProperty: spriteId %d type 0x%x", spriteId, type); debug(0, "setSpriteGeneralProperty: spriteId %d type 0x%x", spriteId, type);
checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d");
int delay; int32 delay;
// XXX U32 related check // XXX U32 related check
@ -762,9 +762,9 @@ void Sprite::setSpriteGeneralProperty(int spriteId, int type, int value) {
break; break;
case 0x7E: case 0x7E:
delay = MAX(0, value); 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; break;
default: default:
error("setSpriteGeneralProperty: Invalid value %d", type); error("setSpriteGeneralProperty: Invalid value %d", type);
@ -1134,17 +1134,11 @@ void Sprite::setRedrawFlags(bool checkZOrder) {
if (!(spi->flags & (kSFNeedRedraw | kSF30))) { if (!(spi->flags & (kSFNeedRedraw | kSF30))) {
if ((!checkZOrder || spi->priority >= 0) && (spi->flags & kSFMarkDirty)) { if ((!checkZOrder || spi->priority >= 0) && (spi->flags & kSFMarkDirty)) {
int lp = spi->bbox.left / 8; int lp = spi->bbox.left / 8;
if (lp < 0) { lp = MAX(0, lp);
lp = 0; lp = MIN(lp, 79);
} else if (lp > 79) {
lp = 79;
}
int rp = (spi->bbox.right + 7) / 8; int rp = (spi->bbox.right + 7) / 8;
if (rp < 0) { rp = MAX(0, rp);
rp = 0; rp = MIN(rp, 79);
} else if (rp > 79) {
rp = 79;
}
for (; lp <= rp; ++lp) { for (; lp <= rp; ++lp) {
if (vs->tdirty[lp] < vs->h && spi->bbox.bottom >= vs->tdirty[lp] && spi->bbox.top <= vs->bdirty[lp]) { if (vs->tdirty[lp] < vs->h && spi->bbox.bottom >= vs->tdirty[lp] && spi->bbox.top <= vs->bdirty[lp]) {
spi->flags |= kSFNeedRedraw; spi->flags |= kSFNeedRedraw;