summaryrefslogtreecommitdiff
path: root/bridge_map.h
diff options
context:
space:
mode:
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);