OpenTTD Source 20261112-master-gbcbec5e63f
misc.cpp File Reference

Misc functions that shouldn't be here. More...

#include "stdafx.h"
#include "landscape.h"
#include "news_func.h"
#include "ai/ai.hpp"
#include "script/script_gui.h"
#include "newgrf.h"
#include "economy_func.h"
#include "timer/timer_game_calendar.h"
#include "timer/timer_game_economy.h"
#include "timer/timer_game_tick.h"
#include "texteff.hpp"
#include "gfx_func.h"
#include "gamelog.h"
#include "animated_tile_func.h"
#include "tilehighlight_func.h"
#include "network/network_func.h"
#include "window_func.h"
#include "core/pool_type.hpp"
#include "game/game.hpp"
#include "linkgraph/linkgraphschedule.h"
#include "town.h"
#include "viewport_kdtree.h"
#include "newgrf_profiling.h"
#include "3rdparty/monocypher/monocypher.h"
#include "safeguards.h"

Go to the source code of this file.

Functions

void MakeNewgameSettingsLive ()
void InitializeSound ()
void InitializeMusic ()
 Prepare the music system for use.
void InitializeVehicles ()
void InitializeRailGui ()
 Initialize rail building GUI settings.
void InitializeRoadGui ()
void InitializeAirportGui ()
void InitializeDockGui ()
void InitializeGraphGui ()
void InitializeObjectGui ()
 Reset all data of the object GUI.
void InitializeTownGui ()
void InitializeIndustries ()
void InitializeObjects ()
 Initialize/reset the objects.
void InitializeTrees ()
void InitializeCompanies ()
 Initialize the pool of companies.
void InitializeCheats ()
 Reinitialise all the cheats.
void InitializeOldNames ()
 Initialize the old names table memory.
std::string GenerateUid (std::string_view subject)
 Generate an unique ID.
void GenerateSavegameId ()
 Generate an unique savegame ID.
void InitializeGame (uint size_x, uint size_y, bool reset_date, bool reset_settings)

Variables

TileIndex _cur_tileloop_tile

Detailed Description

Misc functions that shouldn't be here.

Definition in file misc.cpp.

Function Documentation

◆ GenerateSavegameId()

void GenerateSavegameId ( )

Generate an unique savegame ID.

Definition at line 87 of file misc.cpp.

References _game_session_stats, and GenerateUid().

Referenced by AfterLoadGame().

◆ GenerateUid()

std::string GenerateUid ( std::string_view subject)

Generate an unique ID.

It isn't as much of an unique ID but more a hashed digest of a random string and a time. It is very likely to be unique, but it does not follow any UUID standard.

Parameters
subjectWhat to create the ID for.
Returns
The generated ID.

Definition at line 66 of file misc.cpp.

References FormatArrayAsHex(), and RandomBytesWithFallback().

Referenced by GenerateSavegameId().

◆ InitializeAirportGui()

void InitializeAirportGui ( )

Definition at line 641 of file airport_gui.cpp.

◆ InitializeCheats()

void InitializeCheats ( )

Reinitialise all the cheats.

Definition at line 19 of file cheat.cpp.

References _cheats.

◆ InitializeCompanies()

void InitializeCompanies ( )

Initialize the pool of companies.

Definition at line 712 of file company_cmd.cpp.

References _cur_company_tick_index.

◆ InitializeDockGui()

void InitializeDockGui ( )

Definition at line 617 of file dock_gui.cpp.

◆ InitializeGame()

void InitializeGame ( uint size_x,
uint size_y,
bool reset_date,
bool reset_settings )

Definition at line 92 of file misc.cpp.

◆ InitializeGraphGui()

void InitializeGraphGui ( )

Definition at line 2134 of file graph_gui.cpp.

◆ InitializeIndustries()

void InitializeIndustries ( )

Definition at line 3158 of file industry_cmd.cpp.

◆ InitializeMusic()

void InitializeMusic ( )

Prepare the music system for use.

Called from InitializeGame

Definition at line 467 of file music_gui.cpp.

References _music.

◆ InitializeObjectGui()

void InitializeObjectGui ( )

Reset all data of the object GUI.

Definition at line 433 of file object_gui.cpp.

References _object_gui.

◆ InitializeObjects()

void InitializeObjects ( )

Initialize/reset the objects.

Definition at line 76 of file object_cmd.cpp.

References Object::ResetTypeCounts().

◆ InitializeOldNames()

void InitializeOldNames ( )

Initialize the old names table memory.

Definition at line 109 of file strings_sl.cpp.

References _old_name_array, and NUM_OLD_STRINGS.

◆ InitializeRailGui()

void InitializeRailGui ( )

Initialize rail building GUI settings.

Definition at line 1981 of file rail_gui.cpp.

References _build_depot_direction, _station_gui, _waypoint_gui, NW, STAT_CLASS_DFLT, and STAT_CLASS_WAYP.

◆ InitializeRoadGui()

void InitializeRoadGui ( )

Definition at line 1845 of file road_gui.cpp.

◆ InitializeSound()

void InitializeSound ( )

Definition at line 90 of file sound.cpp.

◆ InitializeTownGui()

void InitializeTownGui ( )

Definition at line 1363 of file town_gui.cpp.

◆ InitializeTrees()

void InitializeTrees ( )

Definition at line 1027 of file tree_cmd.cpp.

◆ InitializeVehicles()

void InitializeVehicles ( )

Definition at line 700 of file vehicle.cpp.

◆ MakeNewgameSettingsLive()

void MakeNewgameSettingsLive ( )
extern

Definition at line 338 of file openttd.cpp.

Variable Documentation

◆ _cur_tileloop_tile

TileIndex _cur_tileloop_tile
extern

Definition at line 800 of file landscape.cpp.