OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
13 #include "../fileio_type.h"
15 #include "../strings_type.h"
16 #include "../core/span_type.hpp"
382 void WaitTillSaved();
391 typedef void AutolengthProc(
void *arg);
418 virtual void Save()
const { NOT_REACHED(); }
424 virtual void Load()
const = 0;
439 virtual void LoadCheck(
size_t len = 0)
const;
457 std::optional<std::vector<SaveLoad>> load_description;
465 virtual void Save(
void *
object)
const {}
471 virtual void Load(
void *
object)
const {}
514 template <
class TImpl,
class TObject>
520 virtual void Save(TObject *
object)
const {}
521 void Save(
void *
object)
const override { this->
Save(
static_cast<TObject *
>(
object)); }
523 virtual void Load(TObject *
object)
const {}
524 void Load(
void *
object)
const override { this->
Load(
static_cast<TObject *
>(
object)); }
526 virtual void LoadCheck(TObject *
object)
const {}
529 virtual void FixPointers(TObject *
object)
const {}
570 SLE_FILE_STRING = 10,
571 SLE_FILE_STRUCT = 11,
581 SLE_VAR_I16 = 3 << 4,
582 SLE_VAR_U16 = 4 << 4,
583 SLE_VAR_I32 = 5 << 4,
584 SLE_VAR_U32 = 6 << 4,
585 SLE_VAR_I64 = 7 << 4,
586 SLE_VAR_U64 = 8 << 4,
595 SLE_VAR_CHAR = SLE_VAR_I8,
600 SLE_BOOL = SLE_FILE_I8 | SLE_VAR_BL,
601 SLE_INT8 = SLE_FILE_I8 | SLE_VAR_I8,
602 SLE_UINT8 = SLE_FILE_U8 | SLE_VAR_U8,
603 SLE_INT16 = SLE_FILE_I16 | SLE_VAR_I16,
604 SLE_UINT16 = SLE_FILE_U16 | SLE_VAR_U16,
605 SLE_INT32 = SLE_FILE_I32 | SLE_VAR_I32,
606 SLE_UINT32 = SLE_FILE_U32 | SLE_VAR_U32,
607 SLE_INT64 = SLE_FILE_I64 | SLE_VAR_I64,
608 SLE_UINT64 = SLE_FILE_U64 | SLE_VAR_U64,
609 SLE_CHAR = SLE_FILE_I8 | SLE_VAR_CHAR,
617 SLE_UINT = SLE_UINT32,
619 SLE_STRB = SLE_STRINGBUF,
621 SLE_STRQ = SLE_STRINGQUOTE,
629 typedef uint32 VarType;
650 typedef void *SaveLoadAddrProc(
void *base,
size_t extra);
692 #define SLE_GENERAL(cmd, base, variable, type, length, from, to, extra) SaveLoad {#variable, cmd, type, length, from, to, cpp_sizeof(base, variable), [] (void *b, size_t) -> void * { assert(b != nullptr); return const_cast<void *>(static_cast<const void *>(std::addressof(static_cast<base *>(b)->variable))); }, extra, nullptr}
702 #define SLE_CONDVAR(base, variable, type, from, to) SLE_GENERAL(SL_VAR, base, variable, type, 0, from, to, 0)
712 #define SLE_CONDREF(base, variable, type, from, to) SLE_GENERAL(SL_REF, base, variable, type, 0, from, to, 0)
723 #define SLE_CONDARR(base, variable, type, length, from, to) SLE_GENERAL(SL_ARR, base, variable, type, length, from, to, 0)
734 #define SLE_CONDSTR(base, variable, type, length, from, to) SLE_GENERAL(SL_STR, base, variable, type, length, from, to, 0)
744 #define SLE_CONDSSTR(base, variable, type, from, to) SLE_GENERAL(SL_STDSTR, base, variable, type, 0, from, to, 0)
754 #define SLE_CONDREFLIST(base, variable, type, from, to) SLE_GENERAL(SL_REFLIST, base, variable, type, 0, from, to, 0)
764 #define SLE_CONDDEQUE(base, variable, type, from, to) SLE_GENERAL(SL_DEQUE, base, variable, type, 0, from, to, 0)
772 #define SLE_VAR(base, variable, type) SLE_CONDVAR(base, variable, type, SL_MIN_VERSION, SL_MAX_VERSION)
780 #define SLE_REF(base, variable, type) SLE_CONDREF(base, variable, type, SL_MIN_VERSION, SL_MAX_VERSION)
789 #define SLE_ARR(base, variable, type, length) SLE_CONDARR(base, variable, type, length, SL_MIN_VERSION, SL_MAX_VERSION)
798 #define SLE_STR(base, variable, type, length) SLE_CONDSTR(base, variable, type, length, SL_MIN_VERSION, SL_MAX_VERSION)
806 #define SLE_SSTR(base, variable, type) SLE_CONDSSTR(base, variable, type, SL_MIN_VERSION, SL_MAX_VERSION)
814 #define SLE_REFLIST(base, variable, type) SLE_CONDREFLIST(base, variable, type, SL_MIN_VERSION, SL_MAX_VERSION)
826 #define SLE_SAVEBYTE(base, variable) SLE_GENERAL(SL_SAVEBYTE, base, variable, 0, 0, SL_MIN_VERSION, SL_MAX_VERSION, 0)
839 #define SLEG_GENERAL(name, cmd, variable, type, length, from, to, extra) SaveLoad {name, cmd, type, length, from, to, sizeof(variable), [] (void *, size_t) -> void * { return static_cast<void *>(std::addressof(variable)); }, extra, nullptr}
849 #define SLEG_CONDVAR(name, variable, type, from, to) SLEG_GENERAL(name, SL_VAR, variable, type, 0, from, to, 0)
859 #define SLEG_CONDREF(name, variable, type, from, to) SLEG_GENERAL(name, SL_REF, variable, type, 0, from, to, 0)
870 #define SLEG_CONDARR(name, variable, type, length, from, to) SLEG_GENERAL(name, SL_ARR, variable, type, length, from, to, 0)
881 #define SLEG_CONDSTR(name, variable, type, length, from, to) SLEG_GENERAL(name, SL_STR, variable, type, length, from, to, 0)
891 #define SLEG_CONDSSTR(name, variable, type, from, to) SLEG_GENERAL(name, SL_STDSTR, variable, type, 0, from, to, 0)
900 #define SLEG_CONDSTRUCT(name, handler, from, to) SaveLoad {name, SL_STRUCT, 0, 0, from, to, 0, nullptr, 0, std::make_shared<handler>()}
910 #define SLEG_CONDREFLIST(name, variable, type, from, to) SLEG_GENERAL(name, SL_REFLIST, variable, type, 0, from, to, 0)
920 #define SLEG_CONDVECTOR(name, variable, type, from, to) SLEG_GENERAL(name, SL_VECTOR, variable, type, 0, from, to, 0)
929 #define SLEG_CONDSTRUCTLIST(name, handler, from, to) SaveLoad {name, SL_STRUCTLIST, 0, 0, from, to, 0, nullptr, 0, std::make_shared<handler>()}
937 #define SLEG_VAR(name, variable, type) SLEG_CONDVAR(name, variable, type, SL_MIN_VERSION, SL_MAX_VERSION)
945 #define SLEG_REF(name, variable, type) SLEG_CONDREF(name, variable, type, SL_MIN_VERSION, SL_MAX_VERSION)
953 #define SLEG_ARR(name, variable, type) SLEG_CONDARR(name, variable, type, lengthof(variable), SL_MIN_VERSION, SL_MAX_VERSION)
961 #define SLEG_STR(name, variable, type) SLEG_CONDSTR(name, variable, type, sizeof(variable), SL_MIN_VERSION, SL_MAX_VERSION)
969 #define SLEG_SSTR(name, variable, type) SLEG_CONDSSTR(name, variable, type, SL_MIN_VERSION, SL_MAX_VERSION)
976 #define SLEG_STRUCT(name, handler) SLEG_CONDSTRUCT(name, handler, SL_MIN_VERSION, SL_MAX_VERSION)
984 #define SLEG_REFLIST(name, variable, type) SLEG_CONDREFLIST(name, variable, type, SL_MIN_VERSION, SL_MAX_VERSION)
992 #define SLEG_VECTOR(name, variable, type) SLEG_CONDVECTOR(name, variable, type, SL_MIN_VERSION, SL_MAX_VERSION)
999 #define SLEG_STRUCTLIST(name, handler) SLEG_CONDSTRUCTLIST(name, handler, SL_MIN_VERSION, SL_MAX_VERSION)
1005 #define SLC_VAR(name) {name, 0, SL_MIN_VERSION, SL_MAX_VERSION}
1013 #define SLC_NULL(length, from, to) {{}, length, from, to}
1016 #define SLC_END() {{}, 0, SL_MIN_VERSION, SL_MIN_VERSION}
1107 int64
ReadValue(
const void *ptr, VarType conv);
1108 void WriteValue(
void *ptr, VarType conv, int64 val);
1110 void SlSetArrayIndex(uint index);
1119 size_t SlCalcObjMemberLength(
const void *
object,
const SaveLoad &sld);
1126 void SlCopy(
void *
object,
size_t length, VarType conv);
1130 void NORETURN
SlError(
StringID string,
const char *extra_msg =
nullptr);
char title[255]
Internal name of the game.
@ SL_NULL
Save null-bytes and load to nowhere.
@ SGT_INVALID
broken savegame (used internally)
@ SLV_187
187 25899 Linkgraph - restricted flows
SaveLoadVersion version_to
Save/load the variable before this savegame version.
@ SLV_186
186 25833 Objects storage
@ REF_ORDER
Load/save a reference to an order.
SaveLoadType
Type of data saved.
Default handler for saving/loading an object to/from disk.
@ SLV_RIFF_TO_ARRAY
294 PR#9375 Changed many CH_RIFF chunks to CH_ARRAY chunks.
@ SLV_LINKGRAPH_TRAVEL_TIME
297 PR#9457 Store travel time in the linkgraph.
@ SLE_VAR_STR
string pointer
@ SLV_TREES_WATER_CLASS
213 PR#7405 WaterClass update for tree tiles.
static VarType GetVarFileType(VarType type)
Get the FileType of a setting.
void NORETURN SlErrorCorrupt(const char *msg)
Error handler for corrupt savegames.
@ SLV_ROAD_TYPES
214 PR#6811 NewGRF road types.
@ SL_MIN_VERSION
First savegame version.
@ REF_TOWN
Load/save a reference to a town.
@ SL_STR
Save/load a string.
void ProcessAsyncSaveFinish()
Handle async save finishes.
@ REF_ROADSTOPS
Load/save a reference to a bus/truck stop.
void SetTitle(const char *title)
Set the title of the file.
@ SLE_FILE_END
Used to mark end-of-header in tables.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
@ SLV_GROUP_REPLACE_WAGON_REMOVAL
291 PR#7441 Per-group wagon removal flag.
@ SLV_198
198 PR#6763 Switch town growth rate and counter to actual game ticks
SaveLoadOperation
Operation performed on the file.
std::string name
Name of the file.
bool _do_autosave
are we doing an autosave at the moment?
size_t size
The sizeof size.
@ SLF_ALLOW_NEWLINE
Allow new lines in the strings.
#define SLE_STR(base, variable, type, length)
Storage of a string in every savegame version.
@ SLV_SHIPS_STOP_IN_LOCKS
206 PR#7150 Ship/lock movement changes.
@ SLV_FIX_CARGO_MONITOR
207 PR#7175 v1.9 Cargo monitor data packing fix to support 64 cargotypes.
@ SGT_TTDP1
TTDP savegame ( -//- ) (data at NW border)
virtual void FixPointers(void *object) const
A post-load callback to fix SL_REF integers into pointers.
Deals with the type of the savegame, independent of extension.
void SetName(const char *name)
Set the name of the file.
@ SLE_VAR_NULL
useful to write zeros in savegame.
SaveOrLoadResult SaveOrLoad(const std::string &filename, SaveLoadOperation fop, DetailedFileType dft, Subdirectory sb, bool threaded=true)
Main Save or Load function where the high-level saveload functions are handled.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
SaveLoadTable GetLoadDescription() const
Get the description for how to load the chunk.
ChunkType type
Type of the chunk.
uint16 length
(Conditional) length of the variable (eg. arrays) (max array size is 65536 elements).
void FixPointers(void *object) const override
A post-load callback to fix SL_REF integers into pointers.
@ SLV_SERVE_NEUTRAL_INDUSTRIES
210 PR#7234 Company stations can serve industries with attached neutral stations.
@ SLV_REMOVE_OPF
212 PR#7245 Remove OPF.
void SlGlobList(const SaveLoadTable &slt)
Save or Load (a list of) global variables.
const SaveLoadVersion SAVEGAME_VERSION
current savegame version
static bool IsSavegameVersionBeforeOrAt(SaveLoadVersion major)
Checks whether the savegame is below or at major.
Handlers and description of chunk.
VarType conv
Type of the variable to be saved; this field combines both FileVarType and MemVarType.
void SlSetStructListLength(size_t length)
Set the length of this list.
@ SLV_GROUP_LIVERIES
205 PR#7108 Livery storage change and group liveries.
Handler for saving/loading an object to/from disk.
size_t SlGetStructListLength(size_t limit)
Get the length of this list; if it exceeds the limit, error out.
@ SLV_EXTEND_PERSISTENT_STORAGE
201 PR#6885 Extend NewGRF persistent storages.
std::string name
Name of the field.
@ SLE_FILE_TYPE_MASK
Mask to get the file-type (and not any flags).
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
void GenerateDefaultSaveName(char *buf, const char *last)
Fill the buffer with the default name for a savegame or screenshot.
const char * GetSaveLoadErrorString()
Get the string representation of the error message.
@ REF_STATION
Load/save a reference to a station.
void SlWriteByte(byte b)
Wrapper for writing a byte to the dumper.
@ SLE_VAR_STRB
string (with pre-allocated buffer)
static bool IsNumericType(VarType conv)
Check if the given saveload type is a numeric type.
@ SLV_EXTEND_INDUSTRY_CARGO_SLOTS
202 PR#6867 Increase industry cargo slots to 16 in, 16 out
AbstractFileType
The different abstract types of files that the system knows about.
AbstractFileType abstract_ftype
Abstract type of file (scenario, heightmap, etc).
void SlSetLength(size_t length)
Sets the length of either a RIFF object or the number of items in an array.
@ SLV_5
5.0 1429 5.1 1440 5.2 1525 0.3.6
@ SL_SAVEBYTE
Save (but not load) a byte.
@ SLF_ALLOW_CONTROL
Allow control codes in the strings.
@ SLE_FILE_HAS_LENGTH_FIELD
Bit stored in savegame to indicate field has a length field for each entry.
SavegameType
Types of save games.
@ CH_TYPE_MASK
All ChunkType values have to be within this mask.
A trimmed down version of what std::span will be in C++20.
virtual void Save() const
Save the chunk.
@ CH_READONLY
Chunk is never saved.
@ SLV_TABLE_CHUNKS
295 PR#9322 Introduction of CH_TABLE and CH_SPARSE_TABLE.
void SetSaveLoadError(StringID str)
Set the error message from outside of the actual loading/saving of the game (AfterLoadGame and friend...
@ SLV_MULTITILE_DOCKS
216 PR#7380 Multiple docks per station.
uint32 id
Unique ID (4 letters).
@ SL_VAR
Save/load a variable.
@ SLV_11
11.0 2033 11.1 2041
@ SLV_REMOVE_TOWN_CARGO_CACHE
219 PR#8258 Remove town cargo acceptance and production caches.
@ SLV_SCRIPT_MEMLIMIT
215 PR#7516 Limit on AI/GS memory consumption.
size_t extra_data
Extra data for the callback proc.
@ SL_REINIT
error that was caught in the middle of updating game state, need to clear it. (can only happen during...
SaveLoadType cmd
The action to take with the saved/loaded type, All types need different action.
@ SLV_END_PATCHPACKS
286 Last known patchpack to use a version just above ours.
@ SLV_CUSTOM_SUBSIDY_DURATION
292 PR#9081 Configurable subsidy duration.
SLRefType
Type of reference (SLE_REF, SLE_CONDREF).
uint16 length
Length of the NULL field.
void SlAutolength(AutolengthProc *proc, void *arg)
Do something of which I have no idea what it is :P.
@ SLV_ROADVEH_PATH_CACHE
211 PR#7261 Add path cache for road vehicles.
@ SLV_TOWN_CARGOGEN
208 PR#6965 New algorithms for town building cargo generation.
@ SLV_MAPGEN_SETTINGS_REVAMP
290 PR#8891 v1.11 Revamp of some mapgen settings (snow coverage, desert coverage, heightmap height,...
@ SLV_EXTEND_CARGOTYPES
199 PR#6802 Extend cargotypes to 64
@ SL_ARR
Save/load a fixed-size array of SL_VAR elements.
@ SLE_FILE_STRINGID
StringID offset into strings-array.
@ REF_STORAGE
Load/save a reference to a persistent storage.
SaveLoadVersion
SaveLoad versions Previous savegame versions, the trunk revision where they were introduced and the r...
@ SLV_183
183 25363 Cargodist
static bool IsSavegameVersionBefore(SaveLoadVersion major, byte minor=0)
Checks whether the savegame is below major.
virtual void Save(void *object) const
Save the object to disk.
@ REF_ENGINE_RENEWS
Load/save a reference to an engine renewal (autoreplace).
@ REF_VEHICLE
Load/save a reference to a vehicle.
@ SL_REF
Save/load a reference.
@ REF_CARGO_PACKET
Load/save a reference to a cargo packet.
@ SL_STRUCT
Save/load a struct.
FileToSaveLoad _file_to_saveload
File to save or load in the openttd loop.
void Save(void *object) const override
Save the object to disk.
@ SLV_182
182 25115 FS#5492, r25259, r25296 Goal status
@ REF_VEHICLE_OLD
Load/save an old-style reference to a vehicle (for pre-4.4 savegames).
@ SLV_17
17.0 3212 17.1 3218
@ SLV_SHIP_CURVE_PENALTY
209 PR#7289 Configurable ship curve penalties.
@ SLV_INDUSTRY_TEXT
289 PR#8576 v1.11.0-RC1 Additional GS text for industries.
virtual void Load() const =0
Load the chunk.
std::string _savegame_format
how to compress savegames
void DoExitSave()
Do a save when exiting the game (_settings_client.gui.autosave_on_exit)
virtual void FixPointers() const
Fix the pointers.
@ SLV_2
2.0 0.3.0 2.1 0.3.1, 0.3.2
std::shared_ptr< SaveLoadHandler > handler
Custom handler for Save/Load procs.
static bool SlIsObjectCurrentlyValid(SaveLoadVersion version_from, SaveLoadVersion version_to)
Checks if some version from/to combination falls within the range of the active savegame version.
@ SLV_SCRIPT_INT64
296 PR#9415 SQInteger is 64bit but was saved as 32bit.
@ SL_VECTOR
Save/load a vector of SL_VAR elements.
@ SL_MAX_VERSION
Highest possible saveload version.
SaveLoadVersion version_to
Save/load the variable before this savegame version.
@ REF_LINK_GRAPH_JOB
Load/save a reference to a link graph job.
virtual SaveLoadTable GetDescription() const =0
Get the description of the fields in the savegame.
@ SGT_TTD
TTD savegame (can be detected incorrectly)
uint32 StringID
Numeric value that represents a string, independent of the selected language.
void NORETURN SlErrorCorruptFmt(const char *format,...)
Issue an SlErrorCorrupt with a format string.
@ SLV_16
16.0 2817 16.1 3155
SaveLoad information for backwards compatibility.
void DoAutoOrNetsave(FiosNumberedSaveName &counter)
Create an autosave or netsave.
void LoadCheck(void *object) const override
Similar to load, but used only to validate savegames.
A savegame name automatically numbered.
@ REF_ORDERLIST
Load/save a reference to an orderlist.
DetailedFileType
Kinds of files in each AbstractFileType.
@ SLV_189
189 26450 Hierarchical vehicle subgroups
@ SLV_VEH_MOTION_COUNTER
288 PR#8591 Desync safe motion counter
@ SLV_GS_INDUSTRY_CONTROL
287 PR#7912 and PR#8115 GS industry control.
@ SL_REFLIST
Save/load a list of SL_REF elements.
VarTypes
VarTypes is the general bitmasked magic type that tells us certain characteristics about the variable...
Interface for filtering a savegame till it is written.
static VarType GetVarMemType(VarType type)
Get the NumberType of a setting.
byte _sl_minor_version
the minor savegame version, DO NOT USE!
SaveLoadTable GetDescription() const override
Get the description of the fields in the savegame.
byte SlReadByte()
Wrapper for reading a byte from the buffer.
virtual void Load(void *object) const
Load the object from disk.
SaveLoadCompatTable GetCompatDescription() const override
Get the pre-header description of the fields in the savegame.
virtual void LoadCheck(void *object) const
Similar to load, but used only to validate savegames.
@ SLV_184
184 25508 Unit localisation split
Subdirectory
The different kinds of subdirectories OpenTTD uses.
SaveLoadVersion version_from
Save/load the variable starting from this savegame version.
SaveOrLoadResult
Save or load result codes.
FiosType
Elements of a file system that are recognized.
@ SLV_ENDING_YEAR
218 PR#7747 v1.10 Configurable ending year.
@ SLE_VAR_STRQ
string pointer enclosed in quotes
ChunkType
Type of a chunk.
size_t SlGetFieldLength()
Get the length of the current object.
@ SLV_TRADING_AGE
217 PR#7780 Configurable company trading age.
@ SLV_188
188 26169 v1.4 FS#5831 Unify RV travel time
@ REF_LINK_GRAPH
Load/save a reference to a link graph.
@ SLV_SHIP_PATH_CACHE
203 PR#7072 Add path cache for ships
Interface for filtering a savegame till it is loaded.
@ SLV_173
173 23967 1.2.0-RC1
@ SL_DEQUE
Save/load a deque of SL_VAR elements.
@ SLV_185
185 25620 Storybooks
@ SLV_SAVELOAD_LIST_LENGTH
293 PR#9374 Consistency in list length with SL_STRUCT / SL_STRUCTLIST / SL_DEQUE / SL_REFLIST.
static void * GetVariableAddress(const void *object, const SaveLoad &sld)
Get the address of the variable.
void SlCopy(void *object, size_t length, VarType conv)
Copy a list of SL_VARs to/from a savegame.
SaveOrLoadResult LoadWithFilter(struct LoadFilter *reader)
Load the game using a (reader) filter.
void WriteValue(void *ptr, VarType conv, int64 val)
Write the value of a setting.
@ SLV_195
195 27572 v1.6.1
std::vector< SaveLoad > SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct)
Load a table header in a savegame compatible way.
@ SLV_191
191 26636 FS#6026 Fix disaster vehicle storage (No bump) 191 26646 FS#6041 Linkgraph - store location...
@ SLV_192
192 26700 FS#6066 Fix saving of order backups
SaveOrLoadResult SaveWithFilter(struct SaveFilter *writer, bool threaded)
Save the game using a (writer) filter.
@ SL_ERROR
error that was caught before internal structures were modified
DetailedFileType detail_ftype
Concrete file type (PNG, BMP, old save, etc).
SaveLoadAddrProc * address_proc
Callback proc the get the actual variable address in memory.
std::string name
Name of this field (optional, used for tables).
void NORETURN bool SaveloadCrashWithMissingNewGRFs()
Did loading the savegame cause a crash? If so, were NewGRFs missing?
virtual void LoadCheck(size_t len=0) const
Load the chunk for game preview.
virtual SaveLoadCompatTable GetCompatDescription() const =0
Get the pre-header description of the fields in the savegame.
@ SLV_START_PATCHPACKS
220 First known patchpack to use a version just above ours.
@ SLV_4
4.0 1 4.1 122 0.3.3, 0.3.4 4.2 1222 0.3.5 4.3 1417 4.4 1426
void SetMode(FiosType ft)
Set the mode and file type of the file to save or load based on the type of file entry at the file sy...
@ SL_OK
completed successfully
SaveLoadVersion version_from
Save/load the variable starting from this savegame version.
@ SL_STDSTR
Save/load a std::string.
@ SGT_TTDP2
TTDP savegame in new format (data at SE border)
static void SlSkipBytes(size_t length)
Read in bytes from the file/data structure but don't do anything with them, discarding them in effect...
SaveLoadVersion _sl_version
the major savegame version identifier
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
@ SLE_VAR_NAME
old custom name to be converted to a char pointer
size_t SlCalcObjLength(const void *object, const SaveLoadTable &slt)
Calculate the size of an object.
void NORETURN SlError(StringID string, const char *extra_msg=nullptr)
Error handler.
@ SLV_13
13.1 2080 0.4.0, 0.4.0.1
@ SLV_190
190 26547 Separate order travel and wait times
SaveLoadOperation file_op
File operation to perform.
@ SLV_SHIP_ROTATION
204 PR#7065 Add extra rotation stages for ships.
void Load(void *object) const override
Load the object from disk.
@ SL_STRUCTLIST
Save/load a list of structs.
@ SLV_EXTEND_RAILTYPES
200 PR#6805 Extend railtypes to 64, adding uint16 to map array.
int64 ReadValue(const void *ptr, VarType conv)
Return a signed-long version of the value of a setting.