summaryrefslogtreecommitdiff
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
commitf08d102ac203b6072b5d1381d0a2c435dace731a (patch)
tree84df3cedf71cb403fa6a6e80106442f0401bbd43
parenta2de96abc09e4f64bdc860804275b033f721c153 (diff)
downloadopenttd-f08d102ac203b6072b5d1381d0a2c435dace731a.tar.xz
(svn r1715) Move [GS]etMapExtraBits to tile.[ch]
-rw-r--r--Makefile1
-rw-r--r--functions.h2
-rw-r--r--landscape.c11
-rw-r--r--tile.c14
-rw-r--r--tile.h3
5 files changed, 18 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 3b8090542..318b12255 100644
--- a/Makefile
+++ b/Makefile
@@ -624,6 +624,7 @@ C_SOURCES += strings.c
C_SOURCES += subsidy_gui.c
C_SOURCES += terraform_gui.c
C_SOURCES += texteff.c
+C_SOURCES += tile.c
C_SOURCES += town_cmd.c
C_SOURCES += town_gui.c
C_SOURCES += train_cmd.c
diff --git a/functions.h b/functions.h
index 36a8e6295..e39e27d38 100644
--- a/functions.h
+++ b/functions.h
@@ -14,8 +14,6 @@ int GetTileZ(uint tile);
void DoClearSquare(uint tile);
void CDECL ModifyTile(uint tile, uint flags, ...);
-void SetMapExtraBits(uint tile, byte flags);
-uint GetMapExtraBits(uint tile);
void RunTileLoop(void);
uint GetPartialZ(int x, int y, int corners);
diff --git a/landscape.c b/landscape.c
index 4e14682fd..993badea8 100644
--- a/landscape.c
+++ b/landscape.c
@@ -430,17 +430,6 @@ void CDECL ModifyTile(uint tile, uint flags, ...)
MarkTileDirtyByTile(tile);
}
-void SetMapExtraBits(uint tile, byte bits)
-{
- _map_extra_bits[tile >> 2] &= ~(3 << ((tile&3)*2));
- _map_extra_bits[tile >> 2] |= (bits&3) << ((tile&3)*2);
-}
-
-uint GetMapExtraBits(uint tile)
-{
- assert(tile < MapSize());
- return (_map_extra_bits[tile >> 2] >> (tile & 3) * 2) & 3;
-}
#define TILELOOP_BITS 4
#define TILELOOP_SIZE (1 << TILELOOP_BITS)
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;
+}
diff --git a/tile.h b/tile.h
index 0019397dd..ec274d62f 100644
--- a/tile.h
+++ b/tile.h
@@ -3,6 +3,9 @@
#include "map.h"
+void SetMapExtraBits(TileIndex tile, byte flags);
+uint GetMapExtraBits(TileIndex tile);
+
static inline uint TileHeight(TileIndex tile)
{
assert(tile < MapSize());