summaryrefslogtreecommitdiff
path: root/bridge_map.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-16 05:28:15 +0000
committertron <tron@openttd.org>2006-03-16 05:28:15 +0000
commit1ac97fe0088096a265660dc5efa4478fe0db4b06 (patch)
treea01ad9ec07f1c762111d146894944d904b92ab3c /bridge_map.h
parent5bf4bbaffec438f45657d279ab71debc84f2d00c (diff)
downloadopenttd-1ac97fe0088096a265660dc5efa4478fe0db4b06.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.h23
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);