summaryrefslogtreecommitdiff
path: root/road_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 /road_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 'road_cmd.c')
-rw-r--r--road_cmd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/road_cmd.c b/road_cmd.c
index eea3d00b4..6064e2204 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -850,10 +850,9 @@ static void DrawTile_Road(TileInfo *ti)
int f = GetRoadFoundation(ti->tileh, ti->map5 & 0xF);
if (f) DrawFoundation(ti, f);
- image = 0x55B;
+ image = GetRailTypeInfo(GB(_m[ti->tile].m4, 0, 4))->base_sprites.crossing;
- if ( (ti->map5 & 8) != 0)
- image--;
+ if (GB(ti->map5, 3, 1) == 0) image++; /* direction */
if ( (ti->map5 & 4) != 0)
image += 2;
@@ -866,7 +865,7 @@ static void DrawTile_Road(TileInfo *ti)
if (m2 > 1) image += 4;
}
- DrawGroundSprite(image + GB(_m[ti->tile].m4, 0, 4) * 12);
+ DrawGroundSprite(image);
if (_debug_pbs_level >= 1) {
byte pbs = PBSTileReserved(ti->tile);