diff options
author | smatz <smatz@openttd.org> | 2008-05-14 18:31:21 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-05-14 18:31:21 +0000 |
commit | 2be223fc03a8f4812d9ae38b1084572b903710a3 (patch) | |
tree | 865f25008dfeacaa3e7b65aadc36c6076eb1c4b0 /src/rail_map.h | |
parent | c90cda6c1c806d4f657faa07b29a85e4e44f8d4b (diff) | |
download | openttd-2be223fc03a8f4812d9ae38b1084572b903710a3.tar.xz |
(svn r13090) -Codechange: add functions for direct conversion from DiagDirection to Track and Trackbits
Diffstat (limited to 'src/rail_map.h')
-rw-r--r-- | src/rail_map.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rail_map.h b/src/rail_map.h index 2789b419a..8c436d055 100644 --- a/src/rail_map.h +++ b/src/rail_map.h @@ -168,6 +168,17 @@ static inline DiagDirection GetRailDepotDirection(TileIndex t) return (DiagDirection)GB(_m[t].m5, 0, 2); } +/** + * Returns the track of a depot, ignoring direction + * @pre IsRailDepotTile(t) + * @param t the tile to get the depot track from + * @return the track of the depot + */ +static inline Track GetRailDepotTrack(TileIndex t) +{ + return DiagDirToDiagTrack(GetRailDepotDirection(t)); +} + /** * Returns the axis of the waypoint |