18#include "../newgrf_railtype.h"
19#include "../newgrf_roadtype.h"
21#include "../safeguards.h"
23extern std::vector<LabelObject<RailTypeLabel>> _railtype_list;
24extern std::vector<LabelObject<RoadTypeLabel>> _roadtype_list;
39 static inline const SaveLoad description[] = {
66 _railtype_list.push_back(lo);
74 static inline const SaveLoad description[] = {
87 lo.
subtype = GetRoadTramType(r);
104 _roadtype_list.push_back(lo);
117extern const ChunkHandlerTable _labelmaps_chunk_handlers(labelmaps_chunk_handlers);
RailTypeLabel label
Unique 32 bit rail type identifier.
RoadTypeLabel label
Unique 32 bit road type identifier.
void AfterLoadLabelMaps()
Perform rail type and road type conversion if necessary.
Loading of labelmaps chunks before table headers were added.
const SaveLoadCompat _label_object_sl_compat[]
Original field order for _label_object_desc.
void ConvertRailTypes()
Test if any saved rail type labels are different to the currently loaded rail types.
void SetCurrentRailTypeLabelList()
Populate railtype label list with current values.
void SetCurrentRoadTypeLabelList()
Populate road type label list with current values.
void ConvertRoadTypes()
Test if any saved road type labels are different to the currently loaded road types.
const RailTypeInfo * GetRailTypeInfo(RailType railtype)
Returns a pointer to the Railtype information for a given railtype.
RailType
Enumeration for all possible railtypes.
@ RAILTYPE_BEGIN
Used for iterations.
@ RAILTYPE_END
Used for iterations.
const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
RoadType
The different roadtypes we support.
@ ROADTYPE_END
Used for iterations.
@ ROADTYPE_BEGIN
Used for iterations.
std::vector< SaveLoad > SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct)
Load a table header in a savegame compatible way.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
Functions/types related to saving and loading games.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Declaration of functions used in more save/load files.
Handlers and description of chunk.
Container for a label for rail or road type conversion.
uint8_t subtype
Subtype of type (road or tram).
T label
Label of rail or road type.
void Load() const override
Load the chunk.
void Save() const override
Save the chunk.
void Load() const override
Load the chunk.
void Save() const override
Save the chunk.