ScummVM API documentation
saves.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef XEEN_SAVES_H
23 #define XEEN_SAVES_H
24 
25 #include "common/scummsys.h"
26 #include "common/savefile.h"
27 #include "common/serializer.h"
28 #include "common/str.h"
29 #include "graphics/surface.h"
30 #include "mm/xeen/party.h"
31 
32 namespace MM {
33 namespace Xeen {
34 
35 enum {
36  kAutoSaveSlot = 0
37 };
38 
40  uint8 _version;
41  Common::String _saveName;
42  Graphics::Surface *_thumbnail;
43  int _year, _month, _day;
44  int _hour, _minute;
45  int _totalFrames;
46 };
47 
48 class SavesManager {
49 private:
50  Common::String _targetName;
51 private:
55  void reset();
56 public:
57  bool _wonWorld;
58  bool _wonDarkSide;
59 public:
60  SavesManager(const Common::String &targetName);
61  ~SavesManager();
62 
66  WARN_UNUSED_RESULT static bool readSavegameHeader(Common::InSaveFile *in, XeenSavegameHeader &header, bool skipThumbnail = true);
67 
71  void writeSavegameHeader(Common::OutSaveFile *out, XeenSavegameHeader &header);
72 
76  Common::Error loadGameState(int slot);
77 
81  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false);
82 
86  void doAutosave();
87 
91  void newGame();
92 
97  bool loadGame();
98 
103  bool saveGame();
104 };
105 
106 } // End of namespace Xeen
107 } // End of namespace MM
108 
109 #endif
Definition: str.h:59
Definition: surface.h:67
Definition: savefile.h:54
Definition: error.h:84
Definition: stream.h:745
Definition: saves.h:48
Definition: detection.h:27
bool skipThumbnail(Common::SeekableReadStream &in)
Definition: saves.h:39