ScummVM API documentation
riven_saveload.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 MOHAWK_SAVELOAD_H
23 #define MOHAWK_SAVELOAD_H
24 
25 #include "common/serializer.h"
26 #include "common/savefile.h"
27 #include "common/str.h"
28 #include "common/memstream.h"
29 
30 #include "engines/savestate.h"
31 
32 namespace Mohawk {
33 
34 class MohawkEngine_Riven;
35 
36 enum {
37  kCDSaveGameVersion = 0x00010000,
38  kDVDSaveGameVersion = 0x00010100
39 };
40 
42  uint8 saveDay;
43  uint8 saveMonth;
44  uint16 saveYear;
45 
46  uint8 saveHour;
47  uint8 saveMinute;
48 
49  uint32 totalPlayTime;
50 
51  bool autoSave;
52 
53  Common::String saveDescription;
54 
56  bool sync(Common::Serializer &s);
57 };
58 
60 public:
62  ~RivenSaveLoad();
63 
64  Common::Error loadGame(const int slot);
65  Common::Error saveGame(const int slot, const Common::String &description,
66  const Graphics::Surface *thumbnail, bool autoSave);
67  static void deleteSave(const int slot);
68 
69  static SaveStateDescriptor querySaveMetaInfos(const int slot);
70  static Common::String querySaveDescription(const int slot);
71 
72 private:
73  MohawkEngine_Riven *_vm;
74  Common::SaveFileManager *_saveFileMan;
75 
76  static Common::String buildSaveFilename(const int slot);
77 
78  Common::MemoryWriteStreamDynamic *genNAMESection();
79  Common::MemoryWriteStreamDynamic *genMETASection(const Common::String &desc, bool autoSave) const;
80  Common::MemoryWriteStreamDynamic *genTHMBSection(const Graphics::Surface *thumbnail) const;
81  Common::MemoryWriteStreamDynamic *genVARSSection();
82  Common::MemoryWriteStreamDynamic *genVERSSection();
83  Common::MemoryWriteStreamDynamic *genZIPSSection();
84 };
85 
86 } // End of namespace Mohawk
87 
88 #endif
Definition: str.h:59
Definition: surface.h:66
Definition: error.h:84
Definition: riven_saveload.h:59
Definition: memstream.h:194
Definition: serializer.h:79
Definition: riven.h:91
Definition: savestate.h:56
Definition: riven_saveload.h:41
Definition: savefile.h:142
Definition: bitmap.h:32