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/station_cmd.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/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 13b0bd8a2..b5a33136d 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -24,6 +24,7 @@ #include "industry_map.h" #include "newgrf_callbacks.h" #include "newgrf_station.h" +#include "newgrf_commons.h" #include "yapf/yapf.h" #include "road_type.h" #include "road_internal.h" /* For drawing catenary/checking road removal */ @@ -2325,13 +2326,14 @@ static void DrawTile_Station(TileInfo *ti) } } else { SpriteID image = t->ground.sprite; + SpriteID pal = t->ground.pal; if (HasBit(image, SPRITE_MODIFIER_USE_OFFSET)) { image += GetCustomStationGroundRelocation(statspec, st, ti->tile); image += custom_ground_offset; } else { image += total_offset; } - DrawGroundSprite(image, HasBit(image, PALETTE_MODIFIER_COLOR) ? palette : PAL_NONE); + DrawGroundSprite(image, GroundSpritePaletteTransform(image, pal, palette)); /* PBS debugging, draw reserved tracks darker */ if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && IsRailwayStation(ti->tile) && GetRailwayStationReservation(ti->tile)) { @@ -2361,16 +2363,7 @@ static void DrawTile_Station(TileInfo *ti) image += relocation; } - SpriteID pal; - if (HasBit(image, PALETTE_MODIFIER_TRANSPARENT) || HasBit(image, PALETTE_MODIFIER_COLOR)) { - if (dtss->image.pal > 0) { - pal = dtss->image.pal; - } else { - pal = palette; - } - } else { - pal = PAL_NONE; - } + SpriteID pal = SpriteLayoutPaletteTransform(image, dtss->image.pal, palette); if ((byte)dtss->delta_z != 0x80) { AddSortableSpriteToDraw( |