1
0
Fork 0

(svn r22721) -Fix (r22518): Conditionally hiding a sprite caused subsequent items of the spritelayout to use wrong registers.

release/1.2
frosch 2011-08-06 10:47:37 +00:00
parent 03c1fd5c63
commit 2e466cc184
1 changed files with 14 additions and 14 deletions

View File

@ -647,8 +647,7 @@ void NewGRFSpriteLayout::ProcessRegisters(uint8 resolved_var10, uint32 resolved_
/* Apply registers */ /* Apply registers */
if ((flags & TLF_DODRAW) && GetRegister(regs->dodraw) == 0) { if ((flags & TLF_DODRAW) && GetRegister(regs->dodraw) == 0) {
result->image.sprite = 0; result->image.sprite = 0;
continue; } else {
}
if (HasBit(result->image.sprite, SPRITE_MODIFIER_CUSTOM_SPRITE)) result->image.sprite += resolved_sprite; if (HasBit(result->image.sprite, SPRITE_MODIFIER_CUSTOM_SPRITE)) result->image.sprite += resolved_sprite;
if (flags & TLF_SPRITE) result->image.sprite += (int16)GetRegister(regs->sprite); // mask to 16 bits to avoid trouble if (flags & TLF_SPRITE) result->image.sprite += (int16)GetRegister(regs->sprite); // mask to 16 bits to avoid trouble
@ -664,9 +663,10 @@ void NewGRFSpriteLayout::ProcessRegisters(uint8 resolved_var10, uint32 resolved_
} }
} }
} }
}
/* Is the palette affected by an action-1-2-3 chain? */ /* Is the palette affected by an action-1-2-3 chain? */
if (HasBit(result->image.pal, SPRITE_MODIFIER_CUSTOM_SPRITE) || (flags & TLF_PALETTE_REG_FLAGS)) { if (result->image.sprite != 0 && (HasBit(result->image.pal, SPRITE_MODIFIER_CUSTOM_SPRITE) || (flags & TLF_PALETTE_REG_FLAGS))) {
/* Does the var10 value apply to this sprite? */ /* Does the var10 value apply to this sprite? */
uint8 var10 = (flags & TLF_PALETTE_VAR10) ? regs->palette_var10 : (ground && separate_ground ? 1 : 0); uint8 var10 = (flags & TLF_PALETTE_VAR10) ? regs->palette_var10 : (ground && separate_ground ? 1 : 0);
if (var10 == resolved_var10) { if (var10 == resolved_var10) {