From efc18e8ab380d3cc6d0dc4ceef7bd79895e026a5 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 18 Dec 2007 20:38:16 +0000 Subject: (svn r11663) -Codechange: moving of the road related types and functions. --- src/track_func.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/track_func.h') diff --git a/src/track_func.h b/src/track_func.h index 32a872b61..813f211b1 100644 --- a/src/track_func.h +++ b/src/track_func.h @@ -494,4 +494,24 @@ static inline bool TracksOverlap(TrackBits bits) return bits != TRACK_BIT_HORZ && bits != TRACK_BIT_VERT; } +/** + * Checks whether the trackdir means that we are reversing. + * @param dir the trackdir to check + * @return true if it is a reversing road trackdir + */ +static inline bool IsReversingRoadTrackdir(Trackdir dir) +{ + return (dir & 0x07) >= 6; +} + +/** + * Checks whether the given trackdir is a straight road + * @param dir the trackdir to check + * @return true if it is a straight road trackdir + */ +static inline bool IsStraightRoadTrackdir(Trackdir dir) +{ + return (dir & 0x06) == 0; +} + #endif /* RAIL_H */ -- cgit v1.2.3-54-g00ecf