26 _story_page_element_pool.CleanPool();
27 _story_page_pool.CleanPool();
31static const SaveLoad _story_page_elements_desc[] = {
41struct STPEChunkHandler : ChunkHandler {
49 SlSetArrayIndex(s->index);
50 SlObject(s, _story_page_elements_desc);
59 uint32_t max_sort_value = 0;
70 _story_page_element_next_sort_value = max_sort_value + 1;
74static const SaveLoad _story_pages_desc[] = {
83struct STPAChunkHandler : ChunkHandler {
91 SlSetArrayIndex(s->index);
101 uint32_t max_sort_value = 0;
112 _story_page_next_sort_value = max_sort_value + 1;
123extern const ChunkHandlerTable _story_page_chunk_handlers(story_page_chunk_handlers);
A number of safeguards to prevent using unsafe methods.
std::vector< SaveLoad > SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct)
Load a table header in a savegame compatible way.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
Functions/types related to saving and loading games.
@ U8
A 8 bit unsigned int.
@ U32
A 32 bit unsigned int.
@ U16
A 16 bit unsigned int.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
bool IsSavegameVersionBefore(SaveLoadVersion major, uint8_t minor=0)
Checks whether the savegame is below major.
#define SLE_SSTR(base, variable, type)
Storage of a std::string in every savegame version.
@ MinVersion
First savegame version.
@ Storybooks
Saveload version: 185, SVN revision: 25620 Storybooks.
@ MaxVersion
Highest possible saveload version.
@ Table
An Array with a header describing the elements.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition of base types and functions in a cross-platform compatible way.
void AfterLoadStoryBook()
Called after load to trash broken pages.
Loading for story chunks before table headers were added.
const SaveLoadCompat _story_page_elements_sl_compat[]
Original field order for _story_page_elements_desc.
const SaveLoadCompat _story_pages_sl_compat[]
Original field order for _story_pages_desc.
PoolID< uint16_t, struct StoryPageIDTag, 64000, 0xFFFF > StoryPageID
ID of a story page.
PoolID< uint16_t, struct StoryPageElementIDTag, 64000, 0xFFFF > StoryPageElementID
ID of a story page element.
@ AllowControlCode
Allow the special control codes.
static Pool::IterateWrapper< StoryPageElement > Iterate(size_t from=0)
static T * CreateAtIndex(StoryPageElementID index, Targs &&... args)
void Load() const override
Load the chunk.
void Save() const override
Save the chunk.
void Load() const override
Load the chunk.
void Save() const override
Save the chunk.
Struct about story page elements.
uint32_t sort_value
A number that increases for every created story page element. Used for sorting. The id of a story pag...
Struct about stories, current and completed.
uint32_t sort_value
A number that increases for every created story page. Used for sorting. The id of a story page is the...
static constexpr VarType U16
Store a 16 bits unsigned int.
static constexpr VarType U8
Store a 8 bits unsigned int.
static constexpr VarType STR
Store string.
static constexpr VarType U32
Store a 32 bits unsigned int.