64extern std::atomic<bool> _exit_game;
65extern bool _save_config;
84void AskExitToGameMenu();
88void HandleExitGameRequest();
95void OpenBrowser(
const std::string &url);
A connected component of a link graph.
Type (helpers) for enums.
GameSessionStats _game_session_stats
Statistics about the current session.
PauseModes _pause_mode
The current pause mode.
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.
int openttd_main(std::span< std::string_view > arguments)
Main entry point for this lovely game.
void ChangeAutosaveFrequency(bool reset)
Reset the interval of the autosave.
void StateGameLoop()
State controlling game loop.
void GenerateSavegameId()
Generate an unique savegame ID.
PauseMode
Modes of pausing we've got.
@ Error
A game paused because a (critical) error.
@ GameScript
A game paused by a game script.
@ ActiveClients
A game paused for 'min_active_clients'.
@ Normal
A game normally paused.
@ Join
A game paused for 'pause_on_join'.
@ CommandDuringPause
A game paused, and a command executed during the pause; resets on autosave.
GameMode
Mode which defines the state of the game.
bool RequestNewGRFScan(struct NewGRFScanCallback *callback=nullptr)
Request a new NewGRF scan.
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'.
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.