# HG changeset patch # User peter1138 # Date 1208038281 0 # Node ID 325b028994e9f958edc2b6fb0e15a2fdc3669865 # Parent 609b1121b3b3754a4a1f799939ffde18ad2044e6 (svn r12674) -Fix [FS#1902]: Colour remaps on station sprites only worked for company colours. diff -r 609b1121b3b3 -r 325b028994e9 src/newgrf_station.cpp --- a/src/newgrf_station.cpp Sat Apr 12 20:32:18 2008 +0000 +++ b/src/newgrf_station.cpp Sat Apr 12 22:11:21 2008 +0000 @@ -754,7 +754,7 @@ 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 @@ 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); diff -r 609b1121b3b3 -r 325b028994e9 src/station_cmd.cpp --- a/src/station_cmd.cpp Sat Apr 12 20:32:18 2008 +0000 +++ b/src/station_cmd.cpp Sat Apr 12 22:11:21 2008 +0000 @@ -2199,10 +2199,14 @@ } SpriteID pal; - if (!(!HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_BUILDINGS)) && HasBit(image, PALETTE_MODIFIER_COLOR)) { - pal = palette; + 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 = dtss->image.pal; + pal = PAL_NONE; } if ((byte)dtss->delta_z != 0x80) {