summaryrefslogtreecommitdiff
path: root/src/newgrf_station.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2012-12-23 15:38:54 +0000
committerpeter1138 <peter1138@openttd.org>2012-12-23 15:38:54 +0000
commitfb58c42aa07679fba72a76e9c01d01de6fb69e3b (patch)
tree11139528802009848d5ef41ee15965a1e499bafe /src/newgrf_station.cpp
parent245e32a10efb0dc924289a8cdec089cd13f3b47d (diff)
downloadopenttd-fb58c42aa07679fba72a76e9c01d01de6fb69e3b.tar.xz
(svn r24840) -Fix: Draw NewGRF railtypes in NewGRF station previews.
Diffstat (limited to 'src/newgrf_station.cpp')
-rw-r--r--src/newgrf_station.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index 8092a953f..91a1fd068 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -843,10 +843,16 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID
SpriteID image = sprites->ground.sprite;
PaletteID pal = sprites->ground.pal;
- image += HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE) ? ground_relocation : total_offset;
- if (HasBit(pal, SPRITE_MODIFIER_CUSTOM_SPRITE)) pal += ground_relocation;
-
- DrawSprite(image, GroundSpritePaletteTransform(image, pal, palette), x, y);
+ RailTrackOffset overlay_offset;
+ if (rti != NULL && rti->UsesOverlay() && SplitGroundSpriteForOverlay(NULL, &image, &overlay_offset)) {
+ SpriteID ground = GetCustomRailSprite(rti, INVALID_TILE, RTSG_GROUND);
+ DrawSprite(image, PAL_NONE, x, y);
+ DrawSprite(ground + overlay_offset, PAL_NONE, x, y);
+ } else {
+ image += HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE) ? ground_relocation : total_offset;
+ if (HasBit(pal, SPRITE_MODIFIER_CUSTOM_SPRITE)) pal += ground_relocation;
+ DrawSprite(image, GroundSpritePaletteTransform(image, pal, palette), x, y);
+ }
DrawRailTileSeqInGUI(x, y, sprites, total_offset, relocation, palette);