summaryrefslogtreecommitdiff
path: root/tile.h
diff options
context:
space:
mode:
authorludde <ludde@openttd.org>2005-07-19 11:42:40 +0000
committerludde <ludde@openttd.org>2005-07-19 11:42:40 +0000
commit3e97dda275f59b2bcaea44c48ceba7a0ed054d9c (patch)
tree4d3f43a36f40b9b8d244fda8f0cdb2bba4bc64ec /tile.h
parent29f6ada06a0cbf3954e9c5f61657d4ed763cee79 (diff)
downloadopenttd-3e97dda275f59b2bcaea44c48ceba7a0ed054d9c.tar.xz
(svn r2635) Fix: [ntp/misc] Improve the old pathfinder. Changed it to A* instead of Dijkstra.
- Benchmark shows that NTP is now around 10x faster than NPF. - Made IsTunnelTile macro to determine if a tile is a tunnel. - Added some useful debugging functions for making tiles red / getting accurate timestamps. - Remove old depot finding algorithm. - Disable warning for signed/unsigned comparisons.
Diffstat (limited to 'tile.h')
-rw-r--r--tile.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/tile.h b/tile.h
index 9074f8601..4f67746bc 100644
--- a/tile.h
+++ b/tile.h
@@ -15,7 +15,7 @@ typedef enum TileTypes {
MP_VOID, // invisible tiles at the SW and SE border
MP_INDUSTRY,
MP_TUNNELBRIDGE,
- MP_UNMOVABLE
+ MP_UNMOVABLE,
} TileType;
/* Direction as commonly used in v->direction, 8 way. */
@@ -95,6 +95,11 @@ static inline bool IsTileType(TileIndex tile, TileType type)
return GetTileType(tile) == type;
}
+static inline bool IsTunnelTile(TileIndex tile)
+{
+ return IsTileType(tile, MP_TUNNELBRIDGE) && (_m[tile].m5 & 0xF0) == 0;
+}
+
static inline Owner GetTileOwner(TileIndex tile)
{
assert(tile < MapSize());