|
OpenTTD Source 20260721-master-g25ec12c62d
|
Functions/types related to saving and loading games. More...
#include "saveload_type.h"#include "saveload_error.hpp"#include "saveload_func.h"#include "../core/label_type.hpp"#include "../fileio_type.h"#include "../fios.h"Go to the source code of this file.
Data Structures | |
| struct | ChunkHandler |
| Handlers and description of chunk. More... | |
| class | SaveLoadHandler |
| Handler for saving/loading an object to/from disk. More... | |
| class | DefaultSaveLoadHandler< TImpl, TObject > |
| Default handler for saving/loading an object to/from disk. More... | |
| struct | VarType |
| Container of a variable's characteristics about a variable's storage. More... | |
| struct | VarTypes |
Container for holding some default VarType instances. More... | |
| struct | SaveLoad |
| SaveLoad type struct. More... | |
| struct | SaveLoadCompat |
| SaveLoad information for backwards compatibility. More... | |
| class | VectorSaveLoadHandler< TImpl, TObject, TElementType, MAX_LENGTH > |
| Default handler for saving/loading a vector to/from disk. More... | |
Macros | |
| #define | SLE_GENERAL_NAME(cmd, name, base, variable, type, length, from, to, extra) |
| Storage of simple variables, references (pointers), and arrays. | |
| #define | SLE_GENERAL(cmd, base, variable, type, length, from, to, extra) |
| Storage of simple variables, references (pointers), and arrays with a custom name. | |
| #define | SLE_CONDVAR(base, variable, type, from, to) |
| Storage of a variable in some savegame versions. | |
| #define | SLE_CONDVARNAME(base, variable, name, type, from, to) |
| Storage of a variable in some savegame versions. | |
| #define | SLE_CONDREF(base, variable, type, from, to) |
| Storage of a reference in some savegame versions. | |
| #define | SLE_CONDARR(base, variable, type, length, from, to) |
| Storage of a fixed-size array of SaveLoadType::Variable elements in some savegame versions. | |
| #define | SLE_CONDARRNAME(base, variable, name, type, length, from, to) |
| Storage of a fixed-size array of SaveLoadType::Variable elements in some savegame versions. | |
| #define | SLE_CONDSSTR(base, variable, type, from, to) |
Storage of a std::string in some savegame versions. | |
| #define | SLE_CONDSSTRNAME(base, variable, name, type, from, to) |
Storage of a std::string in some savegame versions. | |
| #define | SLE_CONDREFLIST(base, variable, type, from, to) |
| Storage of a list of SaveLoadType::Reference elements in some savegame versions. | |
| #define | SLE_CONDREFVECTOR(base, variable, type, from, to) |
| Storage of a vector of SaveLoadType::Reference elements in some savegame versions. | |
| #define | SLE_CONDVECTOR(base, variable, type, from, to) |
| Storage of a vector of SaveLoadType::Variable elements in some savegame versions. | |
| #define | SLE_CONDVECTOR(base, variable, type, from, to) |
| Storage of a vector of SaveLoadType::Variable elements in some savegame versions. | |
| #define | SLE_VAR(base, variable, type) |
| Storage of a variable in every version of a savegame. | |
| #define | SLE_VARNAME(base, variable, name, type) |
| Storage of a variable in every version of a savegame. | |
| #define | SLE_REF(base, variable, type) |
| Storage of a reference in every version of a savegame. | |
| #define | SLE_ARR(base, variable, type, length) |
| Storage of fixed-size array of SaveLoadType::Variable elements in every version of a savegame. | |
| #define | SLE_ARRNAME(base, variable, name, type, length) |
| Storage of fixed-size array of SaveLoadType::Variable elements in every version of a savegame. | |
| #define | SLE_SSTR(base, variable, type) |
Storage of a std::string in every savegame version. | |
| #define | SLE_SSTRNAME(base, variable, name, type) |
Storage of a std::string in every savegame version. | |
| #define | SLE_REFLIST(base, variable, type) |
| Storage of a list of SaveLoadType::Reference elements in every savegame version. | |
| #define | SLE_REFVECTOR(base, variable, type) |
| Storage of a vector of SaveLoadType::Reference elements in every savegame version. | |
| #define | SLE_SAVEBYTE(base, variable) |
| Only write byte during saving; never read it during loading. | |
| #define | SLEG_GENERAL(name, cmd, variable, type, length, from, to, extra) |
| Storage of global simple variables, references (pointers), and arrays. | |
| #define | SLEG_CONDVAR(name, variable, type, from, to) |
| Storage of a global variable in some savegame versions. | |
| #define | SLEG_CONDREF(name, variable, type, from, to) |
| Storage of a global reference in some savegame versions. | |
| #define | SLEG_CONDARR(name, variable, type, length, from, to) |
| Storage of a global fixed-size array of SaveLoadType::Variable elements in some savegame versions. | |
| #define | SLEG_CONDSSTR(name, variable, type, from, to) |
Storage of a global std::string in some savegame versions. | |
| #define | SLEG_CONDSTRUCT(name, handler, from, to) |
| Storage of a structs in some savegame versions. | |
| #define | SLEG_CONDREFLIST(name, variable, type, from, to) |
| Storage of a global reference list in some savegame versions. | |
| #define | SLEG_CONDVECTOR(name, variable, type, from, to) |
| Storage of a global vector of SaveLoadType::Variable elements in some savegame versions. | |
| #define | SLEG_CONDSTRUCTLIST(name, handler, from, to) |
| Storage of a list of structs in some savegame versions. | |
| #define | SLEG_VAR(name, variable, type) |
| Storage of a global variable in every savegame version. | |
| #define | SLEG_REF(name, variable, type) |
| Storage of a global reference in every savegame version. | |
| #define | SLEG_ARR(name, variable, type, length) |
| Storage of a global fixed-size array of SaveLoadType::Variable elements in every savegame version. | |
| #define | SLEG_SSTR(name, variable, type) |
Storage of a global std::string in every savegame version. | |
| #define | SLEG_STRUCT(name, handler) |
| Storage of a structs in every savegame version. | |
| #define | SLEG_REFLIST(name, variable, type) |
| Storage of a global reference list in every savegame version. | |
| #define | SLEG_VECTOR(name, variable, type) |
| Storage of a global vector of SaveLoadType::Variable elements in every savegame version. | |
| #define | SLEG_STRUCTLIST(name, handler) |
| Storage of a list of structs in every savegame version. | |
| #define | SLC_VAR(name) |
| Field name where the real SaveLoad can be located. | |
| #define | SLC_NULL(length, from, to) |
| Empty space in every savegame version. | |
Typedefs | |
| typedef void | AutolengthProc(int) |
| using | ChunkId = Label<struct ChunkIdTag> |
| Label/unique identifier for each of the chunks in the savegame. | |
| using | ChunkHandlerRef = std::reference_wrapper<const ChunkHandler> |
| A reference to ChunkHandler. | |
| using | ChunkHandlerTable = std::span<const ChunkHandlerRef> |
| A table of ChunkHandler entries. | |
| using | SaveLoadCompatTable = std::span<const struct SaveLoadCompat> |
| A table of SaveLoadCompat entries. | |
| typedef void * | SaveLoadAddrProc(void *base, size_t extra) |
Functions | |
| void | SetSaveLoadError (StringID str) |
| Set the error message from outside of the actual loading/saving of the game (AfterLoadGame and friends). | |
| constexpr VarType | operator| (VarFileType file, VarMemType mem) |
| Transitional helper function to combine a file and memory storage configuration. | |
| constexpr size_t | SlVarSize (VarMemType type) |
| Return expect size in bytes of a VarType. | |
| constexpr bool | SlCheckVarSize (SaveLoadType cmd, VarType type, size_t length, size_t size) |
| Check if a saveload cmd/type/length entry matches the size of the variable. | |
| bool | IsSavegameVersionBefore (SaveLoadVersion major, uint8_t minor=0) |
| Checks whether the savegame is below major. | |
| bool | IsSavegameVersionBeforeOrAt (SaveLoadVersion major) |
| Checks whether the savegame is below or at major. | |
| bool | SlIsObjectCurrentlyValid (SaveLoadVersion version_from, SaveLoadVersion version_to) |
| Checks if some version from/to combination falls within the range of the active savegame version. | |
| void * | GetVariableAddress (const void *object, const SaveLoad &sld) |
| Get the address of the variable. | |
| int64_t | ReadValue (const void *ptr, VarMemType conv) |
| Return a signed-long version of the value of a setting. | |
| void | WriteValue (void *ptr, VarMemType conv, int64_t val) |
| Write the value of a setting. | |
| void | SlSetArrayIndex (uint index) |
| static void | SlSetArrayIndex (const ConvertibleThroughBase auto &index) |
| int | SlIterateArray () |
| Iterate through the elements of an array and read the whole thing. | |
| void | SlSetStructListLength (size_t length) |
| Set the length of this list. | |
| size_t | SlGetStructListLength (size_t limit) |
| Get the length of this list; if it exceeds the limit, error out. | |
| void | SlAutolength (AutolengthProc *proc, int arg) |
| Do something of which I have no idea what it is :P. | |
| size_t | SlGetFieldLength () |
| Get the length of the current object. | |
| void | SlSetLength (size_t length) |
| Sets the length of either a RIFF object or the number of items in an array. | |
| size_t | SlCalcObjMemberLength (const void *object, const SaveLoad &sld) |
| size_t | SlCalcObjLength (const void *object, const SaveLoadTable &slt) |
| Calculate the size of an object. | |
| uint8_t | SlReadByte () |
| Wrapper for reading a byte from the buffer. | |
| void | SlReadString (std::string &str, size_t length) |
| Read the given amount of bytes from the buffer into the string. | |
| void | SlWriteByte (uint8_t b) |
| Wrapper for writing a byte to the dumper. | |
| void | SlGlobList (const SaveLoadTable &slt) |
| Save or Load (a list of) global variables. | |
| void | SlCopy (void *object, size_t length, VarType conv) |
| Copy a list of SaveLoadType::Variables to/from a savegame. | |
| std::vector< SaveLoad > | SlTableHeader (const SaveLoadTable &slt) |
| Save or Load a table header. | |
| std::vector< SaveLoad > | SlCompatTableHeader (const SaveLoadTable &slt, const SaveLoadCompatTable &slct) |
| Load a table header in a savegame compatible way. | |
| void | SlObject (void *object, const SaveLoadTable &slt) |
| Main SaveLoad function. | |
| void | SlSkipBytes (size_t length) |
| Read in bytes from the file/data structure but don't do anything with them, discarding them in effect. | |
Functions/types related to saving and loading games.
Definition in file saveload.h.
| #define SLC_NULL | ( | length, | |
| from, | |||
| to ) |
Empty space in every savegame version.
| length | Length of the empty space in bytes. |
| from | First savegame version that has the empty space. |
| to | Last savegame version that has the empty space. |
Definition at line 1250 of file saveload.h.
| #define SLC_VAR | ( | name | ) |
Field name where the real SaveLoad can be located.
| name | The name of the field. |
Definition at line 1242 of file saveload.h.
| #define SLE_ARR | ( | base, | |
| variable, | |||
| type, | |||
| length ) |
Storage of fixed-size array of SaveLoadType::Variable elements in every version of a savegame.
| base | Name of the class or struct containing the array. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
| length | Number of elements in the array. |
Definition at line 1023 of file saveload.h.
| #define SLE_ARRNAME | ( | base, | |
| variable, | |||
| name, | |||
| type, | |||
| length ) |
Storage of fixed-size array of SaveLoadType::Variable elements in every version of a savegame.
| base | Name of the class or struct containing the array. |
| variable | Name of the variable in the class or struct referenced by base. |
| name | Field name for table chunks. |
| type | Storage of the data in memory and in the savegame. |
| length | Number of elements in the array. |
Definition at line 1033 of file saveload.h.
| #define SLE_CONDARR | ( | base, | |
| variable, | |||
| type, | |||
| length, | |||
| from, | |||
| to ) |
Storage of a fixed-size array of SaveLoadType::Variable elements in some savegame versions.
| base | Name of the class or struct containing the array. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
| length | Number of elements in the array. |
| from | First savegame version that has the array. |
| to | Last savegame version that has the array. |
Definition at line 916 of file saveload.h.
| #define SLE_CONDARRNAME | ( | base, | |
| variable, | |||
| name, | |||
| type, | |||
| length, | |||
| from, | |||
| to ) |
Storage of a fixed-size array of SaveLoadType::Variable elements in some savegame versions.
| base | Name of the class or struct containing the array. |
| variable | Name of the variable in the class or struct referenced by base. |
| name | Field name for table chunks. |
| type | Storage of the data in memory and in the savegame. |
| length | Number of elements in the array. |
| from | First savegame version that has the array. |
| to | Last savegame version that has the array. |
Definition at line 928 of file saveload.h.
| #define SLE_CONDREF | ( | base, | |
| variable, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a reference in some savegame versions.
| base | Name of the class or struct containing the variable. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Type of the reference, a value from SLRefType. |
| from | First savegame version that has the field. |
| to | Last savegame version that has the field. |
Definition at line 905 of file saveload.h.
Referenced by OrderBackup::GetOrderBackupDescription.
| #define SLE_CONDREFLIST | ( | base, | |
| variable, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a list of SaveLoadType::Reference elements in some savegame versions.
| base | Name of the class or struct containing the list. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the list. |
| to | Last savegame version that has the list. |
Definition at line 959 of file saveload.h.
| #define SLE_CONDREFVECTOR | ( | base, | |
| variable, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a vector of SaveLoadType::Reference elements in some savegame versions.
| base | Name of the class or struct containing the vector. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the vector. |
| to | Last savegame version that has the vector. |
Definition at line 969 of file saveload.h.
| #define SLE_CONDSSTR | ( | base, | |
| variable, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a std::string in some savegame versions.
| base | Name of the class or struct containing the string. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the string. |
| to | Last savegame version that has the string. |
Definition at line 938 of file saveload.h.
| #define SLE_CONDSSTRNAME | ( | base, | |
| variable, | |||
| name, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a std::string in some savegame versions.
| base | Name of the class or struct containing the string. |
| variable | Name of the variable in the class or struct referenced by base. |
| name | Field name for table chunks. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the string. |
| to | Last savegame version that has the string. |
Definition at line 949 of file saveload.h.
| #define SLE_CONDVAR | ( | base, | |
| variable, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a variable in some savegame versions.
| base | Name of the class or struct containing the variable. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the field. |
| to | Last savegame version that has the field. |
Definition at line 884 of file saveload.h.
Referenced by CargoPacket::GetCargoPacketDesc, and OrderBackup::GetOrderBackupDescription.
| #define SLE_CONDVARNAME | ( | base, | |
| variable, | |||
| name, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a variable in some savegame versions.
| base | Name of the class or struct containing the variable. |
| variable | Name of the variable in the class or struct referenced by base. |
| name | Field name for table chunks. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the field. |
| to | Last savegame version that has the field. |
Definition at line 895 of file saveload.h.
Referenced by CargoPacket::GetCargoPacketDesc, OrderBackup::GetOrderBackupDescription, Order::GetOrderDescription, and OrderList::GetOrderListDescription.
| #define SLE_CONDVECTOR | ( | base, | |
| variable, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a vector of SaveLoadType::Variable elements in some savegame versions.
| base | Name of the class or struct containing the list. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the list. |
| to | Last savegame version that has the list. |
Definition at line 979 of file saveload.h.
| #define SLE_CONDVECTOR | ( | base, | |
| variable, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a vector of SaveLoadType::Variable elements in some savegame versions.
| base | Name of the class or struct containing the list. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the list. |
| to | Last savegame version that has the list. |
Definition at line 979 of file saveload.h.
| #define SLE_GENERAL | ( | cmd, | |
| base, | |||
| variable, | |||
| type, | |||
| length, | |||
| from, | |||
| to, | |||
| extra ) |
Storage of simple variables, references (pointers), and arrays with a custom name.
| cmd | Load/save type. |
| base | Name of the class or struct containing the variable. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
| length | Number of elements in the array. |
| from | First savegame version that has the field. |
| to | Last savegame version that has the field. |
| extra | Extra data to pass to the address callback function. |
Definition at line 874 of file saveload.h.
| #define SLE_GENERAL_NAME | ( | cmd, | |
| name, | |||
| base, | |||
| variable, | |||
| type, | |||
| length, | |||
| from, | |||
| to, | |||
| extra ) |
Storage of simple variables, references (pointers), and arrays.
| cmd | Load/save type. |
| name | Field name for table chunks. |
| base | Name of the class or struct containing the variable. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
| length | Number of elements in the array. |
| from | First savegame version that has the field. |
| to | Last savegame version that has the field. |
| extra | Extra data to pass to the address callback function. |
Definition at line 854 of file saveload.h.
| #define SLE_REF | ( | base, | |
| variable, | |||
| type ) |
Storage of a reference in every version of a savegame.
| base | Name of the class or struct containing the variable. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Type of the reference, a value from SLRefType. |
Definition at line 1014 of file saveload.h.
| #define SLE_REFLIST | ( | base, | |
| variable, | |||
| type ) |
Storage of a list of SaveLoadType::Reference elements in every savegame version.
| base | Name of the class or struct containing the list. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
Definition at line 1058 of file saveload.h.
Referenced by LinkGraphSchedule::GetLinkGraphScheduleDesc.
| #define SLE_REFVECTOR | ( | base, | |
| variable, | |||
| type ) |
Storage of a vector of SaveLoadType::Reference elements in every savegame version.
| base | Name of the class or struct containing the vector. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
Definition at line 1066 of file saveload.h.
| #define SLE_SAVEBYTE | ( | base, | |
| variable ) |
Only write byte during saving; never read it during loading.
When using SLE_SAVEBYTE you will have to read this byte before the table this is in is read. This also means SLE_SAVEBYTE can only be used at the top of a chunk. This is intended to be used to indicate what type of entry this is in a list of entries.
| base | Name of the class or struct containing the variable. |
| variable | Name of the variable in the class or struct referenced by base. |
Definition at line 1078 of file saveload.h.
| #define SLE_SSTR | ( | base, | |
| variable, | |||
| type ) |
Storage of a std::string in every savegame version.
| base | Name of the class or struct containing the string. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
Definition at line 1041 of file saveload.h.
Referenced by OrderBackup::GetOrderBackupDescription.
| #define SLE_SSTRNAME | ( | base, | |
| variable, | |||
| name, | |||
| type ) |
Storage of a std::string in every savegame version.
| base | Name of the class or struct containing the string. |
| variable | Name of the variable in the class or struct referenced by base. |
| name | Field name for table chunks. |
| type | Storage of the data in memory and in the savegame. |
Definition at line 1050 of file saveload.h.
| #define SLE_VAR | ( | base, | |
| variable, | |||
| type ) |
Storage of a variable in every version of a savegame.
| base | Name of the class or struct containing the variable. |
| variable | Name of the variable in the class or struct referenced by base. |
| type | Storage of the data in memory and in the savegame. |
Definition at line 997 of file saveload.h.
Referenced by CargoPacket::GetCargoPacketDesc, LinkGraph::GetLinkGraphDesc, LinkGraph::GetLinkGraphJobDesc, and OrderBackup::GetOrderBackupDescription.
| #define SLE_VARNAME | ( | base, | |
| variable, | |||
| name, | |||
| type ) |
Storage of a variable in every version of a savegame.
| base | Name of the class or struct containing the variable. |
| variable | Name of the variable in the class or struct referenced by base. |
| name | Field name for table chunks. |
| type | Storage of the data in memory and in the savegame. |
Definition at line 1006 of file saveload.h.
Referenced by CargoPacket::GetCargoPacketDesc, and Order::GetOrderDescription.
| #define SLEG_ARR | ( | name, | |
| variable, | |||
| type, | |||
| length ) |
Storage of a global fixed-size array of SaveLoadType::Variable elements in every savegame version.
| name | The name of the field. |
| variable | Name of the global variable. |
| type | Storage of the data in memory and in the savegame. |
| length | Number of elements in the array. |
Definition at line 1198 of file saveload.h.
| #define SLEG_CONDARR | ( | name, | |
| variable, | |||
| type, | |||
| length, | |||
| from, | |||
| to ) |
Storage of a global fixed-size array of SaveLoadType::Variable elements in some savegame versions.
| name | The name of the field. |
| variable | Name of the global variable. |
| type | Storage of the data in memory and in the savegame. |
| length | Number of elements in the array. |
| from | First savegame version that has the array. |
| to | Last savegame version that has the array. |
Definition at line 1125 of file saveload.h.
| #define SLEG_CONDREF | ( | name, | |
| variable, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a global reference in some savegame versions.
| name | The name of the field. |
| variable | Name of the global variable. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the field. |
| to | Last savegame version that has the field. |
Definition at line 1114 of file saveload.h.
| #define SLEG_CONDREFLIST | ( | name, | |
| variable, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a global reference list in some savegame versions.
| name | The name of the field. |
| variable | Name of the global variable. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the list. |
| to | Last savegame version that has the list. |
Definition at line 1154 of file saveload.h.
| #define SLEG_CONDSSTR | ( | name, | |
| variable, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a global std::string in some savegame versions.
| name | The name of the field. |
| variable | Name of the global variable. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the string. |
| to | Last savegame version that has the string. |
Definition at line 1135 of file saveload.h.
| #define SLEG_CONDSTRUCT | ( | name, | |
| handler, | |||
| from, | |||
| to ) |
Storage of a structs in some savegame versions.
| name | The name of the field. |
| handler | SaveLoadHandler for the structs. |
| from | First savegame version that has the struct. |
| to | Last savegame version that has the struct. |
Definition at line 1144 of file saveload.h.
| #define SLEG_CONDSTRUCTLIST | ( | name, | |
| handler, | |||
| from, | |||
| to ) |
Storage of a list of structs in some savegame versions.
| name | The name of the field. |
| handler | SaveLoadHandler for the list of structs. |
| from | First savegame version that has the list. |
| to | Last savegame version that has the list. |
Definition at line 1173 of file saveload.h.
Referenced by OrderBackup::GetOrderBackupDescription, and OrderList::GetOrderListDescription.
| #define SLEG_CONDVAR | ( | name, | |
| variable, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a global variable in some savegame versions.
| name | The name of the field. |
| variable | Name of the global variable. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the field. |
| to | Last savegame version that has the field. |
Definition at line 1104 of file saveload.h.
Referenced by LinkGraph::GetLinkGraphDesc.
| #define SLEG_CONDVECTOR | ( | name, | |
| variable, | |||
| type, | |||
| from, | |||
| to ) |
Storage of a global vector of SaveLoadType::Variable elements in some savegame versions.
| name | The name of the field. |
| variable | Name of the global variable. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the list. |
| to | Last savegame version that has the list. |
Definition at line 1164 of file saveload.h.
| #define SLEG_GENERAL | ( | name, | |
| cmd, | |||
| variable, | |||
| type, | |||
| length, | |||
| from, | |||
| to, | |||
| extra ) |
Storage of global simple variables, references (pointers), and arrays.
| name | The name of the field. |
| cmd | Load/save type. |
| variable | Name of the global variable. |
| type | Storage of the data in memory and in the savegame. |
| from | First savegame version that has the field. |
| to | Last savegame version that has the field. |
| extra | Extra data to pass to the address callback function. |
Definition at line 1091 of file saveload.h.
| #define SLEG_REF | ( | name, | |
| variable, | |||
| type ) |
Storage of a global reference in every savegame version.
| name | The name of the field. |
| variable | Name of the global variable. |
| type | Storage of the data in memory and in the savegame. |
Definition at line 1189 of file saveload.h.
| #define SLEG_REFLIST | ( | name, | |
| variable, | |||
| type ) |
Storage of a global reference list in every savegame version.
| name | The name of the field. |
| variable | Name of the global variable. |
| type | Storage of the data in memory and in the savegame. |
Definition at line 1221 of file saveload.h.
| #define SLEG_SSTR | ( | name, | |
| variable, | |||
| type ) |
Storage of a global std::string in every savegame version.
| name | The name of the field. |
| variable | Name of the global variable. |
| type | Storage of the data in memory and in the savegame. |
Definition at line 1206 of file saveload.h.
| #define SLEG_STRUCT | ( | name, | |
| handler ) |
Storage of a structs in every savegame version.
| name | The name of the field. |
| handler | SaveLoadHandler for the structs. |
Definition at line 1213 of file saveload.h.
Referenced by LinkGraph::GetLinkGraphJobDesc.
| #define SLEG_STRUCTLIST | ( | name, | |
| handler ) |
Storage of a list of structs in every savegame version.
| name | The name of the field. |
| handler | SaveLoadHandler for the list of structs. |
Definition at line 1236 of file saveload.h.
Referenced by LinkGraph::GetLinkGraphDesc.
| #define SLEG_VAR | ( | name, | |
| variable, | |||
| type ) |
Storage of a global variable in every savegame version.
| name | The name of the field. |
| variable | Name of the global variable. |
| type | Storage of the data in memory and in the savegame. |
Definition at line 1181 of file saveload.h.
| #define SLEG_VECTOR | ( | name, | |
| variable, | |||
| type ) |
Storage of a global vector of SaveLoadType::Variable elements in every savegame version.
| name | The name of the field. |
| variable | Name of the global variable. |
| type | Storage of the data in memory and in the savegame. |
Definition at line 1229 of file saveload.h.
| typedef void AutolengthProc(int) |
Definition at line 438 of file saveload.h.
| using ChunkHandlerRef = std::reference_wrapper<const ChunkHandler> |
A reference to ChunkHandler.
Definition at line 508 of file saveload.h.
| using ChunkHandlerTable = std::span<const ChunkHandlerRef> |
A table of ChunkHandler entries.
Definition at line 511 of file saveload.h.
Label/unique identifier for each of the chunks in the savegame.
Definition at line 453 of file saveload.h.
| typedef void * SaveLoadAddrProc(void *base, size_t extra) |
Definition at line 761 of file saveload.h.
| using SaveLoadCompatTable = std::span<const struct SaveLoadCompat> |
A table of SaveLoadCompat entries.
Definition at line 514 of file saveload.h.
|
strong |
Type of a chunk.
| Enumerator | |
|---|---|
| Riff | 4 bits store the chunk type, 28 bits the number of bytes. |
| Array | Contiguous array of elements starting at index 0. |
| SparseArray | Array of elements with index for each element. |
| Table | An |
| SparseTable | A |
| FileTypeMask | All ChunkType values that are saved in the file have to be within this mask. |
| ReadOnly | Chunk is never saved. |
Definition at line 441 of file saveload.h.
| enum SavegameType : uint8_t |
Types of save games.
Definition at line 428 of file saveload.h.
|
strong |
Type of data saved.
| Enumerator | |
|---|---|
| Variable | Save/load a variable. |
| Reference | Save/load a reference. |
| Struct | Save/load a struct. |
| String | Save/load a |
| Array | Save/load a fixed-size array of SaveLoadType::Variable elements. |
| Vector | Save/load a vector of SaveLoadType::Variable elements. |
| ReferenceList | Save/load a list of SaveLoadType::Reference elements. |
| StructList | Save/load a list of structs. |
| SaveByte | Save (but not load) a byte. |
| Null | Save null-bytes and load to nowhere. |
| ReferenceVector | Save/load a vector of SaveLoadType::Reference elements. |
Definition at line 743 of file saveload.h.
|
strong |
SaveLoad versions Previous savegame versions, the trunk revision where they were introduced and the released version that had that particular savegame version.
Up to savegame version 18 there is a minor version as well.
Older entries keep their original numbering.
Newer entries should use a descriptive labels, numeric version and PR can be added to comment.
Note that this list must not be reordered.
| Enumerator | |
|---|---|
| MinVersion | First savegame version. |
| BigCurrency | Saveload version: 1.0, releases: 0.1.x, 0.2.x |
| VehicleCurrencyStationChanges | Saveload version: 2.0, release: 0.3.0 Saveload version: 2.1, releases: 0.3.1, 0.3.2 Saveload version: 2.2 |
| BiggerStationVariables | Saveload version: 3.0 |
| TownTolerancePauseMode | Saveload version: 4.0, SVN revision: 1 Saveload version: 4.1, SVN revision: 122, releases: 0.3.3, 0.3.4 Saveload version: 4.2, SVN revision: 1222, release: 0.3.5 Saveload version: 4.3, SVN revision: 1417 Saveload version: 4.4, SVN revision: 1426 |
| BigMap | Saveload version: 5.0, SVN revision: 1429 Saveload version: 5.1, SVN revision: 1440 Saveload version: 5.2, SVN revision: 1525, release: 0.3.6 |
| MultipleRoadStops | Saveload version: 6.0, SVN revision: 1721 Saveload version: 6.1, SVN revision: 1768 |
| LargerCargoSource | Saveload version: 7.0, SVN revision: 1770 |
| LargerUnitNumber | Saveload version: 8.0, SVN revision: 1786 |
| LargerTownCargoStatistics | Saveload version: 9.0, SVN revision: 1909 |
| LargerTownCounter | Saveload version: 10.0, SVN revision: 2030 |
| LargerTownIterator | Saveload version: 11.0, SVN revision: 2033 Saveload version: 11.1, SVN revision: 2041 |
| LinkWaypointToTown | Saveload version: 12.1, SVN revision: 2046 |
| LargerAIStateCounter | Saveload version: 13.1, SVN revision: 2080, releases: 0.4.0, 0.4.0.1 |
| TransferOrder | Saveload version: 14.0, SVN revision: 2441 |
| MoveSemaphoreBits | Saveload version: 15.0, SVN revision: 2499 |
| EngineRenew | Saveload version: 16.0, SVN revision: 2817 Saveload version: 16.1, SVN revision: 3155 |
| StoreWaypointIdInMap | Saveload version: 17.0, SVN revision: 3212 Saveload version: 17.1, SVN revision: 3218 |
| RemoveMinorVersion | Saveload version: 18, SVN revision: 3227 |
| EngineRenewPool | Saveload version: 19, SVN revision: 3396 |
| NoMultiheadReference | Saveload version: 20, SVN revision: 3403 |
| RemoveOldPbs | Saveload version: 21, SVN revision: 3472, release: 0.4.x |
| SavePatches | Saveload version: 22, SVN revision: 3726 |
| RemoveAutosaveInterval | Saveload version: 23, SVN revision: 3915 |
| Elrail | Saveload version: 24, SVN revision: 4150 |
| ImproveMultistop | Saveload version: 25, SVN revision: 4259 |
| LastVehicleType | Saveload version: 26, SVN revision: 4466 |
| NewGRFStations | Saveload version: 27, SVN revision: 4757 |
| Yapf | Saveload version: 28, SVN revision: 4987 |
| MoreUnderBridges | Saveload version: 29, SVN revision: 5070 |
| Tgp | Saveload version: 30, SVN revision: 5946 |
| BigDates | Saveload version: 31, SVN revision: 5999 |
| LinkFarmFieldToIndustry | Saveload version: 32, SVN revision: 6001 |
| SaveYapfSettings | Saveload version: 33, SVN revision: 6440 |
| Liveries | Saveload version: 34, SVN revision: 6455 |
| LiveryRefit | Saveload version: 35, SVN revision: 6602 |
| RefitOrders | Saveload version: 36, SVN revision: 6624 |
| Utf8 | Saveload version: 37, SVN revision: 7182 |
| DisableElrailSetting | Saveload version: 38, SVN revision: 7195 |
| FreightWeight | Saveload version: 39, SVN revision: 7269 |
| GradualLoading | Saveload version: 40, SVN revision: 7326 |
| NewGRFSettings | Saveload version: 41, SVN revision: 7348, release: 0.5.x |
| BridgeWormhole | Saveload version: 42, SVN revision: 7573 |
| UnifyAnimationState | Saveload version: 43, SVN revision: 7642 |
| CargoSourceTile | Saveload version: 44, SVN revision: 8144 |
| CountPaidForCargo | Saveload version: 45, SVN revision: 8501 |
| MoreAirportBlocks | Saveload version: 46, SVN revision: 8705 |
| DriveThroughRoadStops | Saveload version: 47, SVN revision: 8735 |
| RailTrackTypeUnification | Saveload version: 48, SVN revision: 8935 |
| SimplifyPlayerFace | Saveload version: 49, SVN revision: 8969 |
| AircraftSpeedHolding | Saveload version: 50, SVN revision: 8973 |
| FeederShare | Saveload version: 51, SVN revision: 8978 |
| StatueOwner | Saveload version: 52, SVN revision: 9066 |
| NewGRFHouses | Saveload version: 53, SVN revision: 9316 |
| TownGrowthControl | Saveload version: 54, SVN revision: 9613 |
| NewGRFCargo | Saveload version: 55, SVN revision: 9638 |
| Cities | Saveload version: 56, SVN revision: 9667 |
| FifoLoading | Saveload version: 57, SVN revision: 9691 |
| VeryLowTownIndustryNumber | Saveload version: 58, SVN revision: 9762 |
| TownLayout | Saveload version: 59, SVN revision: 9779 |
| VehicleGroups | Saveload version: 60, SVN revision: 9874 |
| MultipleRoadTypes | Saveload version: 61, SVN revision: 9892 |
| AdjacentStations | Saveload version: 62, SVN revision: 9905 |
| TramLivery | Saveload version: 63, SVN revision: 9956 |
| MultipleSignalTypes | Saveload version: 64, SVN revision: 10006 |
| UnifyCurrency | Saveload version: 65, SVN revision: 10210 |
| NewGRFTownNames | Saveload version: 66, SVN revision: 10211 |
| Timetables | Saveload version: 67, SVN revision: 10236 |
| CargoPackets | Saveload version: 68, SVN revision: 10266 |
| MoreCargoPackets | Saveload version: 69, SVN revision: 10319 |
| CargoPaymentOverflow | Saveload version: 70, SVN revision: 10541 |
| UngroupedVehicles | Saveload version: 71, SVN revision: 10567 |
| SplitStationTypeFromGfxid | Saveload version: 72, SVN revision: 10601 |
| NewGRFIndustryLayout | Saveload version: 73, SVN revision: 10903 |
| FixStationPickupAccounting | Saveload version: 74, SVN revision: 11030 |
| Autoslope | Saveload version: 75, SVN revision: 11107 |
| NewGRFPersistentStorage | Saveload version: 76, SVN revision: 11139 |
| CleanupUnconnectedRoads | Saveload version: 77, SVN revision: 11172 |
| StoreIndustryCargo | Saveload version: 78, SVN revision: 11176 |
| FairPlaySettings | Saveload version: 79, SVN revision: 11188 |
| NewGRFMoreAnimation | Saveload version: 80, SVN revision: 11228 |
| FixTreeGround | Saveload version: 81, SVN revision: 11244 |
| NewGRFIndustryRandomTriggers | Saveload version: 82, SVN revision: 11410 |
| DepotWaterOwners | Saveload version: 83, SVN revision: 11589 |
| ReplaceCustomNameArray | Saveload version: 84, SVN revision: 11822 |
| MaglevMonorailPaxWagonLivery | Saveload version: 85, SVN revision: 11874 |
| WaterClass | Saveload version: 86, SVN revision: 12042 |
| SimplifyPathfinderSettings | Saveload version: 87, SVN revision: 12129 |
| FractionProfitRunningTicks | Saveload version: 88, SVN revision: 12134 |
| MoreWaypointsPerTown | Saveload version: 89, SVN revision: 12160 |
| PlaneSpeedFactor | Saveload version: 90, SVN revision: 12293 |
| MoreHouseAnimationFrames | Saveload version: 91, SVN revision: 12347 |
| RemoveHouseCount | Saveload version: 92, SVN revision: 12381, release 0.6.x |
| ImprovedOrders | Saveload version: 93, SVN revision: 12648 |
| FixCompanyCargoTypes | Saveload version: 94, SVN revision: 12816 |
| MoreEngineTypes | Saveload version: 95, SVN revision: 12924 |
| AirportNoise | Saveload version: 96, SVN revision: 13226 |
| MergeOptsPats | Saveload version: 97, SVN revision: 13256 |
| Gamelog | Saveload version: 98, SVN revision: 13375 |
| IndustryTileWaterClass | Saveload version: 99, SVN revision: 13838 |
| Yapp | Saveload version: 100, SVN revision: 13952 |
| NewGRFPalette | Saveload version: 101, SVN revision: 14233 |
| SpreadIndustryProductionChanges | Saveload version: 102, SVN revision: 14332 |
| NewGRFSuppliedStationName | Saveload version: 103, SVN revision: 14598 |
| MoreCompanies | Saveload version: 104, SVN revision: 14735 |
| OrderList | Saveload version: 105, SVN revision: 14803 |
| DistantStationJoining | Saveload version: 106, SVN revision: 14919 |
| NoAI | Saveload version: 107, SVN revision: 15027 |
| StoreAIVersion | Saveload version: 108, SVN revision: 15045 |
| NextCompetitorStartOverflow | Saveload version: 109, SVN revision: 15075 |
| RemoveOldAISettings | Saveload version: 110, SVN revision: 15148 |
| FreeformEdges | Saveload version: 111, SVN revision: 15190 |
| SplitHQ | Saveload version: 112, SVN revision: 15290 |
| RoadLayoutPerTown | Saveload version: 113, SVN revision: 15340 |
| SeparateRoadOwners | Saveload version: 114, SVN revision: 15601 |
| CustomTownNumber | Saveload version: 115, SVN revision: 15695 |
| GamelogEmergency | Saveload version: 116, SVN revision: 15893, release: 0.7.x |
| PlatformStopLocation | Saveload version: 117, SVN revision: 16037 |
| DigitGroupSeparator | Saveload version: 118, SVN revision: 16129 |
| PauseModes | Saveload version: 119, SVN revision: 16242 |
| CompanyServiceIntervals | Saveload version: 120, SVN revision: 16439 |
| CargoPayments | Saveload version: 121, SVN revision: 16694 |
| WaypointMoreLikeStation | Saveload version: 122, SVN revision: 16855 |
| UnifyWaypointAndStation | Saveload version: 123, SVN revision: 16909 |
| MultiTileWaypoints | Saveload version: 124, SVN revision: 16993 |
| RemoveSubsidyStationBinding | Saveload version: 125, SVN revision: 17113 |
| CumulatedInflation | Saveload version: 126, SVN revision: 17433 |
| TownAcceptance | Saveload version: 127, SVN revision: 17439 |
| FoundTown | Saveload version: 128, SVN revision: 18281 |
| TimetableStart | Saveload version: 129, SVN revision: 18292 |
| RoadStopOccupancyPenalty | Saveload version: 130, SVN revision: 18404 |
| MaximumDepotPenalty | Saveload version: 131, SVN revision: 18481 |
| DisallowTreeBuilding | Saveload version: 132, SVN revision: 18522 |
| TrainSlopeSteepness | Saveload version: 133, SVN revision: 18674 |
| VirtualFeederSharePayment | Saveload version: 134, SVN revision: 18703 |
| RocksStayUnderSnow | Saveload version: 135, SVN revision: 18719 |
| SplitLoadWaitCounters | Saveload version: 136, SVN revision: 18764 |
| AirportAnimationFrames | Saveload version: 137, SVN revision: 18912 |
| ReducePlaneCrashes | Saveload version: 138, SVN revision: 18942, release: 1.0.x |
| RvRealisticAcceleration | Saveload version: 139, SVN revision: 19346 |
| StoreAirportSize | Saveload version: 140, SVN revision: 19382 |
| UniqueDepotNames | Saveload version: 141, SVN revision: 19799 |
| NewGRFDepotBuildDate | Saveload version: 142, SVN revision: 20003 |
| DisableTownLevelCrossing | Saveload version: 143, SVN revision: 20048 |
| ReorderUnmovableRemoveReserved | Saveload version: 144, SVN revision: 20334 |
| NewGRFAirportSmoke | Saveload version: 145, SVN revision: 20376 |
| UnifyWaterClass | Saveload version: 146, SVN revision: 20446 |
| UnifyAnimationFrame | Saveload version: 147, SVN revision: 20621 |
| IndustryPlatform | Saveload version: 148, SVN revision: 20659 |
| CustomSeaLevel | Saveload version: 149, SVN revision: 20832 |
| FractionalCargoDelivery | Saveload version: 150, SVN revision: 20857 |
| StoreNewGRFVersion | Saveload version: 151, SVN revision: 20918 |
| IndustryManagement | Saveload version: 152, SVN revision: 21171 |
| LeaveRoadStopSeparately | Saveload version: 153, SVN revision: 21263 |
| PauseLevel | Saveload version: 154, SVN revision: 21426 |
| NewGRFObjectView | Saveload version: 155, SVN revision: 21453 |
| TerraformLimits | Saveload version: 156, SVN revision: 21728 |
| UnifyGroundVehicles | Saveload version: 157, SVN revision: 21862 |
| TrackRealAndAutoOrders | Saveload version: 158, SVN revision: 21933 |
| MaxLengthAndReverseSignals | Saveload version: 159, SVN revision: 21962 |
| DisallowRoadReconstruction | Saveload version: 160, SVN revision: 21974, release: 1.1.x |
| PersistentStoragePool | Saveload version: 161, SVN revision: 22567 |
| NewGRFCustomCargoAging | Saveload version: 162, SVN revision: 22713 |
| Rivers | Saveload version: 163, SVN revision: 22767 |
| VehicleCentreAndZPos | Saveload version: 164, SVN revision: 23290 |
| ScriptTownGrowth | Saveload version: 165, SVN revision: 23304 |
| InfrastructureMaintenanceCosts | Saveload version: 166, SVN revision: 23415 |
| NewGRFAircraftRange | Saveload version: 167, SVN revision: 23504 |
| ScriptTownText | Saveload version: 168, SVN revision: 23637 |
| MoveSccEncoded | Saveload version: 169, SVN revision: 23816 |
| CountIndividualCargoes | Saveload version: 170, SVN revision: 23826 |
| ScenarioDeitySigns | Saveload version: 171, SVN revision: 23835 |
| OrderMaxSpeed | Saveload version: 172, SVN revision: 23947 |
| FixRoadOwnership | Saveload version: 173, SVN revision: 23967, release: 1.2.0-RC1 |
| CurrentOrderMaxSpeed | Saveload version: 174, SVN revision: 23973, release: 1.2.x |
| AutoreplaceWhenOldTreeLimit | Saveload version: 175, SVN revision: 24136 |
| BackupOrderState | Saveload version: 176, SVN revision: 24446 |
| MonthlyBankruptcyCheck | Saveload version: 177, SVN revision: 24619 |
| ScriptSettingsProfile | Saveload version: 178, SVN revision: 24789 |
| RobustEnginePreview | Saveload version: 179, SVN revision: 24810 |
| ServiceIntervalPercent | Saveload version: 180, SVN revision: 24998, release: 1.3.x |
| CargoReservation | Saveload version: 181, SVN revision: 25012 |
| GoalProgressPlaneAcceleration | Saveload version: 182, SVN revision: 25115, r25259, r25296 |
| Cargodist | Saveload version: 183, SVN revision: 25363 |
| SeparateLocaleUnits | Saveload version: 184, SVN revision: 25508 |
| Storybooks | Saveload version: 185, SVN revision: 25620 |
| ObjectTypeToPool | Saveload version: 186, SVN revision: 25833 |
| LinkgraphRestrictedFlow | Saveload version: 187, SVN revision: 25899 |
| UnifyRvTravelTime | Saveload version: 188, SVN revision: 26169, release: 1.4 |
| GroupHierarchy | Saveload version: 189, SVN revision: 26450 |
| SeparateOrderTravelWaitTime | Saveload version: 190, SVN revision: 26547 |
| LinkgraphLocationDisasterStore | Saveload version: 191, SVN revision: 26636, 26646 |
| FixOrderBackup | Saveload version: 192, SVN revision: 26700 |
| HideEnginesForCompany | Saveload version: 193, SVN revision: 26802 |
| MaxBridgeMapHeight | Saveload version: 194, SVN revision: 26881, release: 1.5 |
| Distinguish16 | Saveload version: 195, SVN revision: 27572, release: 1.6.1 |
| Distinguish17 | Saveload version: 196, SVN revision: 27778, release: 1.7 |
| StoreMapVariety | Saveload version: 197, SVN revision: 27978, release: 1.8 |
| TownGrowthInGameTicks | Saveload version: 198, GitHub pull request: 6763 |
| ExtendCargotypes | Saveload version: 199, GitHub pull request: 6802 |
| ExtendRailtypes | Saveload version: 200, GitHub pull request: 6805 |
| ExtendPersistentStorage | Saveload version: 201, GitHub pull request: 6885 |
| ExtendIndustryCargoSlots | Saveload version: 202, GitHub pull request: 6867 |
| ShipPathCache | Saveload version: 203, GitHub pull request: 7072 |
| ShipRotation | Saveload version: 204, GitHub pull request: 7065 |
| GroupLiveries | Saveload version: 205, GitHub pull request: 7108 |
| ShipsStopInLocks | Saveload version: 206, GitHub pull request: 7150 |
| FixCargoMonitor | Saveload version: 207, GitHub pull request: 7175, release: 1.9 |
| TownCargogen | Saveload version: 208, GitHub pull request: 6965 |
| ShipCurvePenalty | Saveload version: 209, GitHub pull request: 7289 |
| ServeNeutralIndustries | Saveload version: 210, GitHub pull request: 7234 |
| RoadvehPathCache | Saveload version: 211, GitHub pull request: 7261 |
| RemoveOldPathfinder | Saveload version: 212, GitHub pull request: 7245 |
| TreesWaterClass | Saveload version: 213, GitHub pull request: 7405 |
| RoadTypes | Saveload version: 214, GitHub pull request: 6811 |
| ScriptMemlimit | Saveload version: 215, GitHub pull request: 7516 |
| MultitileDocks | Saveload version: 216, GitHub pull request: 7380 |
| TradingAge | Saveload version: 217, GitHub pull request: 7780 |
| EndingYear | Saveload version: 218, GitHub pull request: 7747, release: 1.10 |
| RemoveTownCargoCache | Saveload version: 219, GitHub pull request: 8258 |
| StartPatchpacks | Saveload version: 220 |
| EndPatchpacks | Saveload version: 286 |
| GSIndustryControl | Saveload version: 287, GitHub pull request: 7912 and 8115 |
| VehMotionCounter | Saveload version: 288, GitHub pull request: 8591 |
| IndustryText | Saveload version: 289, GitHub pull request: 8576, release: 1.11.0-RC1 |
| MapgenSettingsRevamp | Saveload version: 290, GitHub pull request: 8891, release: 1.11 |
| GroupReplaceWagonRemoval | Saveload version: 291, GitHub pull request: 7441 |
| CustomSubsidyDuration | Saveload version: 292, GitHub pull request: 9081 |
| SaveloadListLength | Saveload version: 293, GitHub pull request: 9374 |
| RiffToArray | Saveload version: 294, GitHub pull request: 9375 |
| TableChunks | Saveload version: 295, GitHub pull request: 9322 |
| ScriptInt64 | Saveload version: 296, GitHub pull request: 9415 |
| LinkgraphTravelTime | Saveload version: 297, GitHub pull request: 9457, release: 12.0-RC1 |
| DockDockingtiles | Saveload version: 298, GitHub pull request: 9578 |
| RepairObjectDockingTiles | Saveload version: 299, GitHub pull request: 9594, release: 12.0 |
| U64TickCounter | Saveload version: 300, GitHub pull request: 10035 |
| LastLoadingTick | Saveload version: 301, GitHub pull request: 9693 |
| MultitrackLevelCrossings | Saveload version: 302, GitHub pull request: 9931, release: 13.0 |
| NewGRFRoadStops | Saveload version: 303, GitHub pull request: 10144 |
| LinkgraphEdges | Saveload version: 304, GitHub pull request: 10314 |
| VelocityNautical | Saveload version: 305, GitHub pull request: 10594 |
| ConsistentPartialZ | Saveload version: 306, GitHub pull request: 10570 |
| MoreCargoAge | Saveload version: 307, GitHub pull request: 10596 |
| LinkgraphSeconds | Saveload version: 308, GitHub pull request: 10610 |
| AIStartDate | Saveload version: 309, GitHub pull request: 10653 |
| ExtendVehicleRandom | Saveload version: 310, GitHub pull request: 10701 |
| ExtendEntityMapping | Saveload version: 311, GitHub pull request: 10672 |
| DisasterVehState | Saveload version: 312, GitHub pull request: 10798 |
| SavegameId | Saveload version: 313, GitHub pull request: 10719 |
| StringGamelog | Saveload version: 314, GitHub pull request: 10801 |
| IndustryCargoReorganise | Saveload version: 315, GitHub pull request: 10853 |
| PeriodsInTransitRename | Saveload version: 316, GitHub pull request: 11112 |
| NewGRFLastService | Saveload version: 317, GitHub pull request: 11124 |
| RemoveLoadedAtXY | Saveload version: 318, GitHub pull request: 11276 |
| CargoTravelled | Saveload version: 319, GitHub pull request: 11283 |
| StationRatingCheat | Saveload version: 320, GitHub pull request: 11346 |
| TimetableStartTicks | Saveload version: 321, GitHub pull request: 11468 |
| TimetableStartTicksFix | Saveload version: 322, GitHub pull request: 11557 |
| TimetableTicksType | Saveload version: 323, GitHub pull request: 11435 |
| WaterRegions | Saveload version: 324, GitHub pull request: 10543 |
| WaterRegionEvalSimplified | Saveload version: 325, GitHub pull request: 11750 |
| EconomyDate | Saveload version: 326, GitHub pull request: 10700 |
| EconomyModeTimekeepingUnits | Saveload version: 327, GitHub pull request: 11341 |
| CalendarSubDateFract | Saveload version: 328, GitHub pull request: 11428 |
| ShipAcceleration | Saveload version: 329, GitHub pull request: 10734 |
| MaxLoanForCompany | Saveload version: 330, GitHub pull request: 11224 |
| DepotUnbunching | Saveload version: 331, GitHub pull request: 11945 |
| AILocalConfig | Saveload version: 332, GitHub pull request: 12003 |
| ScriptRandomizer | Saveload version: 333, GitHub pull request: 12063, release: 14.0-RC1 |
| VehicleEconomyAge | Saveload version: 334, GitHub pull request: 12141, release: 14.0 |
| CompanyAllowList | Saveload version: 335, GitHub pull request: 12337 |
| GroupNumbers | Saveload version: 336, GitHub pull request: 12297 |
| IncreaseStationTypeFieldSize | Saveload version: 337, GitHub pull request: 12572 |
| RoadWaypoints | Saveload version: 338, GitHub pull request: 12572 |
| CompanyInauguratedPeriod | Saveload version: 339, GitHub pull request: 12798 |
| RoadStopTileData | Saveload version: 340, GitHub pull request: 12883 |
| CompanyAllowListV2 | Saveload version: 341, GitHub pull request: 12908 |
| WaterTileType | Saveload version: 342, GitHub pull request: 13030 |
| ProductionHistory | Saveload version: 343, GitHub pull request: 10541 |
| RoadTypeLabelMap | Saveload version: 344, GitHub pull request: 13021 |
| NonfloodingWaterTiles | Saveload version: 345, GitHub pull request: 13013 |
| PathCacheFormat | Saveload version: 346, GitHub pull request: 12345 |
| AnimatedTileStateInMap | Saveload version: 347, GitHub pull request: 13082 |
| IncreaseHouseLimit | Saveload version: 348, GitHub pull request: 12288 |
| CompanyInauguratedPeriodV2 | Saveload version: 349, GitHub pull request: 13448 |
| EncodedStringFormat | Saveload version: 350, GitHub pull request: 13499 |
| ProtectPlacedHouses | Saveload version: 351, GitHub pull request: 13270 |
| ScriptSaveInstances | Saveload version: 352, GitHub pull request: 13556 |
| FixSccEncodedNegative | Saveload version: 353, GitHub pull request: 14049 |
| OrdersOwnedByOrderlist | Saveload version: 354, GitHub pull request: 13948 |
| FaceStyles | Saveload version: 355, GitHub pull request: 14319 |
| IndustryNumValidHistory | Saveload version: 356, GitHub pull request: 14416 |
| IndustryAcceptedHistory | Saveload version: 357, GitHub pull request: 14321 |
| TownSupplyHistory | Saveload version: 358, GitHub pull request: 14461 |
| StationsUnderBridges | Saveload version: 359, GitHub pull request: 14477 |
| DocksUnderBridges | Saveload version: 360, GitHub pull request: 14594 |
| LocksUnderBridges | Saveload version: 361, GitHub pull request: 14595 |
| EngineMultiRailtype | Saveload version: 362, GitHub pull request: 14357, release: 15.0 |
| SignTextColours | Saveload version: 363, GitHub pull request: 14743 |
| BuoysAt0_0 | Saveload version: 364, GitHub pull request: 14983 |
| DriveBackwards | Saveload version: 365, GitHub pull request: 15379 |
| DepotsUnderBridges | Saveload version: 366, GitHub pull request: 15836 |
| MaxVersion | Highest possible saveload version. |
Definition at line 33 of file saveload.h.
|
strong |
Type of reference (SLE_REF, SLE_CONDREF).
Definition at line 617 of file saveload.h.
|
strong |
The types/structures of data that can be stored in the file.
| Enumerator | |
|---|---|
| I8 | A 8 bit signed int. |
| U8 | A 8 bit unsigned int. |
| I16 | A 16 bit signed int. |
| U16 | A 16 bit unsigned int. |
| I32 | A 32 bit signed int. |
| U32 | A 32 bit unsigned int. |
| I64 | A 64 bit signed int. |
| U64 | A 64 bit unsigned int. |
| StringID | StringID offset into strings-array. |
| String | A string. |
| Struct | An arbitrary structure. |
Definition at line 632 of file saveload.h.
|
strong |
The types/structures of data we have in memory.
| Enumerator | |
|---|---|
| Bool | A boolean value. |
| I8 | A 8 bit signed int. |
| U8 | A 8 bit unsigned int. |
| I16 | A 16 bit signed int. |
| U16 | A 16 bit unsigned int. |
| I32 | A 32 bit signed int. |
| U32 | A 32 bit unsigned int. |
| I64 | A 64 bit signed int. |
| U64 | A 64 bit unsigned int. |
| Null | useful to write zeros in savegame. |
| Str | string pointer |
| StrQ | string pointer enclosed in quotes |
| Name | old custom name to be converted to a string pointer |
| LabelReverse | A 4 character |
| LabelForward | A 4 character |
Definition at line 651 of file saveload.h.
|
inline |
Get the address of the variable.
Null-variables don't have an address, everything else has a callback function that returns the address based on the saveload data and the current object for non-globals.
| object | The object to get a relative address from, or nullptr for global objects. |
| sld | The save-load configuration for a single variable. |
Definition at line 1299 of file saveload.h.
References SaveLoad::address_proc, SaveLoad::conv, SaveLoad::extra_data, VarType::mem, and Null.
Referenced by ListSettingDesc::FormatValue(), ListSettingDesc::ParseValue(), IntSettingDesc::Read(), StringSettingDesc::Read(), IntSettingDesc::Write(), and StringSettingDesc::Write().
|
inline |
Checks whether the savegame is below major.
minor.
| major | Major number of the version to check against. |
| minor | Minor number of the version to check against. If minor is 0 or not specified, only the major number is checked. |
Definition at line 1258 of file saveload.h.
References _sl_minor_version, and _sl_version.
Referenced by CargoPacket::AfterLoad(), AfterLoadGame(), AfterLoadLinkGraphs(), AfterLoadStoryBook(), OrderList::AfterLoadVehiclesPhase1, AfterLoadVehiclesPhase2(), Order::ConvertFromOldSavegame(), CopyFromOldName(), DoLoad(), BKORChunkHandler::FixPointers(), CHKPChunkHandler::FixPointers(), CITYChunkHandler::FixPointers(), DEPTChunkHandler::FixPointers(), OBJSChunkHandler::FixPointers(), ORDLChunkHandler::FixPointers(), SlStationGoods::FixPointers(), STNNChunkHandler::FixPointers(), STNSChunkHandler::FixPointers(), SlStationSpecList< T >::GetLength(), SlStationGoods::GetNumCargo(), SlTownOldSupplied::GetNumCargo(), SlCompanyLiveries::GetNumLiveries(), GetSavegameFileType(), GetSettingsDesc(), HandleOldDiffCustom(), IntToReference(), ANITChunkHandler::Load(), CAPRChunkHandler::Load(), CHTSChunkHandler::Load(), CITYChunkHandler::Load(), CMDLChunkHandler::Load(), CMPUChunkHandler::Load(), DEPTChunkHandler::Load(), ECMYChunkHandler::Load(), ENGNChunkHandler::Load(), ERNWChunkHandler::Load(), GRPSChunkHandler::Load(), IBLDChunkHandler::Load(), INDYChunkHandler::Load(), LGRSChunkHandler::Load(), MAP2ChunkHandler::Load(), MAPEChunkHandler::Load(), MAPSChunkHandler::Load(), ORDRChunkHandler::Load(), PRICChunkHandler::Load(), SIGNChunkHandler::Load(), SlCompanyLiveries::Load(), SlCompanyOldEconomy::Load(), SlGameLanguageString::Load(), SlGamelogAction::Load(), SlGamelogRevision::Load(), SlLinkgraphEdge::Load(), SlLinkgraphNode::Load(), SlStationCargo::Load(), SlStationFlow::Load(), SlStationGoods::Load(), SlTownReceived::Load(), SlVehicleRoadVeh::Load(), SlVehicleShip::Load(), VEHSChunkHandler::Load(), VIEWChunkHandler::Load(), DATEChunkHandler::LoadCheck(), MAPSChunkHandler::LoadCheck(), PLYRChunkHandler::LoadCheck(), ScriptInstance::LoadObjects(), LoadSettings(), MoveWaypointsToBaseStations(), SlArray(), SlCalcRefLen(), SlStorageHelper< Tstorage, Tvar, Tallocator >::SlSaveLoad(), SlSaveLoadRef(), and SlStdString().
|
inline |
Checks whether the savegame is below or at major.
This should be used to repair data from existing savegames which is no longer corrupted in new savegames, but for which otherwise no savegame bump is required.
| major | Major number of the version to check against. |
Definition at line 1272 of file saveload.h.
References _sl_version.
Referenced by AfterLoadGame().
|
constexpr |
Transitional helper function to combine a file and memory storage configuration.
| file | The file configuration. |
| mem | The memory configuration. |
VarType. Definition at line 718 of file saveload.h.
| int64_t ReadValue | ( | const void * | ptr, |
| VarMemType | conv ) |
Return a signed-long version of the value of a setting.
| ptr | pointer to the variable |
| conv | type of variable, can be a non-clean type, eg one with other flags because it is parsed |
Definition at line 885 of file saveload.cpp.
References Bool, I16, I32, I64, I8, Null, U16, U32, U64, and U8.
Referenced by CheatWindow::OnQueryTextFinished(), IntSettingDesc::Read(), and SlSaveLoadConv().
| void SetSaveLoadError | ( | StringID | str | ) |
Set the error message from outside of the actual loading/saving of the game (AfterLoadGame and friends).
| str | The string describing the error. |
Definition at line 3018 of file saveload.cpp.
References _sl.
Referenced by AfterLoadGame().
| void SlAutolength | ( | AutolengthProc * | proc, |
| int | arg ) |
Do something of which I have no idea what it is :P.
| proc | The callback procedure that is called |
| arg | The variable that will be used for the callback procedure |
Definition at line 2158 of file saveload.cpp.
References _sl, CalcLength, Save, SlErrorCorruptFmt(), SlSetLength(), and WantLength.
Referenced by AIPLChunkHandler::Save(), and GSDTChunkHandler::Save().
| size_t SlCalcObjLength | ( | const void * | object, |
| const SaveLoadTable & | slt ) |
Calculate the size of an object.
| object | to be measured. |
| slt | The SaveLoad table with objects to save/load. |
Definition at line 1715 of file saveload.cpp.
Referenced by SlObject().
| size_t SlCalcObjMemberLength | ( | const void * | object, |
| const SaveLoad & | sld ) |
Definition at line 1726 of file saveload.cpp.
|
inlineconstexpr |
Check if a saveload cmd/type/length entry matches the size of the variable.
| cmd | SaveLoadType of entry. |
| type | VarType of entry. |
| length | Array length of entry. |
| size | Actual size of variable. |
Definition at line 826 of file saveload.h.
References Array, VarType::mem, Reference, ReferenceList, ReferenceVector, SaveByte, SlVarSize(), String, Variable, and Vector.
| std::vector< SaveLoad > SlCompatTableHeader | ( | const SaveLoadTable & | slt, |
| const SaveLoadCompatTable & | slct ) |
Load a table header in a savegame compatible way.
If the savegame was made before table headers were added, it will fall back to the SaveLoadCompatTable for the order of fields while loading.
| slt | The SaveLoad table with objects to save/load. |
| slct | The SaveLoadCompat table the original order of the fields. |
Definition at line 2094 of file saveload.cpp.
References _sl, SaveLoad::cmd, Debug, SaveLoad::handler, Load, LoadCheck, SaveLoad::name, Null, SlCompatTableHeader(), SlErrorCorrupt(), SlIsObjectValidInSavegame(), SlTableHeader(), SparseTable, Struct, StructList, Table, and U8.
Referenced by AIPLChunkHandler::Load(), ANITChunkHandler::Load(), BKORChunkHandler::Load(), CAPAChunkHandler::Load(), CAPYChunkHandler::Load(), CHTSChunkHandler::Load(), CITYChunkHandler::Load(), CMDLChunkHandler::Load(), CMPUChunkHandler::Load(), DEPTChunkHandler::Load(), ECMYChunkHandler::Load(), EIDSChunkHandler::Load(), ENGNChunkHandler::Load(), ERNWChunkHandler::Load(), GOALChunkHandler::Load(), GRPSChunkHandler::Load(), GSDTChunkHandler::Load(), GSTRChunkHandler::Load(), IBLDChunkHandler::Load(), INDYChunkHandler::Load(), ITBLChunkHandler::Load(), LGRJChunkHandler::Load(), LGRPChunkHandler::Load(), LGRSChunkHandler::Load(), MAPSChunkHandler::Load(), NewGRFMappingChunkHandler::Load(), OBJSChunkHandler::Load(), ORDLChunkHandler::Load(), ORDRChunkHandler::Load(), PLYRChunkHandler::Load(), PSACChunkHandler::Load(), RAILChunkHandler::Load(), ROADChunkHandler::Load(), ROTTChunkHandler::Load(), SIGNChunkHandler::Load(), STNNChunkHandler::Load(), STNSChunkHandler::Load(), STPAChunkHandler::Load(), STPEChunkHandler::Load(), SUBSChunkHandler::Load(), VEHSChunkHandler::Load(), VIEWChunkHandler::Load(), MAPSChunkHandler::LoadCheck(), PLYRChunkHandler::LoadCheck(), LoadSettings(), and SlCompatTableHeader().
| void SlCopy | ( | void * | object, |
| size_t | length, | ||
| VarType | conv ) |
Copy a list of SaveLoadType::Variables to/from a savegame.
These entries are copied as-is, and you as caller have to make sure things like length-fields are calculated correctly.
| object | The object being manipulated. |
| length | The length of the object in elements |
| conv | VarType type of the items. |
Definition at line 1262 of file saveload.cpp.
References _sl, CalcLength, None, Null, Ptrs, SlCalcConvFileLen(), SlCopyInternal(), and SlSetLength().
Referenced by ANITChunkHandler::Load(), CAPRChunkHandler::Load(), ENGSChunkHandler::Load(), M3HIChunkHandler::Load(), M3LOChunkHandler::Load(), MAP2ChunkHandler::Load(), MAP5ChunkHandler::Load(), MAP7ChunkHandler::Load(), MAP8ChunkHandler::Load(), MAPEChunkHandler::Load(), MAPHChunkHandler::Load(), MAPOChunkHandler::Load(), MAPTChunkHandler::Load(), ORDRChunkHandler::Load(), PRICChunkHandler::Load(), ScriptInstance::LoadObjects(), M3HIChunkHandler::Save(), M3LOChunkHandler::Save(), MAP2ChunkHandler::Save(), MAP5ChunkHandler::Save(), MAP7ChunkHandler::Save(), MAP8ChunkHandler::Save(), MAPEChunkHandler::Save(), MAPHChunkHandler::Save(), MAPOChunkHandler::Save(), MAPTChunkHandler::Save(), and ScriptInstance::SaveObject().
| size_t SlGetFieldLength | ( | ) |
Get the length of the current object.
Definition at line 873 of file saveload.cpp.
References _sl.
Referenced by ANITChunkHandler::Load(), CHTSChunkHandler::Load(), NAMEChunkHandler::Load(), and ORDRChunkHandler::Load().
| size_t SlGetStructListLength | ( | size_t | limit | ) |
Get the length of this list; if it exceeds the limit, error out.
| limit | The maximum size the list can be. |
Definition at line 1892 of file saveload.cpp.
References SlErrorCorrupt().
Referenced by SlStationSpecList< T >::GetLength(), VectorSaveLoadHandler< TImpl, TObject, TElementType, MAX_LENGTH >::GetLength(), SlStationGoods::GetNumCargo(), SlTownOldSupplied::GetNumCargo(), SlCompanyLiveries::GetNumLiveries(), SlCompanyOldEconomy::Load(), SlGameLanguageString::Load(), SlGamelogAction::Load(), SlIndustryAcceptedHistory::Load(), SlIndustryProducedHistory::Load(), SlLinkgraphEdge::Load(), SlLinkgraphNode::Load(), SlSkipHandler::Load(), SlStationCargo::Load(), SlStationFlow::Load(), SlStationWaitingTriggers::Load(), SlTownAcceptedHistory::Load(), SlTownReceived::Load(), and SlTownSuppliedHistory::Load().
| void SlGlobList | ( | const SaveLoadTable & | slt | ) |
Save or Load (a list of) global variables.
| slt | The SaveLoad table with objects to save/load. |
Definition at line 2148 of file saveload.cpp.
References SlObject().
Referenced by ANITChunkHandler::Load(), IBLDChunkHandler::Load(), MAPSChunkHandler::Load(), VIEWChunkHandler::Load(), MAPSChunkHandler::LoadCheck(), ANITChunkHandler::Save(), DATEChunkHandler::Save(), IBLDChunkHandler::Save(), MAPSChunkHandler::Save(), and VIEWChunkHandler::Save().
|
inline |
Checks if some version from/to combination falls within the range of the active savegame version.
| version_from | Inclusive savegame version lower bound. |
| version_to | Exclusive savegame version upper bound. MaxVersion if no upper bound. |
Definition at line 1285 of file saveload.h.
References SAVEGAME_VERSION.
Referenced by CmdChangeSetting(), GetSaveLoadFromSettingTable(), GetSettingFromName(), IniLoadSettings(), IniSaveSettings(), LoadSettings(), and SurveySettingsTable().
| int SlIterateArray | ( | ) |
Iterate through the elements of an array and read the whole thing.
Definition at line 747 of file saveload.cpp.
References _sl, Array, Debug, SlErrorCorruptFmt(), SparseArray, SparseTable, and Table.
Referenced by AIPLChunkHandler::Load(), ANITChunkHandler::Load(), BKORChunkHandler::Load(), CAPAChunkHandler::Load(), CAPYChunkHandler::Load(), CHKPChunkHandler::Load(), CHTSChunkHandler::Load(), CITYChunkHandler::Load(), CMDLChunkHandler::Load(), CMPUChunkHandler::Load(), DEPTChunkHandler::Load(), ECMYChunkHandler::Load(), EIDSChunkHandler::Load(), ENGNChunkHandler::Load(), ERNWChunkHandler::Load(), GOALChunkHandler::Load(), GRPSChunkHandler::Load(), GSDTChunkHandler::Load(), GSTRChunkHandler::Load(), IBLDChunkHandler::Load(), INDYChunkHandler::Load(), ITBLChunkHandler::Load(), LEAEChunkHandler::Load(), LEATChunkHandler::Load(), LGRJChunkHandler::Load(), LGRPChunkHandler::Load(), LGRSChunkHandler::Load(), MAPSChunkHandler::Load(), NAMEChunkHandler::Load(), NewGRFMappingChunkHandler::Load(), OBJSChunkHandler::Load(), ORDLChunkHandler::Load(), ORDRChunkHandler::Load(), PLYRChunkHandler::Load(), PSACChunkHandler::Load(), RAILChunkHandler::Load(), ROADChunkHandler::Load(), ROTTChunkHandler::Load(), SIGNChunkHandler::Load(), SRNDChunkHandler::Load(), STNNChunkHandler::Load(), STNSChunkHandler::Load(), STPAChunkHandler::Load(), STPEChunkHandler::Load(), SUBSChunkHandler::Load(), VEHSChunkHandler::Load(), VIEWChunkHandler::Load(), MAPSChunkHandler::LoadCheck(), PLYRChunkHandler::LoadCheck(), LoadSettings(), SlLoadCheckChunk(), SlLoadChunk(), and SlSkipArray().
| void SlObject | ( | void * | object, |
| const SaveLoadTable & | slt ) |
Main SaveLoad function.
| object | The object that is being saved or loaded. |
| slt | The SaveLoad table with objects to save/load. |
Definition at line 1905 of file saveload.cpp.
References _sl, CalcLength, None, SlCalcObjLength(), and SlSetLength().
Referenced by BKORChunkHandler::FixPointers(), CAPYChunkHandler::FixPointers(), CHKPChunkHandler::FixPointers(), CITYChunkHandler::FixPointers(), DEPTChunkHandler::FixPointers(), ERNWChunkHandler::FixPointers(), INDYChunkHandler::FixPointers(), LGRSChunkHandler::FixPointers(), OBJSChunkHandler::FixPointers(), ORDLChunkHandler::FixPointers(), PLYRChunkHandler::FixPointers(), ROADChunkHandler::FixPointers(), SlCompanyEconomy::FixPointers(), SlCompanySettings::FixPointers(), SlStationBase::FixPointers(), SlStationCargo::FixPointers(), SlStationGoods::FixPointers(), SlStationNormal::FixPointers(), SlStationWaypoint::FixPointers(), SlVehicleAircraft::FixPointers(), SlVehicleCommon::FixPointers(), SlVehicleDisaster::FixPointers(), SlVehicleEffect::FixPointers(), SlVehicleRoadVeh::FixPointers(), SlVehicleShip::FixPointers(), SlVehicleTrain::FixPointers(), STNNChunkHandler::FixPointers(), STNSChunkHandler::FixPointers(), VEHSChunkHandler::FixPointers(), AIPLChunkHandler::Load(), BKORChunkHandler::Load(), CAPAChunkHandler::Load(), CAPYChunkHandler::Load(), CHKPChunkHandler::Load(), CHTSChunkHandler::Load(), CITYChunkHandler::Load(), CMDLChunkHandler::Load(), CMPUChunkHandler::Load(), DEPTChunkHandler::Load(), ECMYChunkHandler::Load(), EIDSChunkHandler::Load(), ENGNChunkHandler::Load(), ERNWChunkHandler::Load(), GOALChunkHandler::Load(), GRPSChunkHandler::Load(), GSDTChunkHandler::Load(), GSTRChunkHandler::Load(), INDYChunkHandler::Load(), ITBLChunkHandler::Load(), LEAEChunkHandler::Load(), LEATChunkHandler::Load(), LGRJChunkHandler::Load(), LGRPChunkHandler::Load(), LGRSChunkHandler::Load(), NewGRFMappingChunkHandler::Load(), OBJSChunkHandler::Load(), ORDLChunkHandler::Load(), ORDRChunkHandler::Load(), PLYRChunkHandler::Load(), PSACChunkHandler::Load(), RAILChunkHandler::Load(), ROADChunkHandler::Load(), ROTTChunkHandler::Load(), ScriptInstance::Load(), SIGNChunkHandler::Load(), SlCompanyEconomy::Load(), SlCompanyLiveries::Load(), SlCompanyOldAI::Load(), SlCompanyOldAIBuildRec::Load(), SlCompanyOldEconomy::Load(), SlCompanySettings::Load(), SlGameLanguageString::Load(), SlGamelogEmergency::Load(), SlGamelogGrfadd::Load(), SlGamelogGrfbug::Load(), SlGamelogGrfcompat::Load(), SlGamelogGrfmove::Load(), SlGamelogGrfparam::Load(), SlGamelogGrfrem::Load(), SlGamelogMode::Load(), SlGamelogOldver::Load(), SlGamelogRevision::Load(), SlGamelogSetting::Load(), SlIndustryAcceptedHistory::Load(), SlIndustryProducedHistory::Load(), SlLinkgraphEdge::Load(), SlLinkgraphJobProxy::Load(), SlLinkgraphNode::Load(), SlSkipHandler::Load(), SlStationBase::Load(), SlStationCargo::Load(), SlStationFlow::Load(), SlStationGoods::Load(), SlStationNormal::Load(), SlStationWaitingTriggers::Load(), SlStationWaypoint::Load(), SlTownAcceptanceMatrix::Load(), SlTownAcceptedHistory::Load(), SlTownOldSupplied::Load(), SlTownReceived::Load(), SlTownSuppliedHistory::Load(), SlVehicleAircraft::Load(), SlVehicleCommon::Load(), SlVehicleDisaster::Load(), SlVehicleEffect::Load(), SlVehicleRoadVeh::Load(), SlVehicleShip::Load(), SlVehicleTrain::Load(), SRNDChunkHandler::Load(), STNNChunkHandler::Load(), STNSChunkHandler::Load(), STPAChunkHandler::Load(), STPEChunkHandler::Load(), SUBSChunkHandler::Load(), VectorSaveLoadHandler< TImpl, TObject, TElementType, MAX_LENGTH >::Load(), VEHSChunkHandler::Load(), PLYRChunkHandler::LoadCheck(), ScriptInstance::LoadEmpty(), ScriptInstance::LoadObjects(), LoadSettings(), BKORChunkHandler::Save(), CAPAChunkHandler::Save(), CAPYChunkHandler::Save(), CHTSChunkHandler::Save(), CITYChunkHandler::Save(), CMDLChunkHandler::Save(), CMPUChunkHandler::Save(), DEPTChunkHandler::Save(), ECMYChunkHandler::Save(), EIDSChunkHandler::Save(), ENGNChunkHandler::Save(), ERNWChunkHandler::Save(), GLOGChunkHandler::Save(), GOALChunkHandler::Save(), GRPSChunkHandler::Save(), GSTRChunkHandler::Save(), INDYChunkHandler::Save(), ITBLChunkHandler::Save(), LEAEChunkHandler::Save(), LEATChunkHandler::Save(), LGRJChunkHandler::Save(), LGRPChunkHandler::Save(), LGRSChunkHandler::Save(), NewGRFMappingChunkHandler::Save(), NGRFChunkHandler::Save(), OBJSChunkHandler::Save(), ORDLChunkHandler::Save(), PLYRChunkHandler::Save(), PSACChunkHandler::Save(), RAILChunkHandler::Save(), ROADChunkHandler::Save(), ROTTChunkHandler::Save(), ScriptInstance::Save(), SIGNChunkHandler::Save(), SlCompanyEconomy::Save(), SlCompanyLiveries::Save(), SlCompanyOldEconomy::Save(), SlCompanySettings::Save(), SlGameLanguageString::Save(), SlGamelogAction::Save(), SlGamelogEmergency::Save(), SlGamelogGrfadd::Save(), SlGamelogGrfbug::Save(), SlGamelogGrfcompat::Save(), SlGamelogGrfmove::Save(), SlGamelogGrfparam::Save(), SlGamelogGrfrem::Save(), SlGamelogMode::Save(), SlGamelogOldver::Save(), SlGamelogRevision::Save(), SlGamelogSetting::Save(), SlIndustryAcceptedHistory::Save(), SlIndustryProducedHistory::Save(), SlLinkgraphEdge::Save(), SlLinkgraphJobProxy::Save(), SlLinkgraphNode::Save(), SlStationBase::Save(), SlStationCargo::Save(), SlStationFlow::Save(), SlStationGoods::Save(), SlStationNormal::Save(), SlStationWaitingTriggers::Save(), SlStationWaypoint::Save(), SlTownAcceptedHistory::Save(), SlTownReceived::Save(), SlTownSuppliedHistory::Save(), SlVehicleAircraft::Save(), SlVehicleCommon::Save(), SlVehicleDisaster::Save(), SlVehicleEffect::Save(), SlVehicleRoadVeh::Save(), SlVehicleShip::Save(), SlVehicleTrain::Save(), SRNDChunkHandler::Save(), STNNChunkHandler::Save(), STPAChunkHandler::Save(), STPEChunkHandler::Save(), SUBSChunkHandler::Save(), VectorSaveLoadHandler< TImpl, TObject, TElementType, MAX_LENGTH >::Save(), VEHSChunkHandler::Save(), ScriptInstance::SaveEmpty(), ScriptInstance::SaveObject(), SaveSettings(), and SlGlobList().
| uint8_t SlReadByte | ( | ) |
Wrapper for reading a byte from the buffer.
Definition at line 410 of file saveload.cpp.
References _sl.
Referenced by SlGamelogAction::Load(), STNNChunkHandler::Load(), VEHSChunkHandler::Load(), SlCopyBytes(), SlLoadCheckChunk(), SlLoadChunk(), SlReadChunkId(), SlReadSimpleGamma(), SlSaveLoadConv(), and SlSkipBytes().
| void SlReadString | ( | std::string & | str, |
| size_t | length ) |
Read the given amount of bytes from the buffer into the string.
| str | The string to write to. |
| length | The amount of bytes to read into the string. |
Definition at line 1157 of file saveload.cpp.
References SlCopyBytes().
Referenced by NAMEChunkHandler::Load(), and SlStdString().
|
static |
Definition at line 1316 of file saveload.h.
| void SlSetArrayIndex | ( | uint | index | ) |
Definition at line 735 of file saveload.cpp.
| void SlSetLength | ( | size_t | length | ) |
Sets the length of either a RIFF object or the number of items in an array.
This lets us load an object or an array of arbitrary size
| length | The length of the sought object/array |
Definition at line 801 of file saveload.cpp.
References _sl, Array, CalcLength, None, Riff, Save, SparseArray, SparseTable, Table, and WantLength.
Referenced by M3HIChunkHandler::Save(), M3LOChunkHandler::Save(), MAP2ChunkHandler::Save(), MAP5ChunkHandler::Save(), MAP7ChunkHandler::Save(), MAP8ChunkHandler::Save(), MAPEChunkHandler::Save(), MAPHChunkHandler::Save(), MAPOChunkHandler::Save(), MAPTChunkHandler::Save(), SlAutolength(), SlCopy(), SlObject(), SlRefList(), SlRefVector(), SlSetStructListLength(), and SlTableHeader().
| void SlSetStructListLength | ( | size_t | length | ) |
Set the length of this list.
| length | The length of the list. |
Definition at line 1876 of file saveload.cpp.
References _sl, CalcLength, None, and SlSetLength().
Referenced by SlCompanyLiveries::Save(), SlCompanyOldEconomy::Save(), SlGameLanguageString::Save(), SlGamelogAction::Save(), SlIndustryAcceptedHistory::Save(), SlIndustryProducedHistory::Save(), SlLinkgraphEdge::Save(), SlLinkgraphNode::Save(), SlStationCargo::Save(), SlStationFlow::Save(), SlStationGoods::Save(), SlStationWaitingTriggers::Save(), SlTownAcceptedHistory::Save(), SlTownReceived::Save(), SlTownSuppliedHistory::Save(), and VectorSaveLoadHandler< TImpl, TObject, TElementType, MAX_LENGTH >::Save().
|
inline |
Read in bytes from the file/data structure but don't do anything with them, discarding them in effect.
| length | The amount of bytes that is being treated this way |
Definition at line 1343 of file saveload.h.
References SlReadByte().
Referenced by SlTownAcceptanceMatrix::Load(), ChunkHandler::LoadCheck(), SlCopyInternal(), SlSkipArray(), and SlStdString().
| std::vector< SaveLoad > SlTableHeader | ( | const SaveLoadTable & | slt | ) |
Save or Load a table header.
| slt | The SaveLoad table with objects to save/load. |
Definition at line 1958 of file saveload.cpp.
References _sl, Array, CalcLength, SaveLoad::cmd, Debug, GetSavegameFileType(), SaveLoad::handler, SavegameFileType::HasFieldLength(), SavegameFileType::IsEnd(), Load, LoadCheck, MaxVersion, MinVersion, SaveLoad::name, None, Null, Save, SlCalcTableHeader(), SlErrorCorrupt(), SlIsObjectValidInSavegame(), SlSaveLoadConv(), SlSetLength(), SlStdString(), SlTableHeader(), SparseTable, SavegameFileType::storage, VarTypes::STR, String, Struct, StructList, Table, SavegameFileType::Type(), VarTypes::U8, and Variable.
Referenced by LEAEChunkHandler::Load(), LEATChunkHandler::Load(), SRNDChunkHandler::Load(), WaterRegionChunkHandler::Load(), ChunkHandler::LoadCheck(), AIPLChunkHandler::Save(), ANITChunkHandler::Save(), BKORChunkHandler::Save(), CAPAChunkHandler::Save(), CAPYChunkHandler::Save(), CHTSChunkHandler::Save(), CITYChunkHandler::Save(), CMDLChunkHandler::Save(), CMPUChunkHandler::Save(), DATEChunkHandler::Save(), DEPTChunkHandler::Save(), ECMYChunkHandler::Save(), EIDSChunkHandler::Save(), ENGNChunkHandler::Save(), ERNWChunkHandler::Save(), GLOGChunkHandler::Save(), GOALChunkHandler::Save(), GRPSChunkHandler::Save(), GSDTChunkHandler::Save(), GSTRChunkHandler::Save(), IBLDChunkHandler::Save(), INDYChunkHandler::Save(), ITBLChunkHandler::Save(), LEAEChunkHandler::Save(), LEATChunkHandler::Save(), LGRJChunkHandler::Save(), LGRPChunkHandler::Save(), LGRSChunkHandler::Save(), MAPSChunkHandler::Save(), NewGRFMappingChunkHandler::Save(), NGRFChunkHandler::Save(), OBJSChunkHandler::Save(), ORDLChunkHandler::Save(), PLYRChunkHandler::Save(), PSACChunkHandler::Save(), RAILChunkHandler::Save(), ROADChunkHandler::Save(), ROTTChunkHandler::Save(), SIGNChunkHandler::Save(), SRNDChunkHandler::Save(), STNNChunkHandler::Save(), STPAChunkHandler::Save(), STPEChunkHandler::Save(), SUBSChunkHandler::Save(), VEHSChunkHandler::Save(), VIEWChunkHandler::Save(), SaveSettings(), SlCompatTableHeader(), and SlTableHeader().
|
inlineconstexpr |
Return expect size in bytes of a VarType.
| type | VarType to get size of. |
Definition at line 796 of file saveload.h.
References Bool, I16, I32, I64, I8, LabelForward, LabelReverse, Name, Null, Str, StrQ, U16, U32, U64, and U8.
Referenced by LoadIntList(), and SlCheckVarSize().
| void SlWriteByte | ( | uint8_t | b | ) |
Wrapper for writing a byte to the dumper.
| b | The byte to write. |
Definition at line 419 of file saveload.cpp.
References _sl.
Referenced by SlCopyBytes(), SlSaveChunk(), SlSaveLoadConv(), and SlWriteSimpleGamma().
| void WriteValue | ( | void * | ptr, |
| VarMemType | conv, | ||
| int64_t | val ) |
Write the value of a setting.
| ptr | pointer to the variable |
| conv | type of variable, can be a non-clean type, eg with other flags. It is parsed upon read |
| val | the new value being given to the variable |
Definition at line 909 of file saveload.cpp.
References Bool, CopyFromOldName(), I16, I32, I64, I8, Name, Null, U16, U32, U64, and U8.
Referenced by LoadIntList(), CheatWindow::OnQueryTextFinished(), SlSaveLoadConv(), and IntSettingDesc::Write().