64 extern std::atomic<bool> _exit_game;
65 extern bool _save_config;
88 void AskExitToGameMenu();
92 void HandleExitGameRequest();
99 void OpenBrowser(
const std::string &url);
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Type (helpers) for enums.
PauseMode _pause_mode
The current pause mode.
int openttd_main(std::span< char *const > arguments)
Main entry point for this lovely game.
SwitchMode
Mode which defines what mode we're switching to.
@ SM_START_HEIGHTMAP
Load a heightmap and start a new game from it.
@ SM_RESTART_HEIGHTMAP
Load a heightmap and start a new game from it with current settings.
@ SM_LOAD_SCENARIO
Load scenario from scenario editor.
@ SM_GENRANDLAND
Generate random land within scenario editor.
@ SM_JOIN_GAME
Join a network game.
@ SM_MENU
Switch to game intro menu.
@ SM_RESTARTGAME
Restart --> 'Random game' with current settings.
@ SM_RELOADGAME
Reload the savegame / scenario / heightmap you started the game with.
@ SM_SAVE_HEIGHTMAP
Save heightmap.
@ SM_LOAD_HEIGHTMAP
Load heightmap from scenario editor.
@ SM_LOAD_GAME
Load game, Play Scenario.
@ SM_EDITOR
Switch to scenario editor.
@ SM_NEWGAME
New Game --> 'Random game'.
void ChangeAutosaveFrequency(bool reset)
Reset the interval of the autosave.
GameSessionStats _game_session_stats
Statistics about the current session.
void StateGameLoop()
State controlling game loop.
void GenerateSavegameId()
Generate an unique savegame ID.
PauseMode
Modes of pausing we've got.
@ PM_COMMAND_DURING_PAUSE
A game paused, and a command executed during the pause; resets on autosave.
@ PM_UNPAUSED
A normal unpaused game.
@ PM_PAUSED_ACTIVE_CLIENTS
A game paused for 'min_active_clients'.
@ PM_PAUSED_ERROR
A game paused because a (critical) error.
@ PM_PAUSED_GAME_SCRIPT
A game paused by a game script.
@ PM_PAUSED_JOIN
A game paused for 'pause_on_join'.
@ PMB_PAUSED_NETWORK
Pause mode bits when paused for network reasons.
@ PM_PAUSED_LINK_GRAPH
A game paused due to the link graph schedule lagging.
@ PM_PAUSED_NORMAL
A game normally paused.
@ PM_PAUSED_SAVELOAD
A game paused for saving/loading.
bool RequestNewGRFScan(struct NewGRFScanCallback *callback=nullptr)
Request a new NewGRF scan.
GameMode
Mode which defines the state of the game.
SwitchMode _switch_mode
The next mainloop command.
DisplayOptions
Display Options.
@ DO_SHOW_TOWN_NAMES
Display town names.
@ DO_SHOW_COMPETITOR_SIGNS
Display signs, station names and waypoint names of opponent companies. Buoys and oilrig-stations are ...
@ DO_FULL_DETAIL
Also draw details of track and roads.
@ DO_SHOW_SIGNS
Display signs.
@ DO_SHOW_WAYPOINT_NAMES
Display waypoint names.
@ DO_SHOW_STATION_NAMES
Display station names.
@ DO_FULL_ANIMATION
Perform palette animation.
std::chrono::steady_clock::time_point start_time
Time when the current game was started.
std::string savegame_id
Unique ID of the savegame.
std::optional< size_t > savegame_size
Size of the last saved savegame in bytes, or std::nullopt if not saved yet.
Callback for NewGRF scanning.