Codechange: migrate size related functions to Map structure

This commit is contained in:
Rubidium
2023-01-21 10:43:03 +01:00
committed by rubidium42
parent d481f78b24
commit fe2bcd2a58
56 changed files with 334 additions and 343 deletions

View File

@@ -110,8 +110,8 @@ static void _GenerateWorld()
/* Make sure the tiles at the north border are void tiles if needed. */
if (_settings_game.construction.freeform_edges) {
for (uint x = 0; x < MapSizeX(); x++) MakeVoid(TileXY(x, 0));
for (uint y = 0; y < MapSizeY(); y++) MakeVoid(TileXY(0, y));
for (uint x = 0; x < Map::SizeX(); x++) MakeVoid(TileXY(x, 0));
for (uint y = 0; y < Map::SizeY(); y++) MakeVoid(TileXY(0, y));
}
/* Make the map the height of the setting */
@@ -322,7 +322,7 @@ void GenerateWorld(GenWorldMode mode, uint size_x, uint size_y, bool reset_setti
ShowGenerateWorldProgress();
/* Centre the view on the map */
ScrollMainWindowToTile(TileXY(MapSizeX() / 2, MapSizeY() / 2), true);
ScrollMainWindowToTile(TileXY(Map::SizeX() / 2, Map::SizeY() / 2), true);
_GenerateWorld();
}