summaryrefslogtreecommitdiff
path: root/src/newgrf_station.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_station.cpp')
-rw-r--r--src/newgrf_station.cpp14
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);