diff options
author | peter1138 <peter1138@openttd.org> | 2010-02-08 16:07:46 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2010-02-08 16:07:46 +0000 |
commit | 1bd72e28f0b7806ca96fa12076ebe92254117655 (patch) | |
tree | 97fc22401aef061201db0e3f7b6793e64531ccc7 | |
parent | 0bad75d079acda3124e1a767e097b3f87a8df242 (diff) | |
download | openttd-1bd72e28f0b7806ca96fa12076ebe92254117655.tar.xz |
(svn r19060) -Codechange: Draw custom depot sprites in GUI.
-rw-r--r-- | src/rail_cmd.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 7de13a03a..199adc666 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -2230,8 +2230,9 @@ static void DrawTile_Track(TileInfo *ti) void DrawTrainDepotSprite(int x, int y, int dir, RailType railtype) { const DrawTileSprites *dts = &_depot_gfx_table[dir]; - SpriteID image = dts->ground.sprite; - uint32 offset = GetRailTypeInfo(railtype)->total_offset; + const RailtypeInfo *rti = GetRailTypeInfo(railtype); + SpriteID image = rti->UsesOverlay() ? SPR_FLAT_GRASS_TILE : dts->ground.sprite; + uint32 offset = rti->total_offset; x += 33; y += 17; @@ -2240,6 +2241,20 @@ void DrawTrainDepotSprite(int x, int y, int dir, RailType railtype) PaletteID palette = COMPANY_SPRITE_COLOUR(_local_company); DrawSprite(image, PAL_NONE, x, y); + + if (rti->UsesOverlay()) { + SpriteID ground = GetCustomRailSprite(rti, INVALID_TILE, RTSG_GROUND); + + switch (dir) { + case DIAGDIR_SW: DrawSprite(ground + RTO_X, PAL_NONE, x, y); break; + case DIAGDIR_SE: DrawSprite(ground + RTO_Y, PAL_NONE, x, y); break; + default: break; + } + + offset = GetCustomRailSprite(rti, INVALID_TILE, RTSG_DEPOT); + offset -= SPR_RAIL_DEPOT_SE_1; + } + DrawRailTileSeqInGUI(x, y, dts, offset, 0, palette); } |