summaryrefslogtreecommitdiff
path: root/tunnelbridge_cmd.c
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2005-07-31 22:53:57 +0000
committercelestar <celestar@openttd.org>2005-07-31 22:53:57 +0000
commitfcf5ace08fa0cdbb3c5a7d8f9457dcdb61741481 (patch)
treec9a9a1e3f27f68a40f4993b7913fab6b2142b6f2 /tunnelbridge_cmd.c
parent132ce0a598eecf344c1489063fada0a824be89ad (diff)
downloadopenttd-fcf5ace08fa0cdbb3c5a7d8f9457dcdb61741481.tar.xz
(svn r2774) -Codechange: Removed TRACKTYPE_SPRITE_PITCH globally and replaced it by a member of RailtypeInfo
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r--tunnelbridge_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index 317a91132..5fc6b2d7c 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -1022,7 +1022,6 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
/* railway type */
image = GB(_m[ti->tile].m3, 0, 4) * 8;
- /* ice? */
if (ice)
image += 32;
@@ -1085,7 +1084,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
if (!(ti->map5 & 0x20)) {
// draw land under bridge
- if (ice) image += 2; // ice too?
+ if (ice) image += 2;
if (image != 1 || ti->tileh == 0)
DrawGroundSprite(_bridge_land_below[image] + _tileh_to_sprite[ti->tileh]);
@@ -1104,11 +1103,12 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
}
if (!(image&1)) {
+ const RailtypeInfo *rti = GetRailTypeInfo(_m[ti->tile].m3 & 0xF);
// railway
image = 0x3F3 + (ti->map5 & 1);
if (ti->tileh != 0) image = _track_sloped_sprites[ti->tileh - 1] + 0x3F3;
- image += (_m[ti->tile].m3 & 0xF) * TRACKTYPE_SPRITE_PITCH;
- if (ice) image += 26; // ice?
+ image += rti->total_offset;
+ if (ice) image += rti->snow_offset;
} else {
// road
image = 1332 + (ti->map5 & 1);