summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ai.c1
-rw-r--r--ai_build.c1
-rw-r--r--ai_new.c1
-rw-r--r--ai_pathfinder.c1
-rw-r--r--aircraft_cmd.c1
-rw-r--r--aircraft_gui.c1
-rw-r--r--clear_cmd.c1
-rw-r--r--disaster_cmd.c1
-rw-r--r--industry_cmd.c1
-rw-r--r--landscape.c1
-rw-r--r--main_gui.c1
-rw-r--r--map.h38
-rw-r--r--oldloader.c1
-rw-r--r--order_gui.c1
-rw-r--r--pathfind.c1
-rw-r--r--rail_cmd.c1
-rw-r--r--rail_gui.c1
-rw-r--r--road_cmd.c1
-rw-r--r--road_gui.c1
-rw-r--r--roadveh_cmd.c1
-rw-r--r--ship_cmd.c1
-rw-r--r--smallmap_gui.c1
-rw-r--r--station_cmd.c1
-rw-r--r--tile.h43
-rw-r--r--town_cmd.c1
-rw-r--r--train_cmd.c1
-rw-r--r--tree_cmd.c1
-rw-r--r--ttd.c1
-rw-r--r--tunnelbridge_cmd.c1
-rw-r--r--unmovable_cmd.c1
-rw-r--r--vehicle.c1
-rw-r--r--water_cmd.c1
32 files changed, 73 insertions, 38 deletions
diff --git a/ai.c b/ai.c
index 8abe5f655..598ab4d4a 100644
--- a/ai.c
+++ b/ai.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "map.h"
+#include "tile.h"
#include "player.h"
#include "vehicle.h"
#include "engine.h"
diff --git a/ai_build.c b/ai_build.c
index f5745f62c..f53d7793f 100644
--- a/ai_build.c
+++ b/ai_build.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "map.h"
+#include "tile.h"
#include "command.h"
#include "ai.h"
#include "engine.h"
diff --git a/ai_new.c b/ai_new.c
index a62c31eb7..1699f7a4a 100644
--- a/ai_new.c
+++ b/ai_new.c
@@ -17,6 +17,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "command.h"
#include "ai.h"
#include "town.h"
diff --git a/ai_pathfinder.c b/ai_pathfinder.c
index 5c05879ad..4510c60f4 100644
--- a/ai_pathfinder.c
+++ b/ai_pathfinder.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "map.h"
+#include "tile.h"
#include "command.h"
#include "ai.h"
diff --git a/aircraft_cmd.c b/aircraft_cmd.c
index 59f2fe1a6..e1a486329 100644
--- a/aircraft_cmd.c
+++ b/aircraft_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "vehicle.h"
#include "engine.h"
#include "command.h"
diff --git a/aircraft_gui.c b/aircraft_gui.c
index c06485e25..7526d3583 100644
--- a/aircraft_gui.c
+++ b/aircraft_gui.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "window.h"
#include "gui.h"
#include "vehicle.h"
diff --git a/clear_cmd.c b/clear_cmd.c
index a3095646b..4bac5c304 100644
--- a/clear_cmd.c
+++ b/clear_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "viewport.h"
#include "command.h"
diff --git a/disaster_cmd.c b/disaster_cmd.c
index 528019f63..e7d5f2393 100644
--- a/disaster_cmd.c
+++ b/disaster_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "vehicle.h"
#include "command.h"
#include "news.h"
diff --git a/industry_cmd.c b/industry_cmd.c
index 9849e1321..9836d16f7 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "viewport.h"
#include "command.h"
#include "industry.h"
diff --git a/landscape.c b/landscape.c
index ef9984692..4e14682fd 100644
--- a/landscape.c
+++ b/landscape.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "map.h"
+#include "tile.h"
#include <stdarg.h>
#include "gfx.h"
#include "viewport.h"
diff --git a/main_gui.c b/main_gui.c
index 974c7b0b9..ab1fc3844 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "window.h"
#include "gui.h"
#include "viewport.h"
diff --git a/map.h b/map.h
index f37245dfb..a786e10a3 100644
--- a/map.h
+++ b/map.h
@@ -76,42 +76,4 @@ static inline TileIndexDiff TileOffsByDir(uint dir)
return ToTileIndexDiff(_tileoffs_by_dir[dir]);
}
-
-static inline uint TileHeight(TileIndex tile)
-{
- assert(tile < MapSize());
- return _map_type_and_height[tile] & 0xf;
-}
-
-static inline void SetTileHeight(TileIndex tile, uint height)
-{
- assert(tile < MapSize());
- assert(height < 16);
- _map_type_and_height[tile] &= ~0x0F;
- _map_type_and_height[tile] |= height;
-}
-
-static inline uint TilePixelHeight(TileIndex tile)
-{
- return TileHeight(tile) * 8;
-}
-
-static inline int TileType(TileIndex tile)
-{
- assert(tile < MapSize());
- return _map_type_and_height[tile] >> 4;
-}
-
-static inline void SetTileType(TileIndex tile, uint type)
-{
- assert(tile < MapSize());
- _map_type_and_height[tile] &= ~0xF0;
- _map_type_and_height[tile] |= type << 4;
-}
-
-static inline bool IsTileType(TileIndex tile, int type)
-{
- return TileType(tile) == type;
-}
-
#endif
diff --git a/oldloader.c b/oldloader.c
index b8b9fb155..07a4dde3f 100644
--- a/oldloader.c
+++ b/oldloader.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "town.h"
#include "industry.h"
#include "station.h"
diff --git a/order_gui.c b/order_gui.c
index 02921ad15..f944a6e48 100644
--- a/order_gui.c
+++ b/order_gui.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "window.h"
#include "gui.h"
#include "gfx.h"
diff --git a/pathfind.c b/pathfind.c
index 6fe7d414a..58eaba04a 100644
--- a/pathfind.c
+++ b/pathfind.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "ttd.h"
#include "map.h"
+#include "tile.h"
#include "pathfind.h"
// remember which tiles we have already visited so we don't visit them again.
diff --git a/rail_cmd.c b/rail_cmd.c
index c768edb62..f6f8944f0 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -3,6 +3,7 @@
#include "table/strings.h"
#include "gfx.h"
#include "map.h"
+#include "tile.h"
#include "vehicle.h"
#include "viewport.h"
#include "command.h"
diff --git a/rail_gui.c b/rail_gui.c
index fa5dbfcaa..050c83d7e 100644
--- a/rail_gui.c
+++ b/rail_gui.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "window.h"
#include "gui.h"
#include "viewport.h"
diff --git a/road_cmd.c b/road_cmd.c
index cfac45d59..a0d68637c 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "vehicle.h"
#include "viewport.h"
#include "command.h"
diff --git a/road_gui.c b/road_gui.c
index b3fa397ea..04be3ac27 100644
--- a/road_gui.c
+++ b/road_gui.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "window.h"
#include "gui.h"
#include "viewport.h"
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index efc03e98c..9e34c797f 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "vehicle.h"
#include "engine.h"
#include "command.h"
diff --git a/ship_cmd.c b/ship_cmd.c
index 5efe58abb..c7330b9d2 100644
--- a/ship_cmd.c
+++ b/ship_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "vehicle.h"
#include "command.h"
#include "pathfind.h"
diff --git a/smallmap_gui.c b/smallmap_gui.c
index e86455aa0..eed9a9c6a 100644
--- a/smallmap_gui.c
+++ b/smallmap_gui.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "gui.h"
#include "window.h"
#include "gfx.h"
diff --git a/station_cmd.c b/station_cmd.c
index d9cd16a30..d43468307 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "station.h"
#include "gfx.h"
#include "window.h"
diff --git a/tile.h b/tile.h
new file mode 100644
index 000000000..0019397dd
--- /dev/null
+++ b/tile.h
@@ -0,0 +1,43 @@
+#ifndef TILE_H
+#define TILE_H
+
+#include "map.h"
+
+static inline uint TileHeight(TileIndex tile)
+{
+ assert(tile < MapSize());
+ return _map_type_and_height[tile] & 0xf;
+}
+
+static inline void SetTileHeight(TileIndex tile, uint height)
+{
+ assert(tile < MapSize());
+ assert(height < 16);
+ _map_type_and_height[tile] &= ~0x0F;
+ _map_type_and_height[tile] |= height;
+}
+
+static inline uint TilePixelHeight(TileIndex tile)
+{
+ return TileHeight(tile) * 8;
+}
+
+static inline int TileType(TileIndex tile)
+{
+ assert(tile < MapSize());
+ return _map_type_and_height[tile] >> 4;
+}
+
+static inline void SetTileType(TileIndex tile, uint type)
+{
+ assert(tile < MapSize());
+ _map_type_and_height[tile] &= ~0xF0;
+ _map_type_and_height[tile] |= type << 4;
+}
+
+static inline bool IsTileType(TileIndex tile, int type)
+{
+ return TileType(tile) == type;
+}
+
+#endif
diff --git a/town_cmd.c b/town_cmd.c
index 836657ab6..3f0a30c03 100644
--- a/town_cmd.c
+++ b/town_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "viewport.h"
#include "town.h"
#include "command.h"
diff --git a/train_cmd.c b/train_cmd.c
index 43ca20553..3d55f2484 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "vehicle.h"
#include "command.h"
#include "pathfind.h"
diff --git a/tree_cmd.c b/tree_cmd.c
index bf9fbdb73..ec4f4f1a0 100644
--- a/tree_cmd.c
+++ b/tree_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "viewport.h"
#include "command.h"
#include "town.h"
diff --git a/ttd.c b/ttd.c
index 0ebd341cf..f4bfbb234 100644
--- a/ttd.c
+++ b/ttd.c
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#define VARDEF
#include "ttd.h"
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index 62418e2d3..04903d375 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "vehicle.h"
#include "viewport.h"
#include "command.h"
diff --git a/unmovable_cmd.c b/unmovable_cmd.c
index 129e22c28..21f1c99bc 100644
--- a/unmovable_cmd.c
+++ b/unmovable_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "command.h"
#include "viewport.h"
#include "player.h"
diff --git a/vehicle.c b/vehicle.c
index 915da38da..eb048a840 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "vehicle.h"
#include "gfx.h"
#include "viewport.h"
diff --git a/water_cmd.c b/water_cmd.c
index dfa7bd6cb..082d50bce 100644
--- a/water_cmd.c
+++ b/water_cmd.c
@@ -2,6 +2,7 @@
#include "ttd.h"
#include "table/strings.h"
#include "map.h"
+#include "tile.h"
#include "vehicle.h"
#include "viewport.h"
#include "command.h"