(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.

This commit is contained in:
tron
2005-07-13 18:04:01 +00:00
parent 1a1dde7c8d
commit 8c1d74162f
44 changed files with 990 additions and 827 deletions

12
tile.h
View File

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