OpenTTD Source: src/saveload/saveload_internal.h Source File

OpenTTD Source 15.0-RC2

saveload_internal.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef SAVELOAD_INTERNAL_H
11#define SAVELOAD_INTERNAL_H
12
13#include "../company_manager_face.h"
14#include "../order_base.h"
15#include "../engine_type.h"
16#include "saveload.h"
17
18void InitializeOldNames();
19 StringID RemapOldStringID(StringID s);
20std::string CopyFromOldName(StringID id);
21void ResetOldNames();
22
23void ResetOldWaypoints();
24void MoveBuoysToWaypoints();
25void MoveWaypointsToBaseStations();
26
27void AfterLoadVehiclesPhase1(bool part_of_load);
28void AfterLoadVehiclesPhase2(bool part_of_load);
29void FixupTrainLengths();
30void AfterLoadStations();
31void AfterLoadRoadStops();
32void AfterLoadLabelMaps();
33void AfterLoadStoryBook();
34void AfterLoadLinkGraphs();
35void AfterLoadCompanyStats();
36void UpdateHousesAndTowns();
37
38void UpdateOldAircraft();
39
40void SaveViewportBeforeSaveGame();
41void ResetViewportAfterLoadGame();
42
43void ConvertOldMultiheadToNew();
44void ConnectMultiheadedTrains();
45
46void ResetTempEngineData();
47 Engine *GetTempDataEngine(EngineID index);
48void CopyTempEngineData();
49
50extern int32_t _saved_scrollpos_x;
51extern int32_t _saved_scrollpos_y;
52extern ZoomLevel _saved_scrollpos_zoom;
53
54extern SavegameType _savegame_type;
55extern uint32_t _ttdp_version;
56
57 CompanyManagerFace ConvertFromOldCompanyManagerFace(uint32_t face);
58
59 Order UnpackOldOrder(uint16_t packed);
60
61#endif /* SAVELOAD_INTERNAL_H */
Engine
Definition engine_base.h:38
saveload.h
Functions/types related to saving and loading games.
SavegameType
SavegameType
Types of save games.
Definition saveload.h:438
_ttdp_version
uint32_t _ttdp_version
version of TTDP savegame (if applicable)
Definition saveload.cpp:80
AfterLoadVehiclesPhase1
void AfterLoadVehiclesPhase1(bool part_of_load)
Called after load for phase 1 of vehicle initialisation.
Definition vehicle_sl.cpp:256
UnpackOldOrder
Order UnpackOldOrder(uint16_t packed)
Unpacks a order from savegames made with TTD(Patch)
Definition order_sl.cpp:95
ResetOldNames
void ResetOldNames()
Free the memory of the old names array.
Definition strings_sl.cpp:100
FixupTrainLengths
void FixupTrainLengths()
Fixup old train spacing.
Definition vehicle_sl.cpp:554
MoveBuoysToWaypoints
void MoveBuoysToWaypoints()
Perform all steps to upgrade from the old station buoys to the new version that uses waypoints.
Definition station_sl.cpp:45
RemapOldStringID
StringID RemapOldStringID(StringID s)
Remap a string ID from the old format to the new format.
Definition strings_sl.cpp:28
UpdateOldAircraft
void UpdateOldAircraft()
need to be called to load aircraft from old version
Definition vehicle_sl.cpp:165
ConvertOldMultiheadToNew
void ConvertOldMultiheadToNew()
Converts all trains to the new subtype format introduced in savegame 16.2 It also links multiheaded e...
Definition vehicle_sl.cpp:113
ConnectMultiheadedTrains
void ConnectMultiheadedTrains()
Link front and rear multiheaded engines to each other This is done when loading a savegame.
Definition vehicle_sl.cpp:35
AfterLoadLinkGraphs
void AfterLoadLinkGraphs()
Spawn the threads for running link graph calculations.
Definition linkgraph_sl.cpp:232
AfterLoadRoadStops
void AfterLoadRoadStops()
(Re)building of road stop caches after loading a savegame.
Definition station_sl.cpp:144
_savegame_type
SavegameType _savegame_type
type of savegame we are loading
Definition saveload.cpp:77
AfterLoadCompanyStats
void AfterLoadCompanyStats()
Rebuilding of company statistics after loading a savegame.
Definition company_sl.cpp:126
ConvertFromOldCompanyManagerFace
CompanyManagerFace ConvertFromOldCompanyManagerFace(uint32_t face)
Converts an old company manager's face format to the new company manager's face format.
Definition company_sl.cpp:59
MoveWaypointsToBaseStations
void MoveWaypointsToBaseStations()
Perform all steps to upgrade from the old waypoints to the new version that uses station.
Definition waypoint_sl.cpp:68
AfterLoadVehiclesPhase2
void AfterLoadVehiclesPhase2(bool part_of_load)
Called after load for phase 2 of vehicle initialisation.
Definition vehicle_sl.cpp:420
UpdateHousesAndTowns
void UpdateHousesAndTowns()
Check and update town and house values.
Definition town_sl.cpp:65
InitializeOldNames
void InitializeOldNames()
Initialize the old names table memory.
Definition strings_sl.cpp:108
CopyFromOldName
std::string CopyFromOldName(StringID id)
Copy and convert old custom names to UTF-8.
Definition strings_sl.cpp:59
AfterLoadStoryBook
void AfterLoadStoryBook()
Called after load to trash broken pages.
Definition story_sl.cpp:20
CopyTempEngineData
void CopyTempEngineData()
Copy data from temporary engine array into the real engine pool.
Definition engine_sl.cpp:96
AfterLoadLabelMaps
void AfterLoadLabelMaps()
Perform rail type and road type conversion if necessary.
Definition labelmaps_sl.cpp:27
StringID
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Definition strings_type.h:19
CompanyManagerFace
Definition company_type.h:53
Order
Definition order_base.h:33
PoolID< uint16_t, struct EngineIDTag, 64000, 0xFFFF >
ZoomLevel
ZoomLevel
All zoom levels we know.
Definition zoom_type.h:20