diff options
author | frosch <frosch@openttd.org> | 2011-08-28 20:33:40 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-08-28 20:33:40 +0000 |
commit | 36dd5cd68573219bb95ccc6a73aeae048d0756e2 (patch) | |
tree | d3213cb8531cbee3a3a5062e2a7ffbed9b035685 | |
parent | 286b2aeee574f2052adc9752a2e7d103d99d220f (diff) | |
download | openttd-36dd5cd68573219bb95ccc6a73aeae048d0756e2.tar.xz |
(svn r22854) -Change: [NewGRF] Allow replacing depot sprites without having to provide rail overlays. (Hirundo)
-rw-r--r-- | src/rail_cmd.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index cc5162d57..95ff6440f 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -2284,9 +2284,6 @@ static void DrawTile_Track(TileInfo *ti) default: break; } } - - int depot_sprite = GetCustomRailSprite(rti, ti->tile, RTSG_DEPOT); - relocation = depot_sprite != 0 ? depot_sprite - SPR_RAIL_DEPOT_SE_1 : rti->GetRailtypeSpriteOffset(); } else { /* PBS debugging, draw reserved tracks darker */ if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasDepotReservation(ti->tile)) { @@ -2298,9 +2295,9 @@ static void DrawTile_Track(TileInfo *ti) default: break; } } - - relocation = rti->GetRailtypeSpriteOffset(); } + int depot_sprite = GetCustomRailSprite(rti, ti->tile, RTSG_DEPOT); + relocation = depot_sprite != 0 ? depot_sprite - SPR_RAIL_DEPOT_SE_1 : rti->GetRailtypeSpriteOffset(); if (HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti); @@ -2332,10 +2329,9 @@ void DrawTrainDepotSprite(int x, int y, int dir, RailType railtype) case DIAGDIR_SE: DrawSprite(ground + RTO_Y, PAL_NONE, x, y); break; default: break; } - - int depot_sprite = GetCustomRailSprite(rti, INVALID_TILE, RTSG_DEPOT); - if (depot_sprite != 0) offset = depot_sprite - SPR_RAIL_DEPOT_SE_1; } + int depot_sprite = GetCustomRailSprite(rti, INVALID_TILE, RTSG_DEPOT); + if (depot_sprite != 0) offset = depot_sprite - SPR_RAIL_DEPOT_SE_1; DrawRailTileSeqInGUI(x, y, dts, offset, 0, palette); } |