summaryrefslogtreecommitdiff
path: root/bridge_map.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-04 16:04:15 +0000
committertron <tron@openttd.org>2006-06-04 16:04:15 +0000
commit3cb526d0d980ff60b5d9158307258acf43c90c32 (patch)
tree7fafd1f3b5f9dd18acaf05ec2212fd5099f44243 /bridge_map.h
parentf1be69c47b33dc5811b3fe27b8635e475c506770 (diff)
downloadopenttd-3cb526d0d980ff60b5d9158307258acf43c90c32.tar.xz
(svn r5101) Add a function to convert an axis and a flag for north/south into a DiagDirection. Use it for bridge ramps and ship depots
Diffstat (limited to 'bridge_map.h')
-rw-r--r--bridge_map.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/bridge_map.h b/bridge_map.h
index 9470204e0..40113471b 100644
--- a/bridge_map.h
+++ b/bridge_map.h
@@ -78,10 +78,7 @@ static inline uint GetBridgeType(TileIndex t)
*/
static inline DiagDirection GetBridgeRampDirection(TileIndex t)
{
- /* Heavy wizardry to convert the X/Y (bit 0) + N/S (bit 5) encoding of
- * bridges to a DiagDirection
- */
- return (DiagDirection)((6 - (_m[t].m5 >> 4 & 2) - (_m[t].m5 & 1)) % 4);
+ return ReverseDiagDir(XYNSToDiagDir((Axis)GB(_m[t].m5, 0, 1), GB(_m[t].m5, 5, 1)));
}