diff options
author | rubidium <rubidium@openttd.org> | 2007-10-09 21:11:23 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-10-09 21:11:23 +0000 |
commit | 6cebf4aa53a4eafb79b8ea9969aafda44d4fb0cd (patch) | |
tree | d69b1fe2ef975540df49a98c7d877a8a4287a30b /src/rail.h | |
parent | a71b7226c58d9a71d017721ffc6fdd875bbfe68e (diff) | |
download | openttd-6cebf4aa53a4eafb79b8ea9969aafda44d4fb0cd.tar.xz |
(svn r11237) -Codechange: reduce code duplication between GetRailFoundation() and CheckRailSlope(). Patch by frosch.
Diffstat (limited to 'src/rail.h')
-rw-r--r-- | src/rail.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rail.h b/src/rail.h index 94ab46853..c0912d807 100644 --- a/src/rail.h +++ b/src/rail.h @@ -120,6 +120,19 @@ static inline TrackBits AxisToTrackBits(Axis a) return TrackToTrackBits(AxisToTrack(a)); } +/** + * Returns a single horizontal/vertical trackbit, that is in a specific tile corner. + * + * @param corner The corner of a tile. + * @return The TrackBits of the track in the corner. + */ +static inline TrackBits CornerToTrackBits(Corner corner) +{ + extern const TrackBits _corner_to_trackbits[]; + assert(IsValidCorner(corner)); + return _corner_to_trackbits[corner]; +} + /** * Enumeration for tracks and directions. |