summaryrefslogtreecommitdiff
path: root/src/track_func.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-12-18 20:38:16 +0000
committerrubidium <rubidium@openttd.org>2007-12-18 20:38:16 +0000
commite4ef359f47469b426b8e4a06fe0da867f03e82f3 (patch)
treeef4a6bb4a773d9059b275cbfc7ca5554349c93ca /src/track_func.h
parentdf0c6eb2b9bfcdca6e220586340348ac3e3a00c5 (diff)
downloadopenttd-e4ef359f47469b426b8e4a06fe0da867f03e82f3.tar.xz
(svn r11663) -Codechange: moving of the road related types and functions.
Diffstat (limited to 'src/track_func.h')
-rw-r--r--src/track_func.h20
1 files changed, 20 insertions, 0 deletions
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 */