diff options
Diffstat (limited to 'src/bridge_map.cpp')
-rw-r--r-- | src/bridge_map.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/bridge_map.cpp b/src/bridge_map.cpp index 9fb4cf413..c89af44d5 100644 --- a/src/bridge_map.cpp +++ b/src/bridge_map.cpp @@ -32,24 +32,41 @@ static TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir) } +/** + * Finds the northern end of a bridge starting at a middle tile + * @param t the bridge tile to find the bridge ramp for + */ TileIndex GetNorthernBridgeEnd(TileIndex t) { return GetBridgeEnd(t, ReverseDiagDir(AxisToDiagDir(GetBridgeAxis(t)))); } +/** + * Finds the southern end of a bridge starting at a middle tile + * @param t the bridge tile to find the bridge ramp for + */ TileIndex GetSouthernBridgeEnd(TileIndex t) { return GetBridgeEnd(t, AxisToDiagDir(GetBridgeAxis(t))); } +/** + * Starting at one bridge end finds the other bridge end + * @param t the bridge ramp tile to find the other bridge ramp for + */ TileIndex GetOtherBridgeEnd(TileIndex tile) { assert(IsBridgeTile(tile)); return GetBridgeEnd(tile, GetTunnelBridgeDirection(tile)); } +/** + * Get the height ('z') of a bridge in pixels. + * @param tile the bridge ramp tile to get the bridge height from + * @return the height of the bridge in pixels + */ uint GetBridgeHeight(TileIndex t) { uint h; |