summaryrefslogtreecommitdiff
path: root/src/newgrf_industrytiles.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-11-22 16:04:11 +0000
committerfrosch <frosch@openttd.org>2008-11-22 16:04:11 +0000
commit259a073f0c16dccdace6dced05d955e15de080d9 (patch)
tree3eae77104f99b355105a041898cd4174c1d8031f /src/newgrf_industrytiles.cpp
parentf0286cb1e57a53b5be8565a325fdd7383cf6fc6f (diff)
downloadopenttd-259a073f0c16dccdace6dced05d955e15de080d9.tar.xz
(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.
Diffstat (limited to 'src/newgrf_industrytiles.cpp')
-rw-r--r--src/newgrf_industrytiles.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index bab9977f7..97706038c 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -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(