summaryrefslogtreecommitdiff
path: root/tunnelbridge_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-10-13 16:00:14 +0000
committertron <tron@openttd.org>2005-10-13 16:00:14 +0000
commit7520ef8f3325bcaec2496e52e0d351767193da28 (patch)
treeee9f710faeaacffe616dd886460d095de751bb0d /tunnelbridge_cmd.c
parentd37639ac3eab8c7d8deb37ff9b7784f57aa580d4 (diff)
downloadopenttd-7520ef8f3325bcaec2496e52e0d351767193da28.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.c12
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);