diff options
author | tron <tron@openttd.org> | 2005-10-13 16:00:14 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-10-13 16:00:14 +0000 |
commit | 4529d1fc8ea69c9809f9679323346b4da8a32fe2 (patch) | |
tree | ee9f710faeaacffe616dd886460d095de751bb0d /tunnelbridge_cmd.c | |
parent | 93f003919f2c99a74b529eefd56fa13dfea5c975 (diff) | |
download | openttd-4529d1fc8ea69c9809f9679323346b4da8a32fe2.tar.xz |
(svn r3037) Don't deduce the sprites for tunnels and level crossings from magic numbers, but fetch them from the central rail info array. This is a preparation step for electrified rails
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r-- | tunnelbridge_cmd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index d51ffe6f3..c16329669 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -24,7 +24,6 @@ #include "bridge.h" #include "table/bridge_land.h" -#include "table/tunnel_land.h" extern const byte _track_sloped_sprites[14]; extern const SpriteID _water_shore_sprites[15]; @@ -1040,13 +1039,14 @@ static void DrawTile_TunnelBridge(TileInfo *ti) // draw tunnel? if ((ti->map5 & 0xF0) == 0) { - /* railway type */ - image = GB(_m[ti->tile].m3, 0, 4) * 8; + if (GB(ti->map5, 2, 2) == 0) { /* Rail tunnel? */ + image = GetRailTypeInfo(GB(_m[ti->tile].m3, 0, 4))->base_sprites.tunnel; + } else { + image = SPR_TUNNEL_ENTRY_REAR_ROAD; + } - if (ice) - image += 32; + if (ice) image += 32; - image += _draw_tunnel_table_1[GB(ti->map5, 2, 2)]; image += GB(ti->map5, 0, 2) * 2; DrawGroundSprite(image); |