Add: allow loading heightmaps from command-line (#11870)

If you want to load a file from tar, you have to give the file
inside the tar in order for it to work:

<tar-file>/<dir-in-tar>/<file>.png
This commit is contained in:
Patric Stout
2024-01-22 23:35:25 +01:00
committed by GitHub
parent bf3fd6526b
commit 090616b4c9
10 changed files with 57 additions and 30 deletions

View File

@@ -1557,7 +1557,7 @@ static uint8_t CalculateDesertLine()
return CalculateCoverageLine(100 - _settings_game.game_creation.desert_coverage, 4);
}
void GenerateLandscape(byte mode)
bool GenerateLandscape(byte mode)
{
/** Number of steps of landscape generation */
enum GenLandscapeSteps {
@@ -1571,7 +1571,9 @@ void GenerateLandscape(byte mode)
if (mode == GWM_HEIGHTMAP) {
SetGeneratingWorldProgress(GWP_LANDSCAPE, steps + GLS_HEIGHTMAP);
LoadHeightmap(_file_to_saveload.detail_ftype, _file_to_saveload.name.c_str());
if (!LoadHeightmap(_file_to_saveload.detail_ftype, _file_to_saveload.name.c_str())) {
return false;
}
IncreaseGeneratingWorldProgress(GWP_LANDSCAPE);
} else if (_settings_game.game_creation.land_generator == LG_TERRAGENESIS) {
SetGeneratingWorldProgress(GWP_LANDSCAPE, steps + GLS_TERRAGENESIS);
@@ -1657,6 +1659,7 @@ void GenerateLandscape(byte mode)
}
CreateRivers();
return true;
}
void OnTick_Town();