@@ -1247,12 +1247,13 @@ static void _SetGeneratingWorldProgress(
if (IsGeneratingWorldAborted()) HandleGeneratingWorldAbortion();
if (total == 0) {
assert(_tp.cls == _generation_class_table[cls]);
_tp.current += progress;
assert(_tp.current <= _tp.total);
} else {
_tp.cls = _generation_class_table[cls];
_tp.current = progress;
_tp.total = total;
_tp.percent = percent_table[cls];
}
@@ -857,81 +857,78 @@ static void CreateDesertOrRainForest()
void GenerateLandscape(byte mode)
{
static const int gwp_desert_amount = 4 + 8;
if (mode == GW_HEIGHTMAP) {
SetGeneratingWorldProgress(GWP_LANDSCAPE, (_settings_game.game_creation.landscape == LT_TROPIC) ? 1 + gwp_desert_amount : 1);
SetGeneratingWorldProgress(GWP_LANDSCAPE, (_settings_game.game_creation.landscape == LT_TROPIC) ? 3 + gwp_desert_amount : 3);
LoadHeightmap(_file_to_saveload.name);
IncreaseGeneratingWorldProgress(GWP_LANDSCAPE);
} else if (_settings_game.game_creation.land_generator == LG_TERRAGENESIS) {
SetGeneratingWorldProgress(GWP_LANDSCAPE, (_settings_game.game_creation.landscape == LT_TROPIC) ? 5 + gwp_desert_amount : 5);
GenerateTerrainPerlin();
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));
switch (_settings_game.game_creation.landscape) {
case LT_ARCTIC: {
SetGeneratingWorldProgress(GWP_LANDSCAPE, 2);
uint32 r = Random();
for (uint i = ScaleByMapSize(GB(r, 0, 7) + 950); i != 0; --i) {
GenerateTerrain(2, 0);
uint flag = GB(r, 7, 2) | 4;
for (uint i = ScaleByMapSize(GB(r, 9, 7) + 450); i != 0; --i) {
GenerateTerrain(4, flag);
} break;
case LT_TROPIC: {
SetGeneratingWorldProgress(GWP_LANDSCAPE, 3 + gwp_desert_amount);
SetGeneratingWorldProgress(GWP_LANDSCAPE, 2 + gwp_desert_amount);
for (uint i = ScaleByMapSize(GB(r, 0, 7) + 170); i != 0; --i) {
GenerateTerrain(0, 0);
for (uint i = ScaleByMapSize(GB(r, 9, 8) + 1700); i != 0; --i) {
GenerateTerrain(0, flag);
flag ^= 2;
for (uint i = ScaleByMapSize(GB(r, 17, 7) + 410); i != 0; --i) {
GenerateTerrain(3, flag);
default: {
SetGeneratingWorldProgress(GWP_LANDSCAPE, 1);
uint i = ScaleByMapSize(GB(r, 0, 7) + (3 - _settings_game.difficulty.quantity_sea_lakes) * 256 + 100);
for (; i != 0; --i) {
GenerateTerrain(_settings_game.difficulty.terrain_type, 0);
/* Do not call IncreaseGeneratingWorldProgress() before FixSlopes(),
* it allows screen redraw. Drawing of broken slopes crashes the game */
FixSlopes();
ConvertGroundTilesIntoWaterTiles();
if (_settings_game.game_creation.landscape == LT_TROPIC) CreateDesertOrRainForest();
void OnTick_Town();
void OnTick_Trees();
Status change: