diff options
author | tron <tron@openttd.org> | 2006-03-16 05:28:15 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-16 05:28:15 +0000 |
commit | ec33376fa3355a840cd6ddb31687382e5251b1fa (patch) | |
tree | a01ad9ec07f1c762111d146894944d904b92ab3c /bridge_map.h | |
parent | ca1efd3189eee42e0dd5758827c81c35fe44a10b (diff) | |
download | openttd-ec33376fa3355a840cd6ddb31687382e5251b1fa.tar.xz |
(svn r3898) Add functions to find a bridge end starting at a middle tile
Diffstat (limited to 'bridge_map.h')
-rw-r--r-- | bridge_map.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bridge_map.h b/bridge_map.h index 7214425c6..4f4b33d53 100644 --- a/bridge_map.h +++ b/bridge_map.h @@ -15,6 +15,12 @@ static inline bool IsBridgeRamp(TileIndex t) return !HASBIT(_m[t].m5, 6); } +static inline bool IsBridgeMiddle(TileIndex t) +{ + return HASBIT(_m[t].m5, 6); +} + + /** * Get the direction pointing onto the bridge @@ -28,6 +34,12 @@ static inline DiagDirection GetBridgeRampDirection(TileIndex t) } +static inline Axis GetBridgeAxis(TileIndex t) +{ + return (Axis)GB(_m[t].m5, 0, 1); +} + + static inline bool IsClearUnderBridge(TileIndex t) { return GB(_m[t].m5, 3, 3) == 0; @@ -46,6 +58,17 @@ static inline TransportType GetTransportTypeUnderBridge(TileIndex t) /** + * Finds the end of a bridge in the specified direction starting at a middle tile + */ +TileIndex GetBridgeEnd(TileIndex, DiagDirection); + +/** + * Finds the southern end of a bridge starting at a middle tile + */ +TileIndex GetSouthernBridgeEnd(TileIndex t); + + +/** * Starting at one bridge end finds the other bridge end */ TileIndex GetOtherBridgeEnd(TileIndex); |