summaryrefslogtreecommitdiff
path: root/src/road.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-02-14 10:33:36 +0000
committerrubidium <rubidium@openttd.org>2007-02-14 10:33:36 +0000
commita374caf51d9bce8eb26043f10d02db865d1a534e (patch)
treec07923e0460c7e079218104151328efd571ed988 /src/road.h
parent18f88c6ad9b70718c79883ca4c1412d1f32d9d4b (diff)
downloadopenttd-a374caf51d9bce8eb26043f10d02db865d1a534e.tar.xz
(svn r8730) -Codechange: more replacements of magic numbers by enums and removal of some (by now) redundant comments.
Diffstat (limited to 'src/road.h')
-rw-r--r--src/road.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/road.h b/src/road.h
index ef70733ec..c9adfa85a 100644
--- a/src/road.h
+++ b/src/road.h
@@ -28,4 +28,16 @@ static inline RoadBits DiagDirToRoadBits(DiagDirection d)
return (RoadBits)(1U << (3 ^ d));
}
+/** Checks whether the trackdir means that we are reversing */
+static inline bool IsReversingRoadTrackdir(Trackdir dir)
+{
+ return (dir & 0x07) >= 6;
+}
+
+/** Checks whether the given trackdir is a straight road */
+static inline bool IsStraightRoadTrackdir(Trackdir dir)
+{
+ return (dir & 0x06) == 0;
+}
+
#endif /* ROAD_H */