(svn r2486) Turn TILE_FROM_XY into an inline function and rename it to TileVirtXY

This commit is contained in:
tron
2005-06-25 06:15:43 +00:00
parent cea090af09
commit 61f6f07edd
24 changed files with 65 additions and 61 deletions

6
map.h
View File

@@ -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