OpenTTD Source 20241224-master-gf74b0cf984
SaveLoadParams Struct Reference

The saveload struct, containing reader-writer functions, buffer, version, etc. More...

Data Fields

SaveLoadAction action
 are we doing a save or a load atm.
 
NeedLength need_length
 working in NeedLength (Autolength) mode?
 
uint8_t block_mode
 ???
 
bool error
 did an error occur or not
 
size_t obj_len
 the length of the current object we are busy with
 
int array_index
 
int last_array_index
 in the case of an array, the current and last positions
 
bool expect_table_header
 In the case of a table, if the header is saved/loaded.
 
std::unique_ptr< MemoryDumperdumper
 Memory dumper to write the savegame to.
 
std::shared_ptr< SaveFiltersf
 Filter to write the savegame to.
 
std::unique_ptr< ReadBufferreader
 Savegame reading buffer.
 
std::shared_ptr< LoadFilterlf
 Filter to read the savegame from.
 
StringID error_str
 the translatable error message to show
 
std::string extra_msg
 the error message
 
bool saveinprogress
 Whether there is currently a save in progress.
 

Detailed Description

The saveload struct, containing reader-writer functions, buffer, version, etc.

Definition at line 178 of file saveload.cpp.

Field Documentation

◆ action

◆ array_index

int SaveLoadParams::array_index

Definition at line 185 of file saveload.cpp.

◆ block_mode

uint8_t SaveLoadParams::block_mode

◆ dumper

std::unique_ptr<MemoryDumper> SaveLoadParams::dumper

Memory dumper to write the savegame to.

Definition at line 188 of file saveload.cpp.

Referenced by ClearSaveLoadState(), DoSave(), SaveFileToDisk(), SlAutolength(), and SlWriteByte().

◆ error

bool SaveLoadParams::error

did an error occur or not

Definition at line 182 of file saveload.cpp.

◆ error_str

StringID SaveLoadParams::error_str

the translatable error message to show

Definition at line 194 of file saveload.cpp.

Referenced by GetSaveLoadErrorMessage(), SaveFileToDisk(), SetSaveLoadError(), and SlError().

◆ expect_table_header

bool SaveLoadParams::expect_table_header

In the case of a table, if the header is saved/loaded.

Definition at line 186 of file saveload.cpp.

Referenced by SlIterateArray(), SlLoadCheckChunk(), SlLoadChunk(), SlSaveChunk(), and SlSetLength().

◆ extra_msg

std::string SaveLoadParams::extra_msg

the error message

Definition at line 195 of file saveload.cpp.

Referenced by GetSaveLoadErrorMessage(), and SlError().

◆ last_array_index

int SaveLoadParams::last_array_index

in the case of an array, the current and last positions

Definition at line 185 of file saveload.cpp.

Referenced by SlSaveChunk(), and SlSetLength().

◆ lf

std::shared_ptr<LoadFilter> SaveLoadParams::lf

Filter to read the savegame from.

Definition at line 192 of file saveload.cpp.

Referenced by ClearSaveLoadState(), DetermineSaveLoadFormat(), and DoLoad().

◆ need_length

NeedLength SaveLoadParams::need_length

working in NeedLength (Autolength) mode?

Definition at line 180 of file saveload.cpp.

Referenced by SlAutolength(), SlCopy(), SlObject(), SlRefList(), SlRefVector(), SlSaveChunk(), SlSetLength(), SlSetStructListLength(), and SlTableHeader().

◆ obj_len

size_t SaveLoadParams::obj_len

the length of the current object we are busy with

Definition at line 184 of file saveload.cpp.

Referenced by SlAutolength(), SlGetFieldLength(), SlIterateArray(), SlLoadCheckChunk(), SlLoadChunk(), and SlSetLength().

◆ reader

std::unique_ptr<ReadBuffer> SaveLoadParams::reader

Savegame reading buffer.

Definition at line 191 of file saveload.cpp.

Referenced by ClearSaveLoadState(), DoLoad(), SlIterateArray(), SlLoadCheckChunk(), SlLoadChunk(), SlReadByte(), and SlSkipArray().

◆ saveinprogress

bool SaveLoadParams::saveinprogress

Whether there is currently a save in progress.

Definition at line 197 of file saveload.cpp.

Referenced by DoSave(), SaveFileDone(), SaveFileStart(), and SaveOrLoad().

◆ sf

std::shared_ptr<SaveFilter> SaveLoadParams::sf

Filter to write the savegame to.

Definition at line 189 of file saveload.cpp.

Referenced by ClearSaveLoadState(), DoSave(), and SaveFileToDisk().


The documentation for this struct was generated from the following file: