23extern std::vector<LabelObject<RailTypeLabel>> _railtype_list;
24extern std::vector<LabelObject<RoadTypeLabel>> _roadtype_list;
39 static inline const SaveLoad description[] = {
67 _railtype_list.push_back(lo);
75 static inline const SaveLoad description[] = {
106 _roadtype_list.push_back(lo);
119extern const ChunkHandlerTable _labelmaps_chunk_handlers(labelmaps_chunk_handlers);
Iterate a range of enum values.
RailTypeLabel label
Unique 32 bit rail type identifier.
RoadTypeLabel label
Unique 32 bit road type identifier.
constexpr std::underlying_type_t< enum_type > to_underlying(enum_type e)
Implementation of std::to_underlying (from C++23).
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.
NewGRF handling of rail types.
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.
NewGRF handling of 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_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.
A number of safeguards to prevent using unsafe methods.
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.
#define SLE_OBJECT_ADDRESS(base, variable)
Macro to be able to pass the variable type and construct the SaveLoad::AddressFunction given a base c...
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
bool IsSavegameVersionBefore(SaveLoadVersion major, uint8_t minor=0)
Checks whether the savegame is below major.
@ LabelOrientationUnification
Saveload version: 367, GitHub pull request: 15888 Unify the orientation in which labels are written.
@ Table
An Array with a header describing the elements.
Declaration of functions used in more save/load files.
Definition of base types and functions in a cross-platform compatible way.
ChunkHandler(ChunkId id, ChunkType type)
Create this ChunkHandler.
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.
static SaveLoad Variable(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion, size_t extra=0)
Storage of a variable in some savegame versions.