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

Function LoadIntroGame

src/openttd.cpp:325–350  ·  view source on GitHub ↗

* Load the introduction game. * @param load_newgrfs Whether to load the NewGRFs or not. */

Source from the content-addressed store, hash-verified

323 * @param load_newgrfs Whether to load the NewGRFs or not.
324 */
325static void LoadIntroGame(bool load_newgrfs = true)
326{
327 _game_mode = GM_MENU;
328
329 if (load_newgrfs) ResetGRFConfig(false);
330
331 /* Setup main window */
332 ResetWindowSystem();
333 SetupColoursAndInitialWindow();
334
335 /* Load the default opening screen savegame */
336 if (SaveOrLoad("opntitle.dat", SLO_LOAD, DFT_GAME_FILE, BASESET_DIR) != SL_OK) {
337 GenerateWorld(GWM_EMPTY, 64, 64); // if failed loading, make empty world.
338 SetLocalCompany(COMPANY_SPECTATOR);
339 } else {
340 SetLocalCompany(CompanyID::Begin());
341 }
342
343 FixTitleGameZoom();
344 _pause_mode = {};
345 _cursor.fix_at = false;
346
347 CheckForMissingGlyphs();
348
349 MusicLoop(); // ensure music is correct
350}
351
352void MakeNewgameSettingsLive()
353{

Callers 4

OnNewGRFsScannedMethod · 0.85
openttd_mainFunction · 0.85
SafeLoadFunction · 0.85
SwitchToModeFunction · 0.85

Calls 10

ResetGRFConfigFunction · 0.85
ResetWindowSystemFunction · 0.85
SaveOrLoadFunction · 0.85
GenerateWorldFunction · 0.85
SetLocalCompanyFunction · 0.85
BeginFunction · 0.85
FixTitleGameZoomFunction · 0.85
CheckForMissingGlyphsFunction · 0.85
MusicLoopFunction · 0.85

Tested by

no test coverage detected