summaryrefslogtreecommitdiff
path: root/bridge_map.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-13 12:55:20 +0000
committertron <tron@openttd.org>2006-03-13 12:55:20 +0000
commit26815f74051f7f6e6053b63ccf4f08cbadfa7847 (patch)
treebaf83f0489b844b1906cfa75044bb1f224a71618 /bridge_map.h
parent3e932a0a4fbe5f38b4d946fc6e58aef896fd118f (diff)
downloadopenttd-26815f74051f7f6e6053b63ccf4f08cbadfa7847.tar.xz
(svn r3846) Add functions to set the type of stuff (clear, water, rail, road) under bridges
Diffstat (limited to 'bridge_map.h')
-rw-r--r--bridge_map.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/bridge_map.h b/bridge_map.h
new file mode 100644
index 000000000..ba8e71d50
--- /dev/null
+++ b/bridge_map.h
@@ -0,0 +1,37 @@
+/* $Id$ */
+
+#ifndef BRIDGE_MAP_H
+#define BRIDGE_MAP_H
+
+#include "macros.h"
+#include "map.h"
+#include "rail.h"
+#include "tile.h"
+
+
+static inline void SetClearUnderBridge(TileIndex t)
+{
+ SetTileOwner(t, OWNER_NONE);
+ SB(_m[t].m5, 3, 3, 0 << 2 | 0);
+}
+
+static inline void SetWaterUnderBridge(TileIndex t)
+{
+ SetTileOwner(t, OWNER_WATER);
+ SB(_m[t].m5, 3, 3, 0 << 2 | 1);
+}
+
+static inline void SetRailUnderBridge(TileIndex t, Owner o, RailType r)
+{
+ SetTileOwner(t, o);
+ SB(_m[t].m5, 3, 3, 1 << 2 | TRANSPORT_RAIL);
+ SB(_m[t].m3, 0, 4, r);
+}
+
+static inline void SetRoadUnderBridge(TileIndex t, Owner o)
+{
+ SetTileOwner(t, o);
+ SB(_m[t].m5, 3, 3, 1 << 2 | TRANSPORT_ROAD);
+}
+
+#endif