summaryrefslogtreecommitdiff
path: root/openttd.c
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 /openttd.c
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 'openttd.c')
-rw-r--r--openttd.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/openttd.c b/openttd.c
index 8ec907162..0a63fe326 100644
--- a/openttd.c
+++ b/openttd.c
@@ -1202,12 +1202,12 @@ static void ConvertTownOwner(void)
for (tile = 0; tile != MapSize(); tile++) {
if (IsTileType(tile, MP_STREET)) {
- if (IsLevelCrossing(tile) && _map3_lo[tile] & 0x80)
- _map3_lo[tile] = OWNER_TOWN;
+ if (IsLevelCrossing(tile) && _m[tile].m3 & 0x80)
+ _m[tile].m3 = OWNER_TOWN;
- if (_map_owner[tile] & 0x80) SetTileOwner(tile, OWNER_TOWN);
+ if (_m[tile].owner & 0x80) SetTileOwner(tile, OWNER_TOWN);
} else if (IsTileType(tile, MP_TUNNELBRIDGE)) {
- if (_map_owner[tile] & 0x80) SetTileOwner(tile, OWNER_TOWN);
+ if (_m[tile].owner & 0x80) SetTileOwner(tile, OWNER_TOWN);
}
}
}
@@ -1401,20 +1401,20 @@ bool AfterLoadGame(uint version)
if (version <= 0x600) {
BEGIN_TILE_LOOP(tile, MapSizeX(), MapSizeY(), 0) {
if (IsTileType(tile, MP_HOUSE)) {
- _map3_hi[tile] = _map2[tile];
+ _m[tile].m4 = _m[tile].m2;
//XXX magic
SetTileType(tile, MP_VOID);
- _map2[tile] = ClosestTownFromTile(tile,(uint)-1)->index;
+ _m[tile].m2 = ClosestTownFromTile(tile,(uint)-1)->index;
SetTileType(tile, MP_HOUSE);
} else if (IsTileType(tile, MP_STREET)) {
//XXX magic
- _map3_hi[tile] |= (_map2[tile] << 4);
+ _m[tile].m4 |= (_m[tile].m2 << 4);
if (IsTileOwner(tile, OWNER_TOWN)) {
SetTileType(tile, MP_VOID);
- _map2[tile] = ClosestTownFromTile(tile,(uint)-1)->index;
+ _m[tile].m2 = ClosestTownFromTile(tile,(uint)-1)->index;
SetTileType(tile, MP_STREET);
} else {
- _map2[tile] = 0;
+ _m[tile].m2 = 0;
}
}
} END_TILE_LOOP(tile, MapSizeX(), MapSizeY(), 0);
@@ -1429,9 +1429,9 @@ bool AfterLoadGame(uint version)
if (version < 0xF00) {
BEGIN_TILE_LOOP(tile, MapSizeX(), MapSizeY(), 0) {
- if (IsTileType(tile, MP_RAILWAY) && HasSignals(tile) && HASBIT(_map3_hi[tile], 2)) {
- CLRBIT(_map3_hi[tile], 2);
- SETBIT(_map3_hi[tile], 3);
+ if (IsTileType(tile, MP_RAILWAY) && HasSignals(tile) && HASBIT(_m[tile].m4, 2)) {
+ CLRBIT(_m[tile].m4, 2);
+ SETBIT(_m[tile].m4, 3);
}
} END_TILE_LOOP(tile, MapSizeX(), MapSizeY(), 0);
}