diff options
author | frosch <frosch@openttd.org> | 2008-11-22 16:04:11 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-11-22 16:04:11 +0000 |
commit | 259a073f0c16dccdace6dced05d955e15de080d9 (patch) | |
tree | 3eae77104f99b355105a041898cd4174c1d8031f /src/newgrf_station.cpp | |
parent | f0286cb1e57a53b5be8565a325fdd7383cf6fc6f (diff) | |
download | openttd-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_station.cpp')
-rw-r--r-- | src/newgrf_station.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index 3438a87ca..3556e2185 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -803,6 +803,7 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID } image = sprites->ground.sprite; + SpriteID pal = sprites->ground.pal; if (HasBit(image, SPRITE_MODIFIER_USE_OFFSET)) { image += GetCustomStationGroundRelocation(statspec, NULL, INVALID_TILE); image += rti->custom_ground_offset; @@ -810,7 +811,7 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID image += rti->total_offset; } - DrawSprite(image, PAL_NONE, x, y); + DrawSprite(image, GroundSpritePaletteTransform(image, pal, palette), x, y); Point child_offset = {0, 0}; @@ -822,16 +823,7 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID image += relocation; } - SpriteID pal; - if (HasBit(image, PALETTE_MODIFIER_TRANSPARENT) || HasBit(image, PALETTE_MODIFIER_COLOR)) { - if (seq->image.pal > 0) { - pal = seq->image.pal; - } else { - pal = palette; - } - } else { - pal = PAL_NONE; - } + pal = SpriteLayoutPaletteTransform(image, seq->image.pal, palette); if ((byte)seq->delta_z != 0x80) { Point pt = RemapCoords(seq->delta_x, seq->delta_y, seq->delta_z); |