|
OpenTTD Source 20260731-master-g77ba2b244a
|
#include <saveload.h>
Public Types | |
| using | AddressFunction = const void *(*)(const void *base, size_t extra) |
| Function that returns the address of a variable. | |
Data Fields | |
| std::string | name |
| Name of this field (optional, used for tables). | |
| SaveLoadType | cmd |
| The action to take with the saved/loaded type, All types need different action. | |
| VarType | conv |
| Type of the variable to be saved; this field combines both FileVarType and MemVarType. | |
| uint16_t | length |
| (Conditional) length of the variable (eg. arrays) (max array size is 65536 elements). | |
| SaveLoadVersion | version_from |
| Save/load the variable starting from this savegame version. | |
| SaveLoadVersion | version_to |
| Save/load the variable before this savegame version. | |
| AddressFunction | address_func |
| Callback function the get the actual variable address in memory. | |
| size_t | extra_data |
| Extra data for the callback proc. | |
| std::shared_ptr< SaveLoadHandler > | handler |
| Custom handler for Save/Load procs. | |
SaveLoad type struct.
Do NOT use this directly but use the SLE_ macros defined just below!
Definition at line 765 of file saveload.h.
| using SaveLoad::AddressFunction = const void *(*)(const void *base, size_t extra) |
Function that returns the address of a variable.
| base | In case the variable comes from an object, this is the pointer to the begin of that object. Will be non-nullptr for objects, can be both non-nullptr and nullptr for global variables. |
| extra | An extra offset to apply. Mostly 0, except for a few LinkGraph settings variables. |
Definition at line 773 of file saveload.h.
| AddressFunction SaveLoad::address_func |
Callback function the get the actual variable address in memory.
Definition at line 781 of file saveload.h.
Referenced by GetVariableAddress().
| SaveLoadType SaveLoad::cmd |
The action to take with the saved/loaded type, All types need different action.
Definition at line 776 of file saveload.h.
Referenced by GetSavegameFileType(), GetSettingsDesc(), SlCompatTableHeader(), and SlTableHeader().
| VarType SaveLoad::conv |
Type of the variable to be saved; this field combines both FileVarType and MemVarType.
Definition at line 777 of file saveload.h.
Referenced by GetSavegameFileType(), GetSettingsDesc(), GetVariableAddress(), and SetSettingValue().
| size_t SaveLoad::extra_data |
Extra data for the callback proc.
Definition at line 782 of file saveload.h.
Referenced by GetVariableAddress().
| std::shared_ptr<SaveLoadHandler> SaveLoad::handler |
Custom handler for Save/Load procs.
Definition at line 783 of file saveload.h.
Referenced by SlCompatTableHeader(), and SlTableHeader().
| uint16_t SaveLoad::length |
(Conditional) length of the variable (eg. arrays) (max array size is 65536 elements).
Definition at line 778 of file saveload.h.
Referenced by GetSettingsDesc().
| std::string SaveLoad::name |
Name of this field (optional, used for tables).
Definition at line 775 of file saveload.h.
Referenced by SettingDesc::GetName(), SlCompatTableHeader(), and SlTableHeader().
| SaveLoadVersion SaveLoad::version_from |
Save/load the variable starting from this savegame version.
Definition at line 779 of file saveload.h.
Referenced by CmdChangeSetting(), GetSaveLoadFromSettingTable(), GetSettingFromName(), GetSettingsDesc(), IniLoadSettings(), IniSaveSettings(), LoadSettings(), SlIsObjectValidInSavegame(), and SurveySettingsTable().
| SaveLoadVersion SaveLoad::version_to |
Save/load the variable before this savegame version.
Definition at line 780 of file saveload.h.
Referenced by CmdChangeSetting(), GetSaveLoadFromSettingTable(), GetSettingFromName(), GetSettingsDesc(), IniLoadSettings(), IniSaveSettings(), LoadSettings(), SlIsObjectValidInSavegame(), and SurveySettingsTable().