summaryrefslogtreecommitdiff
path: root/road.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-04-12 05:26:36 +0000
committertron <tron@openttd.org>2006-04-12 05:26:36 +0000
commit85b907c3ef7f3804549eb7f19578722cfea8de8b (patch)
treeb2422353437f4d1f208caf309e6959160a835a59 /road.h
parent5671f5d258722effb08b094cc90664ec8e641cce (diff)
downloadopenttd-85b907c3ef7f3804549eb7f19578722cfea8de8b.tar.xz
(svn r4374) Never directly commit something you prepared the evening before, mysteriously it will break in the morning, fix r4373
Diffstat (limited to 'road.h')
-rw-r--r--road.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/road.h b/road.h
new file mode 100644
index 000000000..1d8d4b862
--- /dev/null
+++ b/road.h
@@ -0,0 +1,26 @@
+/* $Id$ */
+
+#ifndef ROAD_H
+#define ROAD_H
+
+typedef enum RoadBits {
+ ROAD_NW = 1,
+ ROAD_SW = 2,
+ ROAD_SE = 4,
+ ROAD_NE = 8,
+ ROAD_X = ROAD_SW | ROAD_NE,
+ ROAD_Y = ROAD_NW | ROAD_SE,
+ ROAD_ALL = ROAD_X | ROAD_Y
+} RoadBits;
+
+static inline RoadBits ComplementRoadBits(RoadBits r)
+{
+ return ROAD_ALL ^ r;
+}
+
+static inline RoadBits DiagDirToRoadBits(DiagDirection d)
+{
+ return 1 << (3 ^ d);
+}
+
+#endif