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 /road_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 'road_cmd.c')
-rw-r--r-- | road_cmd.c | 7 |
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); |