summaryrefslogtreecommitdiff
path: root/bridge_map.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-16 10:00:50 +0000
committertron <tron@openttd.org>2006-03-16 10:00:50 +0000
commit1c6915bca395b0dff76b0f89bd959e10a38ee86b (patch)
tree5a5d3df69aa5b59939332cea85c0446e0cd60bf6 /bridge_map.h
parent3a36dba821012dfca98d3ca3c842ec4f83680717 (diff)
downloadopenttd-1c6915bca395b0dff76b0f89bd959e10a38ee86b.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.h21
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