12 #include "../stdafx.h" 13 #include "../story_base.h" 17 #include "../safeguards.h" 31 static const SaveLoad _story_page_elements_desc[] = {
42 static void Save_STORY_PAGE_ELEMENT()
45 FOR_ALL_STORY_PAGE_ELEMENTS(s) {
46 SlSetArrayIndex(s->
index);
47 SlObject(s, _story_page_elements_desc);
51 static void Load_STORY_PAGE_ELEMENT()
54 uint32 max_sort_value = 0;
57 SlObject(s, _story_page_elements_desc);
65 _story_page_element_next_sort_value = max_sort_value + 1;
68 static const SaveLoad _story_pages_desc[] = {
78 static void Save_STORY_PAGE()
81 FOR_ALL_STORY_PAGES(s) {
82 SlSetArrayIndex(s->
index);
87 static void Load_STORY_PAGE()
90 uint32 max_sort_value = 0;
101 _story_page_next_sort_value = max_sort_value + 1;
104 extern const ChunkHandler _story_page_chunk_handlers[] = {
105 {
'STPE', Save_STORY_PAGE_ELEMENT, Load_STORY_PAGE_ELEMENT, NULL, NULL, CH_ARRAY},
106 {
'STPA', Save_STORY_PAGE, Load_STORY_PAGE, NULL, NULL, CH_ARRAY |
CH_LAST},
void AfterLoadStoryBook()
Called after load to trash broken pages.
uint32 sort_value
A number that increases for every created story page element. Used for sorting. The id of a story pag...
Tindex index
Index of this pool item.
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.
allow control codes in the strings
#define SL_MAX_VERSION
Highest possible savegame version.
static bool IsSavegameVersionBefore(uint16 major, byte minor=0)
Checks whether the savegame is below major.
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.
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.