(svn r14606) -Codechange: Unify usage of PALETTE_MODIFIER_TRANSPARENT and PALETTE_MODIFIER_COLOR in spritelayout drawing.

-Fix [FS#2419]: The modifiers were not applied in all cases.
This commit is contained in:
frosch
2008-11-22 16:04:11 +00:00
parent 795569298f
commit a64298ebb9
6 changed files with 73 additions and 57 deletions

View File

@@ -183,7 +183,7 @@ static void IndustryDrawTileLayout(const TileInfo *ti, const SpriteGroup *group,
if (image == SPR_FLAT_WATER_TILE && IsIndustryTileOnWater(ti->tile)) {
DrawWaterClassGround(ti);
} else {
DrawGroundSprite(image, pal);
DrawGroundSprite(image, GroundSpritePaletteTransform(image, pal, GENERAL_SPRITE_COLOR(rnd_color)));
}
}
@@ -198,13 +198,7 @@ static void IndustryDrawTileLayout(const TileInfo *ti, const SpriteGroup *group,
if (IS_CUSTOM_SPRITE(image)) image += stage;
if (HasBit(image, PALETTE_MODIFIER_TRANSPARENT) || HasBit(image, PALETTE_MODIFIER_COLOR)) {
if (pal == 0) {
pal = GENERAL_SPRITE_COLOR(rnd_color);
}
} else {
pal = PAL_NONE;
}
pal = SpriteLayoutPaletteTransform(image, pal, GENERAL_SPRITE_COLOR(rnd_color));
if ((byte)dtss->delta_z != 0x80) {
AddSortableSpriteToDraw(