summaryrefslogtreecommitdiff
path: root/tile.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-07-13 18:04:01 +0000
committertron <tron@openttd.org>2005-07-13 18:04:01 +0000
commit8c1d74162f1544e351ae6308cbcca06f324c2c36 (patch)
treeb36523450a7bccf37ca126b6f857d1529d44c67b /tile.h
parent1a1dde7c8d0cf18e49b5af7fef1368216120eed1 (diff)
downloadopenttd-8c1d74162f1544e351ae6308cbcca06f324c2c36.tar.xz
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
Diffstat (limited to 'tile.h')
-rw-r--r--tile.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/tile.h b/tile.h
index dcc22aec9..2a34e85e4 100644
--- a/tile.h
+++ b/tile.h
@@ -58,14 +58,14 @@ static inline bool CorrectZ(uint tileh)
static inline uint TileHeight(TileIndex tile)
{
assert(tile < MapSize());
- return GB(_map_type_and_height[tile], 0, 4);
+ return GB(_m[tile].type_height, 0, 4);
}
static inline void SetTileHeight(TileIndex tile, uint height)
{
assert(tile < MapSize());
assert(height < 16);
- SB(_map_type_and_height[tile], 0, 4, height);
+ SB(_m[tile].type_height, 0, 4, height);
}
static inline uint TilePixelHeight(TileIndex tile)
@@ -76,13 +76,13 @@ static inline uint TilePixelHeight(TileIndex tile)
static inline TileType GetTileType(TileIndex tile)
{
assert(tile < MapSize());
- return GB(_map_type_and_height[tile], 4, 4);
+ return GB(_m[tile].type_height, 4, 4);
}
static inline void SetTileType(TileIndex tile, TileType type)
{
assert(tile < MapSize());
- SB(_map_type_and_height[tile], 4, 4, type);
+ SB(_m[tile].type_height, 4, 4, type);
}
static inline bool IsTileType(TileIndex tile, TileType type)
@@ -97,7 +97,7 @@ static inline Owner GetTileOwner(TileIndex tile)
assert(!IsTileType(tile, MP_VOID));
assert(!IsTileType(tile, MP_INDUSTRY));
- return _map_owner[tile];
+ return _m[tile].owner;
}
static inline void SetTileOwner(TileIndex tile, Owner owner)
@@ -107,7 +107,7 @@ static inline void SetTileOwner(TileIndex tile, Owner owner)
assert(!IsTileType(tile, MP_VOID));
assert(!IsTileType(tile, MP_INDUSTRY));
- _map_owner[tile] = owner;
+ _m[tile].owner = owner;
}
static inline bool IsTileOwner(TileIndex tile, Owner owner)