10 #include "../stdafx.h" 11 #include "../story_base.h" 15 #include "../safeguards.h" 29 static const SaveLoad _story_page_elements_desc[] = {
40 static void Save_STORY_PAGE_ELEMENT()
43 SlSetArrayIndex(s->index);
44 SlObject(s, _story_page_elements_desc);
48 static void Load_STORY_PAGE_ELEMENT()
51 uint32 max_sort_value = 0;
54 SlObject(s, _story_page_elements_desc);
62 _story_page_element_next_sort_value = max_sort_value + 1;
65 static const SaveLoad _story_pages_desc[] = {
75 static void Save_STORY_PAGE()
78 SlSetArrayIndex(s->index);
83 static void Load_STORY_PAGE()
86 uint32 max_sort_value = 0;
97 _story_page_next_sort_value = max_sort_value + 1;
100 extern const ChunkHandler _story_page_chunk_handlers[] = {
101 {
'STPE', Save_STORY_PAGE_ELEMENT, Load_STORY_PAGE_ELEMENT,
nullptr,
nullptr, CH_ARRAY},
102 {
'STPA', Save_STORY_PAGE, Load_STORY_PAGE,
nullptr,
nullptr, CH_ARRAY |
CH_LAST},
void AfterLoadStoryBook()
Called after load to trash broken pages.
static bool IsSavegameVersionBefore(SaveLoadVersion major, byte minor=0)
Checks whether the savegame is below major.
uint32 sort_value
A number that increases for every created story page element. Used for sorting. The id of a story pag...
Struct about story page elements.
Struct about stories, current and completed.
Functions/types related to saving and loading games.
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Highest possible saveload version.
allow control codes in the strings
uint32 sort_value
A number that increases for every created story page. Used for sorting. The id of a story page is the...
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
Handlers and description of chunk.
#define SLE_END()
End marker of a struct/class save or load.
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
void SlObject(void *object, const SaveLoad *sld)
Main SaveLoad function.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
#define SLE_STR(base, variable, type, length)
Storage of a string in every savegame version.
Last chunk in this array.
virtual void CleanPool()
Virtual method that deletes all items in the pool.