summaryrefslogtreecommitdiff
path: root/tile.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-29 13:33:48 +0000
committertron <tron@openttd.org>2005-01-29 13:33:48 +0000
commite86e9f96ca34114d53d4909ce2d6aa2d83dde2eb (patch)
tree84df3cedf71cb403fa6a6e80106442f0401bbd43 /tile.c
parent3515b670d201aab581147e062fe47ea6be918980 (diff)
downloadopenttd-e86e9f96ca34114d53d4909ce2d6aa2d83dde2eb.tar.xz
(svn r1715) Move [GS]etMapExtraBits to tile.[ch]
Diffstat (limited to 'tile.c')
-rw-r--r--tile.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tile.c b/tile.c
new file mode 100644
index 000000000..f8641ca98
--- /dev/null
+++ b/tile.c
@@ -0,0 +1,14 @@
+#include "tile.h"
+
+void SetMapExtraBits(TileIndex tile, byte bits)
+{
+ assert(tile < MapSize());
+ _map_extra_bits[tile >> 2] &= ~(3 << ((tile & 3) * 2));
+ _map_extra_bits[tile >> 2] |= (bits&3) << ((tile & 3) * 2);
+}
+
+uint GetMapExtraBits(TileIndex tile)
+{
+ assert(tile < MapSize());
+ return (_map_extra_bits[tile >> 2] >> (tile & 3) * 2) & 3;
+}