MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / StartGeneratingLandscape

Function StartGeneratingLandscape

src/genworld_gui.cpp:321–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319};
320
321static void StartGeneratingLandscape(GenerateLandscapeWindowMode mode)
322{
323 CloseAllNonVitalWindows();
324 ClearErrorMessages();
325
326 /* Copy all XXX_newgame to XXX when coming from outside the editor */
327 MakeNewgameSettingsLive();
328 ResetGRFConfig(true);
329
330 SndConfirmBeep();
331 switch (mode) {
332 case GLWM_GENERATE: _switch_mode = (_game_mode == GM_EDITOR) ? SM_GENRANDLAND : SM_NEWGAME; break;
333 case GLWM_HEIGHTMAP: _switch_mode = (_game_mode == GM_EDITOR) ? SM_LOAD_HEIGHTMAP : SM_START_HEIGHTMAP; break;
334 case GLWM_SCENARIO: _switch_mode = SM_EDITOR; break;
335 default: NOT_REACHED();
336 }
337}
338
339static void LandscapeGenerationCallback(Window *w, bool confirmed)
340{

Callers 5

OnClickMethod · 0.85
StartScenarioEditorFunction · 0.85
StartNewGameWithoutGUIFunction · 0.85
OnClickMethod · 0.85

Calls 6

CloseAllNonVitalWindowsFunction · 0.85
ClearErrorMessagesFunction · 0.85
MakeNewgameSettingsLiveFunction · 0.85
ResetGRFConfigFunction · 0.85
SndConfirmBeepFunction · 0.85
NOT_REACHEDFunction · 0.85

Tested by

no test coverage detected