Types related to companies.
Owner
Enum for all companies/owners.
void GWAbortProc()
Called when genworld is aborted.
void IncreaseGeneratingWorldProgress(GenWorldProgress cls)
Increases the current stage of the world generation with one.
bool _generating_world
Whether we are generating the map or not.
static const uint MAP_HEIGHT_LIMIT_AUTO_MINIMUM
When map height limit is auto, make this the lowest possible map height limit.
void GenerateWorldSetCallback(GWDoneProc *proc)
Set here the function, if any, that you want to be called when landscape generation is done.
static const uint CUSTOM_SEA_LEVEL_MAX_PERCENTAGE
Maximum percentage a user can specify for custom sea level.
void GenerateWorldSetAbortCallback(GWAbortProc *proc)
Set here the function, if any, that you want to be called when landscape generation is aborted.
void ShowGenerateWorldProgress()
Show the window where a user can follow the process of the map generation.
void SetNewLandscapeType(uint8_t landscape)
Changes landscape type and sets genworld window dirty.
void GenerateWorld(GenWorldMode mode, uint size_x, uint size_y, bool reset_settings=true)
Generate a world.
GenWorldMode
Modes for GenerateWorld.
@ GWM_HEIGHTMAP
Generate a newgame from a heightmap.
@ GWM_EMPTY
Generate an empty map (sea-level)
@ GWM_RANDOM
Generate a random map for SE.
@ GWM_NEWGAME
Generate a map for a new game.
void HandleGeneratingWorldAbortion()
Really handle the abortion, i.e.
static const uint CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY
Value for custom sea level in difficulty settings.
void ShowCreateScenario()
Show the window to create a scenario.
static const uint CUSTOM_SEA_LEVEL_MIN_PERCENTAGE
Minimum percentage a user can specify for custom sea level.
GenWorldProgress
Current stage of world generation process.
@ GWP_TREE
Generate trees.
@ GWP_ROUGH_ROCKY
Make rough and rocky areas.
@ GWP_OBJECT
Generate objects (radio tower, light houses)
@ GWP_MAP_INIT
Initialize/allocate the map, start economy.
@ GWP_TOWN
Generate towns.
@ GWP_RUNSCRIPT
Runs the game script at most 2500 times, or when ever the script sleeps.
@ GWP_GAME_START
Really prepare to start the game.
@ GWP_INDUSTRY
Generate industries.
@ GWP_LANDSCAPE
Create the landscape.
@ GWP_GAME_INIT
Initialize the game.
@ GWP_RIVER
Create the rivers.
@ GWP_RUNTILELOOP
Runs the tile loop 1280 times to make snow etc.
void GWDoneProc()
Procedure called when the genworld process finishes.
static const uint MAP_HEIGHT_LIMIT_AUTO_CEILING_ROOM
When map height limit is auto, the map height limit will be the higest peak plus this value.
static const uint32_t GENERATE_NEW_SEED
Create a new random seed.
void AbortGeneratingWorld()
Initializes the abortion process.
bool IsGeneratingWorldAborted()
Is the generation being aborted?
void StartScenarioEditor()
Start with a scenario editor.
static const uint CUSTOM_TERRAIN_TYPE_NUMBER_DIFFICULTY
Value for custom terrain type in difficulty settings.
void SetGeneratingWorldProgress(GenWorldProgress cls, uint total)
Set the total of a stage of the world generation.
void PrepareGenerateWorldProgress()
Initializes the progress counters to the starting point.
void LoadTownData()
Load town data from _file_to_saveload, place towns at the appropriate locations, and expand them to t...
LandscapeGenerator
Constants related to world generation.
@ LG_ORIGINAL
The original landscape generator.
@ LG_TERRAGENESIS
TerraGenesis Perlin landscape generator.
void StartNewGameWithoutGUI(uint32_t seed)
Start a normal game without the GUI.
TgenSmoothness
Smoothness presets.
@ TGEN_SMOOTHNESS_BEGIN
First smoothness value.
@ TGEN_SMOOTHNESS_ROUGH
Smoothness preset 'rough'.
@ TGEN_SMOOTHNESS_VERY_SMOOTH
Smoothness preset 'very smooth'.
@ TGEN_SMOOTHNESS_VERY_ROUGH
Smoothness preset 'very rough'.
@ TGEN_SMOOTHNESS_SMOOTH
Smoothness preset 'smooth'.
@ TGEN_SMOOTHNESS_END
Used to iterate.
Properties of current genworld process.
GWDoneProc * proc
Proc that is called when done (can be nullptr)
CompanyID lc
The local_company before generating.
uint size_x
X-size of the map.
uint size_y
Y-size of the map.
bool abort
Whether to abort the thread ASAP.
GWAbortProc * abortp
Proc that is called when aborting (can be nullptr)
GenWorldMode mode
What mode are we making a world in.