summaryrefslogtreecommitdiff
path: root/tunnelbridge_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-14 12:00:11 +0000
committertron <tron@openttd.org>2006-03-14 12:00:11 +0000
commit42d1731cc1a795f7067c1fd92e337a41480d5589 (patch)
treee2311e3c6295b3d9db10baea067278eaaa657869 /tunnelbridge_cmd.c
parentb2412f7472335fdaee34b355643f0ab77ae381bd (diff)
downloadopenttd-42d1731cc1a795f7067c1fd92e337a41480d5589.tar.xz
(svn r3857) Add and use GetBridgeRampDirection()
Note: This slightly changes the behavior of GetAnyRoadBits() to only return a road piece for the start of the bridge ramp instead of a full ROAD_[XY]
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r--tunnelbridge_cmd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index c04da682f..795c59477 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -1019,10 +1019,9 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
if (f) DrawFoundation(ti, f);
}
- /* Cope for the direction of the bridge */
- if (HASBIT(ti->map5, 0)) base_offset++;
+ // HACK Wizardry to convert the bridge ramp direction into a sprite offset
+ base_offset += (6 - GetBridgeRampDirection(ti->tile)) % 4;
- if (ti->map5 & 0x20) base_offset += 2; // which side
if (ti->tileh == 0) base_offset += 4; // sloped bridge head
/* Table number 6 always refers to the bridge heads for any bridge type */