OpenTTD Source: src/openttd.cpp File Reference

OpenTTD Source 15.0-RC2

Data Structures | Functions | Variables
openttd.cpp File Reference

Functions related to starting OpenTTD. More...

`#include "stdafx.h"`
`#include "blitter/factory.hpp"`
`#include "sound/sound_driver.hpp"`
`#include "music/music_driver.hpp"`
`#include "video/video_driver.hpp"`
`#include "mixer.h"`
`#include "fontcache.h"`
`#include "error.h"`
`#include "error_func.h"`
`#include "gui.h"`
`#include "base_media_base.h"`
`#include "base_media_graphics.h"`
`#include "base_media_music.h"`
`#include "base_media_sounds.h"`
`#include "saveload/saveload.h"`
`#include "company_cmd.h"`
`#include "company_func.h"`
`#include "company_gui.h"`
`#include "command_func.h"`
`#include "news_func.h"`
`#include "fios.h"`
`#include "aircraft.h"`
`#include "roadveh.h"`
`#include "train.h"`
`#include "ship.h"`
`#include "console_func.h"`
`#include "screenshot.h"`
`#include "network/network.h"`
`#include "network/network_func.h"`
`#include "ai/ai.hpp"`
`#include "ai/ai_config.hpp"`
`#include "settings_func.h"`
`#include "genworld.h"`
`#include "progress.h"`
`#include "strings_func.h"`
`#include "vehicle_func.h"`
`#include "gamelog.h"`
`#include "animated_tile_func.h"`
`#include "roadstop_base.h"`
`#include "elrail_func.h"`
`#include "rev.h"`
`#include "highscore.h"`
`#include "station_base.h"`
`#include "crashlog.h"`
`#include "engine_func.h"`
`#include "core/random_func.hpp"`
`#include "rail_gui.h"`
`#include "road_gui.h"`
`#include "core/backup_type.hpp"`
`#include "hotkeys.h"`
`#include "newgrf.h"`
`#include "misc/getoptdata.h"`
`#include "game/game.hpp"`
`#include "game/game_config.hpp"`
`#include "town.h"`
`#include "subsidy_func.h"`
`#include "gfx_layout.h"`
`#include "viewport_func.h"`
`#include "viewport_sprite_sorter.h"`
`#include "framerate_type.h"`
`#include "industry.h"`
`#include "network/network_gui.h"`
`#include "network/network_survey.h"`
`#include "misc_cmd.h"`
`#include "timer/timer.h"`
`#include "timer/timer_game_calendar.h"`
`#include "timer/timer_game_economy.h"`
`#include "timer/timer_game_realtime.h"`
`#include "timer/timer_game_tick.h"`
`#include "social_integration.h"`
`#include "core/string_consumer.hpp"`
`#include "linkgraph/linkgraphschedule.h"`
`#include <system_error>`
`#include "table/strings.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | AfterNewGRFScan
| Callback structure of statements to be executed after the NewGRF scan. More...

## Functions
void | CallLandscapeTick ()
void | DoPaletteAnimations ()
void | MusicLoop ()
| Check music playback status and start/stop/song-finished.
void | CallWindowGameTickEvent ()
| Dispatch OnGameTick event over all windows.
bool | HandleBootstrap ()
| Handle all procedures for bootstrapping OpenTTD without a base graphics set.
void | CheckCaches ()
| Check the validity of some of the caches.
Company * | DoStartupNewCompany (bool is_ai, CompanyID company=CompanyID::Invalid())
| Create a new company and sets all company variables default values.
void | OSOpenBrowser (const std::string &url)
void | ShowOSErrorBox (std::string_view buf, bool system)
void | UserErrorI (const std::string &str)
| Error handling for fatal user errors.
void | FatalErrorI (const std::string &str)
| Error handling for fatal non-user errors.
static void | ShowHelp ()
| Show the help message when someone passed a wrong parameter.
static void | WriteSavegameInfo (const std::string &name)
static void | ParseResolution (Dimension &res, std::string_view s)
| Extract the resolution from the given string and store it in the 'res' parameter.
static void | ShutdownGame ()
| Uninitializes drivers, frees allocated memory, cleans pools, ... Generally, prepares the game for shutting down.
static void | LoadIntroGame (bool load_newgrfs=true)
| Load the introduction game.
void | MakeNewgameSettingsLive ()
void | OpenBrowser (const std::string &url)
void | PostMainLoop ()
static std::vector< OptionData > | CreateOptions ()
| Create all the options that OpenTTD supports.
int | openttd_main (std::span< std::string_view > arguments)
| Main entry point for this lovely game.
void | HandleExitGameRequest ()
static void | OnStartScenario ()
| Triggers everything required to set up a saved scenario for a new game.
static void | OnStartGame (bool dedicated_server)
| Triggers everything that should be triggered when starting a game.
static void | MakeNewGameDone ()
static void | MakeNewGame (bool from_heightmap, bool reset_settings)
static void | MakeNewEditorWorldDone ()
static void | MakeNewEditorWorld ()
bool | SafeLoad (const std::string &filename, SaveLoadOperation fop, DetailedFileType dft, GameMode newgm, Subdirectory subdir, std::shared_ptr< LoadFilter > lf=nullptr)
| Load the specified savegame but on error do different things.
static void | UpdateSocialIntegration (GameMode game_mode)
void | SwitchToMode (SwitchMode new_mode)
void | StateGameLoop ()
| State controlling game loop.
void | ChangeAutosaveFrequency (bool reset)
| Reset the interval of the autosave.
bool | RequestNewGRFScan (NewGRFScanCallback *callback)
| Request a new NewGRF scan.
void | GameLoop ()

## Variables
std::string | _config_file
| Configuration file of OpenTTD.
bool | _save_config = false
bool | _request_newgrf_scan = false
NewGRFScanCallback * | _request_newgrf_scan_callback = nullptr
static IntervalTimer< TimerGameRealtime > | _autosave_interval ({std::chrono::milliseconds::zero(), TimerGameRealtime::AUTOSAVE}, [](auto) { _pause_mode.Reset(PauseMode::CommandDuringPause);_do_autosave=true;SetWindowDirty(WC_STATUS_BAR, 0);static FiosNumberedSaveName _autosave_ctr("autosave");DoAutoOrNetsave(_autosave_ctr);_do_autosave=false;SetWindowDirty(WC_STATUS_BAR, 0);})
| Interval for regular autosaves.

## Detailed Description

Functions related to starting OpenTTD.

Definition in file openttd.cpp.

## Function Documentation

## ◆ CallLandscapeTick()

void CallLandscapeTick | ( |  | ) |

Definition at line 1713 of file landscape.cpp.

## ◆ CallWindowGameTickEvent()

void CallWindowGameTickEvent | ( |  | ) |

Dispatch OnGameTick event over all windows.

Definition at line 3323 of file window.cpp.

References Window::OnGameTick().

Referenced by StateGameLoop().

## ◆ ChangeAutosaveFrequency()

void ChangeAutosaveFrequency | ( | bool | reset | ) |

Reset the interval of the autosave.

If reset is not set, this does not set the elapsed time on the timer, so if the interval is smaller, it might result in an autosave being done immediately.

Parameters

  reset | Whether to reset the timer back to zero, or to continue.

Definition at line 1314 of file openttd.cpp.

References _autosave_interval, _settings_client, TimerGameRealtime::AUTOSAVE, GUISettings::autosave_interval, ClientSettings::gui, and IntervalTimer< TTimerType >::SetInterval().

Referenced by GameOptionsWindow::OnDropdownSelect().

## ◆ CheckCaches()

void CheckCaches | ( |  | ) |
| extern

Check the validity of some of the caches.

Especially in the sense of desyncs between the cached value and what the value would be when calculated from the 'base' data.

Definition at line 36 of file cachecheck.cpp.

References OrthogonalTileArea::Add(), AfterLoadCompanyStats(), CCF_TRACK, Crashed, Debug, DIAGDIR_NE, DIAGDIR_NW, FillNewGRFVehicleCache(), SpecializedVehicle< T, Type >::From(), SpecializedVehicle< Aircraft, VEH_AIRCRAFT >::From(), SpecializedVehicle< Ship, VEH_SHIP >::From(), OrthogonalTileArea::h, CargoList< Tinst, Tcont >::InvalidateCache(), IsBayRoadStopTile(), IsDockingTile(), SpecializedStation< Station, false >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_vehicle_pool >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_town_pool >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_roadstop_pool >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_industry_pool >::Iterate(), Vehicle::Next(), CargoList< Tinst, Tcont >::PeriodsInTransit(), RebuildSubsidisedSourceAndDestinationCache(), RebuildTownCaches(), Station::RecomputeCatchmentForAll(), RoadVehUpdateCache(), OrthogonalTileArea::tile, StationCargoList::TotalCount(), UpdateAircraftCache(), Ship::UpdateCache(), VEH_AIRCRAFT, VEH_ROAD, VEH_SHIP, VEH_TRAIN, and OrthogonalTileArea::w.

Referenced by StateGameLoop().

## ◆ CreateOptions()

static std::vector< OptionData > CreateOptions | ( |  | ) |
| static

Create all the options that OpenTTD supports.

Each option is always a single character with no, an optional or a required value.

Returns
  The available options.

Definition at line 477 of file openttd.cpp.

References ODF_HAS_VALUE.

Referenced by openttd_main().

## ◆ DoPaletteAnimations()

void DoPaletteAnimations | ( |  | ) |

Definition at line 245 of file palette.cpp.

## ◆ DoStartupNewCompany()

Company * DoStartupNewCompany | ( | bool | is_ai,
|  | CompanyID | company = `CompanyID::Invalid()`
| ) |  |
| extern

Create a new company and sets all company variables default values.

Parameters

  is_ai | is an AI company?
  company | CompanyID to use for the new company

Returns
  the company struct

Definition at line 598 of file company_cmd.cpp.

## ◆ FatalErrorI()

void FatalErrorI | ( | const std::string & | str | ) |

Error handling for fatal non-user errors.

Parameters

  str | the string to print.

Note
  Does NEVER return.

Definition at line 140 of file openttd.cpp.

## ◆ GameLoop()

void GameLoop | ( |  | ) |

Definition at line 1336 of file openttd.cpp.

## ◆ HandleBootstrap()

bool HandleBootstrap | ( |  | ) |

Handle all procedures for bootstrapping OpenTTD without a base graphics set.

This requires all kinds of trickery that is needed to avoid the use of sprites from the base graphics set which are pretty interwoven.

Returns
  True if a base set exists, otherwise false.

Definition at line 363 of file bootstrap_gui.cpp.

References _network_available, CheckForMissingGlyphs(), BlitterFactory::GetCurrentBlitter(), VideoDriver::GetInstance(), BaseMedia< GraphicsSet >::GetUsedSet(), InitializeUnicodeGlyphMap(), VideoDriver::MainLoop(), SetColourGradient(), and BaseMedia< GraphicsSet >::SetSet().

Referenced by openttd_main().

## ◆ HandleExitGameRequest()

void HandleExitGameRequest | ( |  | ) |

Definition at line 817 of file openttd.cpp.

## ◆ LoadIntroGame()

static void LoadIntroGame | ( | bool | load_newgrfs = `true` | ) |
| static

Load the introduction game.

Parameters

  load_newgrfs | Whether to load the NewGRFs or not.

Definition at line 325 of file openttd.cpp.

References _pause_mode, BASESET_DIR, CheckForMissingGlyphs(), COMPANY_SPECTATOR, DFT_GAME_FILE, CursorVars::fix_at, GenerateWorld(), GWM_EMPTY, MusicLoop(), ResetGRFConfig(), ResetWindowSystem(), SaveOrLoad(), SetLocalCompany(), SetupColoursAndInitialWindow(), SL_OK, and SLO_LOAD.

Referenced by AfterNewGRFScan::OnNewGRFsScanned(), openttd_main(), and SafeLoad().

## ◆ MakeNewEditorWorld()

static void MakeNewEditorWorld | ( |  | ) |
| static

Definition at line 919 of file openttd.cpp.

## ◆ MakeNewEditorWorldDone()

static void MakeNewEditorWorldDone | ( |  | ) |
| static

Definition at line 914 of file openttd.cpp.

## ◆ MakeNewGame()

static void MakeNewGame | ( | bool | from_heightmap,
|  | bool | reset_settings
| ) |  |
| static

Definition at line 900 of file openttd.cpp.

## ◆ MakeNewGameDone()

static void MakeNewGameDone | ( |  | ) |
| static

Definition at line 860 of file openttd.cpp.

## ◆ MakeNewgameSettingsLive()

void MakeNewgameSettingsLive | ( |  | ) |

Definition at line 352 of file openttd.cpp.

## ◆ MusicLoop()

void MusicLoop | ( |  | ) |

Check music playback status and start/stop/song-finished.

Called from main loop.

Definition at line 453 of file music_gui.cpp.

References MusicSystem::CheckStatus().

Referenced by LoadIntroGame().

## ◆ OnStartGame()

static void OnStartGame | ( | bool | dedicated_server | ) |
| static

Triggers everything that should be triggered when starting a game.

Parameters

  dedicated_server | Whether this is a dedicated server or not.

Definition at line 848 of file openttd.cpp.

References COMPANY_SPECTATOR, GetFirstPlayableCompanyID(), IConsoleCmdExec(), NetworkOnGameStart(), and SetLocalCompany().

## ◆ OnStartScenario()

static void OnStartScenario | ( |  | ) |
| static

Triggers everything required to set up a saved scenario for a new game.

Definition at line 833 of file openttd.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_industry_pool >::Iterate(), EngineOverrideManager::ResetToCurrentNewGRFConfig(), and TimerGameEconomy::year.

## ◆ OpenBrowser()

void OpenBrowser | ( | const std::string & | url | ) |

Definition at line 365 of file openttd.cpp.

## ◆ openttd_main()

int openttd_main | ( | std::span< std::string_view > | arguments | ) |

Main entry point for this lovely game.

Parameters

  arguments | The command line arguments passed to the application.

Returns
  0 when there is no error.

Definition at line 500 of file openttd.cpp.

References _blitter_autodetected, _config_file, _cur_resolution, _file_to_saveload, _game_session_stats, _ini_blitter, _ini_musicdriver, _ini_sounddriver, _ini_videodriver, _load_check_data, _skip_all_newgrf_scanning, _switch_mode, GetOptData::arguments, TarScanner::Baseset, BLT_8BPP, LoadCheckData::Clear(), CreateOptions(), Debug, DeterminePaths(), DFT_GAME_FILE, TarScanner::DoScan(), Driver::DT_MUSIC, Driver::DT_SOUND, Driver::DT_VIDEO, LoadCheckData::error, LoadCheckData::error_msg, BaseGraphics::Ini::extra_version, BaseMedia< SoundsSet >::FindSets(), BaseMedia< GraphicsSet >::FindSets(), BaseMedia< MusicSet >::FindSets(), FiosGetSavegameListCallback(), FiosGetScenarioListCallback(), FONTSIZES_REQUIRED, FS2OTTD(), FT_HEIGHTMAP, FT_SAVEGAME, FT_SCENARIO, GENERATE_NEW_SEED, GenerateWorld(), GetEncodedString(), VideoDriver::GetInstance(), GetOptData::GetOpt(), GraphicsSet::GetOrCreateExtraConfig(), GetString(), BaseMedia< GraphicsSet >::GetUsedSet(), GWM_EMPTY, HandleBootstrap(), LoadCheckData::HasErrors(), CursorVars::in_window, BaseMusic::ini_set, BaseSounds::ini_set, SocialIntegration::Initialize(), InitializeLanguagePacks(), InitializeSpriteSorter(), InitWindowSystem(), GRFConfig::IsCompatible(), FontCache::LoadFontCaches(), LoadFromConfig(), LoadIntroGame(), VideoDriver::MainLoop(), Min, FileToSaveLoad::name, NetworkStartUp(), GetOptData::opt, OTTD2FS(), ParseFullConnectionString(), ParseInteger(), ParseResolution(), RequestNewGRFScan(), S8BPP_NONE, SAVE_DIR, GameSessionStats::savegame_size, SaveOrLoad(), ScheduleErrorMessage(), BlitterFactory::SelectBlitter(), DriverFactoryBase::SelectDriver(), SetDebugString(), FileToSaveLoad::SetMode(), BaseMedia< GraphicsSet >::SetSet(), BaseMedia< MusicSet >::SetSet(), BaseMedia< SoundsSet >::SetSet(), BaseMedia< SoundsSet >::SetSetByName(), BaseMedia< GraphicsSet >::SetSetByName(), BaseMedia< MusicSet >::SetSetByName(), BaseMedia< GraphicsSet >::SetSetByShortname(), ShowHelp(), ShutdownGame(), SL_OK, SLO_CHECK, SLO_LOAD, SM_EDITOR, SM_LOAD_GAME, SM_LOAD_HEIGHTMAP, SM_LOAD_SCENARIO, SM_MENU, SM_NEWGAME, SM_START_HEIGHTMAP, GameSessionStats::start_time, and UpdateGUIZoom().

## ◆ OSOpenBrowser()

void OSOpenBrowser | ( | const std::string & | url | ) |
| extern

Definition at line 230 of file unix.cpp.

## ◆ ParseResolution()

static void ParseResolution | ( | Dimension & | res,
|  | std::string_view | s
| ) |  |
| static

Extract the resolution from the given string and store it in the 'res' parameter.

Parameters

  res | variable to store the resolution in.
  s | the string to decompose.

Definition at line 274 of file openttd.cpp.

References StringConsumer::AnyBytesLeft(), StringConsumer::ReadIf(), and StringConsumer::TryReadIntegerBase().

Referenced by openttd_main().

## ◆ PostMainLoop()

void PostMainLoop | ( |  | ) |

Definition at line 452 of file openttd.cpp.

## ◆ RequestNewGRFScan()

bool RequestNewGRFScan | ( | NewGRFScanCallback * | callback | ) |

Request a new NewGRF scan.

This will be executed on the next game-tick. This is mostly needed to ensure NewGRF scans (which are blocking) are done in the game-thread, and not in the draw-thread (which most often triggers this request).

Parameters

  callback | Optional callback to call when NewGRF scan is completed.

Returns
  True when the NewGRF scan was actually requested, false when the scan was already running.

Definition at line 1327 of file openttd.cpp.

Referenced by NetworkContentDownloadStatusWindow::Close(), NewGRFWindow::OnClick(), and openttd_main().

## ◆ SafeLoad()

bool SafeLoad | ( | const std::string & | filename,
|  | SaveLoadOperation | fop,
|  | DetailedFileType | dft,
|  | GameMode | newgm,
|  | Subdirectory | subdir,
|  | std::shared_ptr< LoadFilter > | lf = `nullptr`
| ) |  |

Load the specified savegame but on error do different things.

If loading fails due to corrupt savegame, bad version, etc. go back to a previous correct state. In the menu for example load the intro game again.

Parameters

  filename | file to be loaded
  fop | mode of loading, always SLO_LOAD
  newgm | switch to this mode of loading fails due to some unknown error
  subdir | default directory to look for filename, set to 0 if not needed
  lf | Load filter to use, if nullptr: use filename + subdir.

Definition at line 941 of file openttd.cpp.

References _network_dedicated, _network_server, Debug, DFT_GAME_FILE, DFT_OLD_GAME_FILE, LoadIntroGame(), LoadWithFilter(), NetworkDisconnect(), SaveOrLoad(), SL_OK, SL_REINIT, and SLO_LOAD.

## ◆ ShowHelp()

static void ShowHelp | ( |  | ) |
| static

Show the help message when someone passed a wrong parameter.

Definition at line 154 of file openttd.cpp.

References DumpDebugFacilityNames(), BlitterFactory::GetBlittersInfo(), AI::GetConsoleList(), Game::GetConsoleList(), DriverFactoryBase::GetDriversInfo(), BaseMedia< MusicSet >::GetSetsList(), BaseMedia< SoundsSet >::GetSetsList(), BaseMedia< GraphicsSet >::GetSetsList(), AI::Initialize(), Game::Initialize(), AI::Uninitialize(), and Game::Uninitialize().

Referenced by openttd_main().

## ◆ ShowOSErrorBox()

void ShowOSErrorBox | ( | std::string_view | buf,
|  | bool | system
| ) |  |
| extern

Definition at line 193 of file unix.cpp.

## ◆ ShutdownGame()

static void ShutdownGame | ( |  | ) |
| static

Uninitializes drivers, frees allocated memory, cleans pools, ... Generally, prepares the game for shutting down.

Definition at line 294 of file openttd.cpp.

References _gamelog, _network_available, PoolBase::Clean(), LinkGraphSchedule::Clear(), NetworkShutDown(), Gamelog::Reset(), ResetNewGRFData(), SocialIntegration::Shutdown(), DriverFactoryBase::ShutdownDrivers(), AI::Uninitialize(), Game::Uninitialize(), FontCache::UninitializeFontCaches(), and UnInitWindowSystem().

Referenced by openttd_main().

## ◆ StateGameLoop()

void StateGameLoop | ( |  | ) |

State controlling game loop.

The state must not be changed from anywhere but here. That check is enforced in DoCommand.

Definition at line 1210 of file openttd.cpp.

References _current_company, _network_server, _networking, _pause_mode, _settings_game, AnimateAnimatedTiles(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Any(), AUTOSAVE_DIR, CallWindowGameTickEvent(), CheckCaches(), TimerGameEconomy::date, TimerGameEconomy::date_fract, DFT_GAME_FILE, TimerManager< TTimerType >::Elapsed(), GameSettings::game_creation, AI::GameLoop(), Game::GameLoop(), GameCreationSettings::generation_seed, HasModalProgress(), IsLocalCompany(), OWNER_NONE, PerformanceMeasurer::Paused(), PFE_ALLSCRIPTS, PFE_GAMELOOP, PFE_GL_AIRCRAFT, PFE_GL_ECONOMY, PFE_GL_LANDSCAPE, PFE_GL_ROADVEHS, PFE_GL_SHIPS, PFE_GL_TRAINS, PSM_ENTER_GAMELOOP, PSM_LEAVE_GAMELOOP, PerformanceAccumulator::Reset(), Backup< T >::Restore(), RunTileLoop(), RunVehicleCalendarDayProc(), SaveOrLoad(), SLO_SAVE, StateGameLoop_LinkGraphPauseControl(), BasePersistentStorageArray::SwitchMode(), and UpdateLandscapingLimits().

Referenced by ClientNetworkGameSocketHandler::GameLoop().

## ◆ SwitchToMode()

void SwitchToMode | ( | SwitchMode | new_mode | ) |

Definition at line 1018 of file openttd.cpp.

## ◆ UpdateSocialIntegration()

static void UpdateSocialIntegration | ( | GameMode | game_mode | ) |
| static

Definition at line 996 of file openttd.cpp.

## ◆ UserErrorI()

void UserErrorI | ( | const std::string & | str | ) |

Error handling for fatal user errors.

Parameters

  str | the string to print.

Note
  Does NEVER return.

Definition at line 119 of file openttd.cpp.

References VideoDriver::GetInstance(), and Driver::Stop().

## ◆ WriteSavegameInfo()

static void WriteSavegameInfo | ( | const std::string & | name | ) |
| static

Definition at line 230 of file openttd.cpp.

## Variable Documentation

## ◆ _autosave_interval

IntervalTimer< TimerGameRealtime > _autosave_interval({std::chrono::milliseconds::zero(), TimerGameRealtime::AUTOSAVE},[](auto) { _pause_mode.Reset(PauseMode::CommandDuringPause);_do_autosave=true;SetWindowDirty(WC_STATUS_BAR, 0);static FiosNumberedSaveName _autosave_ctr("autosave");DoAutoOrNetsave(_autosave_ctr);_do_autosave=false;SetWindowDirty(WC_STATUS_BAR, 0);}) | ( | {std::chrono::milliseconds::zero(), TimerGameRealtime::AUTOSAVE} | ,
|  | [] (auto) { _pause_mode.Reset(PauseMode::CommandDuringPause);_do_autosave=true;SetWindowDirty(WC_STATUS_BAR, 0);static FiosNumberedSaveName _autosave_ctr("autosave");DoAutoOrNetsave(_autosave_ctr);_do_autosave=false;SetWindowDirty(WC_STATUS_BAR, 0);} |
| ) |  |
| static

Interval for regular autosaves.

Initialized at zero to disable till settings are loaded.

Referenced by ChangeAutosaveFrequency().

## ◆ _config_file

std::string _config_file
| extern

Configuration file of OpenTTD.

Definition at line 64 of file settings.cpp.

Referenced by openttd_main().

## ◆ _request_newgrf_scan

bool _request_newgrf_scan = false

Definition at line 111 of file openttd.cpp.

## ◆ _request_newgrf_scan_callback

NewGRFScanCallback* _request_newgrf_scan_callback = nullptr

Definition at line 112 of file openttd.cpp.

## ◆ _save_config

bool _save_config = false

Definition at line 110 of file openttd.cpp.