@@ -153,18 +153,49 @@ struct SavegameDescription
153153 SavegameDescription ();
154154};
155155
156+ // SaveCmpSelection flags tell which save components to restore, and which to skip
157+ enum SaveCmpSelection
158+ {
159+ kSaveCmp_None = 0 ,
160+ kSaveCmp_GameState = 0x00000001 ,
161+ kSaveCmp_Audio = 0x00000002 ,
162+ kSaveCmp_Characters = 0x00000004 ,
163+ kSaveCmp_Dialogs = 0x00000008 ,
164+ kSaveCmp_GUI = 0x00000010 ,
165+ kSaveCmp_InvItems = 0x00000020 ,
166+ kSaveCmp_Cursors = 0x00000040 ,
167+ kSaveCmp_Views = 0x00000080 ,
168+ kSaveCmp_DynamicSprites = 0x00000100 ,
169+ kSaveCmp_Overlays = 0x00000200 ,
170+ kSaveCmp_Scripts = 0x00000400 ,
171+ kSaveCmp_Rooms = 0x00000800 ,
172+ kSaveCmp_ThisRoom = 0x00001000 ,
173+ kSaveCmp_Plugins = 0x00002000 ,
174+ kSaveCmp_All = 0xFFFFFFFF ,
175+
176+ // Components, allowed to be ignored by script's request
177+ kSaveCmp_ScriptIgnoreMask =
178+ kSaveCmp_Audio
179+ | kSaveCmp_Dialogs
180+ | kSaveCmp_GUI
181+ | kSaveCmp_Cursors
182+ | kSaveCmp_Views
183+ | kSaveCmp_DynamicSprites
184+ | kSaveCmp_Plugins
185+ };
186+
156187
157188// Opens savegame for reading; optionally reads description, if any is provided
158189HSaveError OpenSavegame (const String &filename, SavegameSource &src,
159190 SavegameDescription &desc, SavegameDescElem elems = kSvgDesc_All );
160191// Opens savegame and reads the savegame description
161192HSaveError OpenSavegame (const String &filename, SavegameDescription &desc, SavegameDescElem elems = kSvgDesc_All );
162193// Reads the game data from the save stream and reinitializes game state
163- HSaveError RestoreGameState (Stream *in, SavegameVersion svg_version);
194+ HSaveError RestoreGameState (Stream *in, SavegameVersion svg_version, SaveCmpSelection select_cmp );
164195// Opens savegame for writing and puts in savegame description
165196std::unique_ptr<Stream> StartSavegame (const String &filename, const String &user_text, const Bitmap *user_image);
166197// Prepares game for saving state and writes game data into the save stream
167- void SaveGameState (Stream *out);
198+ void SaveGameState (Stream *out, SaveCmpSelection select_cmp );
168199
169200} // namespace Engine
170201} // namespace AGS
0 commit comments