diff options
author | rubidium <rubidium@openttd.org> | 2011-01-18 22:17:15 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-01-18 22:17:15 +0000 |
commit | 6c9078fd30097b38537a60fbecb9828da69c3517 (patch) | |
tree | 6601ea8e21edd22b54d054d94cd9c129f8162458 /src/bridge_map.cpp | |
parent | d89095b3ecb9c326e169db33294efac9b818276a (diff) | |
download | openttd-6c9078fd30097b38537a60fbecb9828da69c3517.tar.xz |
(svn r21844) -Codechange: move documentation towards the code to make it more likely to be updates [a-c].
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; |