OpenTTD Source 20241224-master-gf74b0cf984
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 "newgrf_house.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 "station_kdtree.h"
#include "town_kdtree.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, GenerateUid(), and GameSessionStats::savegame_id.

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.

Definition at line 66 of file misc.cpp.

References FormatArrayAsHex(), and RandomBytesWithFallback().

Referenced by GenerateSavegameId().

◆ InitializeAirportGui()

void InitializeAirportGui ( )

Definition at line 632 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 666 of file company_cmd.cpp.

References _cur_company_tick_index.

◆ InitializeDockGui()

void InitializeDockGui ( )

Definition at line 610 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 1850 of file graph_gui.cpp.

◆ InitializeIndustries()

void InitializeIndustries ( )

Definition at line 3076 of file industry_cmd.cpp.

◆ InitializeMusic()

void InitializeMusic ( )

Prepare the music system for use.

Called from InitializeGame

Definition at line 473 of file music_gui.cpp.

References MusicSystem::BuildPlaylists().

◆ InitializeObjectGui()

void InitializeObjectGui ( )

Reset all data of the object GUI.

Definition at line 419 of file object_gui.cpp.

References _object_gui, OBJECT_CLASS_BEGIN, and ObjectPickerSelection::sel_class.

◆ InitializeObjects()

void InitializeObjects ( )

Initialize/reset the objects.

Definition at line 73 of file object_cmd.cpp.

References Object::ResetTypeCounts().

◆ InitializeOldNames()

void InitializeOldNames ( )

Initialize the old names table memory.

Definition at line 111 of file strings_sl.cpp.

References _old_name_array, free(), LEN_OLD_STRINGS, and NUM_OLD_STRINGS.

◆ InitializeRailGui()

◆ InitializeRoadGui()

void InitializeRoadGui ( )

Definition at line 1711 of file road_gui.cpp.

◆ InitializeSound()

void InitializeSound ( )

Definition at line 92 of file sound.cpp.

◆ InitializeTownGui()

void InitializeTownGui ( )

Definition at line 1354 of file town_gui.cpp.

◆ InitializeTrees()

void InitializeTrees ( )

Definition at line 878 of file tree_cmd.cpp.

◆ InitializeVehicles()

void InitializeVehicles ( )

Definition at line 697 of file vehicle.cpp.

◆ MakeNewgameSettingsLive()

void MakeNewgameSettingsLive ( )
extern

Definition at line 342 of file openttd.cpp.

Variable Documentation

◆ _cur_tileloop_tile

TileIndex _cur_tileloop_tile
extern

Definition at line 764 of file landscape.cpp.