summaryrefslogtreecommitdiff
path: root/map.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-06-25 06:15:43 +0000
committertron <tron@openttd.org>2005-06-25 06:15:43 +0000
commit61f6f07edd837728d72e83daa0a4b8893ec77307 (patch)
tree3374c2cd95704c5e34c2a7c62b0ba647c4002e7f /map.h
parentcea090af09fbee47ef4eea01190ba8eb8e17aef8 (diff)
downloadopenttd-61f6f07edd837728d72e83daa0a4b8893ec77307.tar.xz
(svn r2486) Turn TILE_FROM_XY into an inline function and rename it to TileVirtXY
Diffstat (limited to 'map.h')
-rw-r--r--map.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/map.h b/map.h
index 80e67cc09..128917743 100644
--- a/map.h
+++ b/map.h
@@ -3,7 +3,6 @@
#include "stdafx.h"
-#define TILE_FROM_XY(x,y) (TileIndex)((((y) >> 4) << MapLogX()) + ((x) >> 4))
#define TILE_XY(x,y) (((y) << MapLogX()) + (x))
#define TILE_MASK(x) ((x) & ((1 << (MapLogX() + MapLogY())) - 1))
@@ -37,6 +36,11 @@ uint ScaleByMapSize1D(uint); // Scale relative to the circumference of the map
typedef uint32 TileIndex;
+static inline TileIndex TileVirtXY(uint x, uint y)
+{
+ return (y >> 4 << MapLogX()) + (x >> 4);
+}
+
typedef enum {
OWNER_TOWN = 0xf, // a town owns the tile
OWNER_NONE = 0x10, // nobody owns the tile