summaryrefslogtreecommitdiff
path: root/src/newgrf_station.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-04-12 22:11:21 +0000
committerpeter1138 <peter1138@openttd.org>2008-04-12 22:11:21 +0000
commita45c1d45e5b56f0e2f18d03abaa4bd675f9ba55f (patch)
tree295dfa2a4a468663505964815b0b08eaa6cc9779 /src/newgrf_station.cpp
parent711909fa0cd3733cbfb7aee9bd32bc445eec1027 (diff)
downloadopenttd-a45c1d45e5b56f0e2f18d03abaa4bd675f9ba55f.tar.xz
(svn r12674) -Fix [FS#1902]: Colour remaps on station sprites only worked for company colours.
Diffstat (limited to 'src/newgrf_station.cpp')
-rw-r--r--src/newgrf_station.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index 96654d90b..39e381a88 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -754,7 +754,7 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID
const RailtypeInfo *rti = GetRailTypeInfo(railtype);
SpriteID relocation;
SpriteID image;
- SpriteID pal = PLAYER_SPRITE_COLOR(_local_player);
+ SpriteID palette = PLAYER_SPRITE_COLOR(_local_player);
uint tile = 2;
statspec = GetCustomStationSpec(sclass, station);
@@ -792,6 +792,17 @@ 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;
+ }
+
if ((byte)seq->delta_z != 0x80) {
pt = RemapCoords(seq->delta_x, seq->delta_y, seq->delta_z);
DrawSprite(image, pal, x + pt.x, y + pt.y);