diff options
author | tron <tron@openttd.org> | 2006-03-16 10:00:50 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-16 10:00:50 +0000 |
commit | 483c8f701829006673a5477a8d1073f29a92f6f9 (patch) | |
tree | 5a5d3df69aa5b59939332cea85c0446e0cd60bf6 /bridge_map.h | |
parent | a3c45635a77473016a1145e4a586b7a2a5527cda (diff) | |
download | openttd-483c8f701829006673a5477a8d1073f29a92f6f9.tar.xz |
(svn r3904) Move GetBridgePiece() and GetBridgeType() to bridge_map.h and make the only place which still extracted that info diretly use the wrapper
Diffstat (limited to 'bridge_map.h')
-rw-r--r-- | bridge_map.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bridge_map.h b/bridge_map.h index 610728060..bbb443615 100644 --- a/bridge_map.h +++ b/bridge_map.h @@ -21,6 +21,27 @@ static inline bool IsBridgeMiddle(TileIndex t) } +/** + * Determines which piece of a bridge is contained in the current tile + * @param tile The tile to analyze + * @return the piece + */ +static inline uint GetBridgePiece(TileIndex tile) +{ + return GB(_m[tile].m2, 0, 4); +} + + +/** + * Determines the type of bridge on a tile + * @param tile The tile to analyze + * @return The bridge type + */ +static inline uint GetBridgeType(TileIndex tile) +{ + return GB(_m[tile].m2, 4, 4); +} + /** * Get the direction pointing onto the bridge |