67extern std::atomic<bool> _exit_game;
68extern bool _save_config;
87void AskExitToGameMenu();
91void HandleExitGameRequest();
98void 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.
bool LoadHeightmap(DetailedFileType dft, std::string_view filename)
Load a heightmap from file and change the map in its current dimensions to a landscape representing t...
DisplayOption
Display Options.
@ ShowSigns
Display signs.
@ FullDetail
Also draw details of track and roads.
@ ShowWaypointNames
Display waypoint names.
@ ShowTownNames
Display town names.
@ ShowStationNames
Display station names.
@ FullAnimation
Perform palette animation.
@ ShowCompetitorSigns
Display signs, station names and waypoint names of opponent companies. Buoys and oilrig-stations are ...
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'.
@ 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.
@ Editor
In the scenario editor.
@ Bootstrap
In the content bootstrap process.
bool RequestNewGRFScan(struct NewGRFScanCallback *callback=nullptr)
Request a new NewGRF scan.
SwitchMode
Mode which defines what mode we're switching to.
@ LoadGame
Load game, Play Scenario.
@ JoinGame
Join a network game.
@ LoadScenario
Load scenario from scenario editor.
@ StartHeightmap
Load a heightmap and start a new game from it.
@ NewGame
New Game --> 'Random game'.
@ GenerateRandomLand
Generate random land within scenario editor.
@ ReloadGame
Reload the savegame / scenario / heightmap you started the game with.
@ RestartHeightmap
Load a heightmap and start a new game from it with current settings.
@ SaveHeightmap
Save heightmap.
@ RestartGame
Restart --> 'Random game' with current settings.
EnumBitSet< DisplayOption, uint8_t > DisplayOptions
Bitset of DisplayOption elements.
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.