aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst_state.h
diff options
context:
space:
mode:
authorBastien Bouclet2016-02-22 08:31:02 +0100
committerBastien Bouclet2016-02-22 08:44:55 +0100
commit7044996cd530d1e0efa6a521be85c07111eb76df (patch)
treede7fd824bf1425aa1a3e5359a0312797234ede57 /engines/mohawk/myst_state.h
parent6f56f2efe129e55d7ac5cf35378dd385d3f0547b (diff)
downloadscummvm-rg350-7044996cd530d1e0efa6a521be85c07111eb76df.tar.gz
scummvm-rg350-7044996cd530d1e0efa6a521be85c07111eb76df.tar.bz2
scummvm-rg350-7044996cd530d1e0efa6a521be85c07111eb76df.zip
MOHAWK: Add support for the ScummVM save metadata features
The metadata is saved in a separate file to keep compatibility with the original engine saves.
Diffstat (limited to 'engines/mohawk/myst_state.h')
-rw-r--r--engines/mohawk/myst_state.h37
1 files changed, 33 insertions, 4 deletions
diff --git a/engines/mohawk/myst_state.h b/engines/mohawk/myst_state.h
index b07a0f2469..50359a5b52 100644
--- a/engines/mohawk/myst_state.h
+++ b/engines/mohawk/myst_state.h
@@ -27,6 +27,8 @@
#include "common/file.h"
#include "common/str.h"
+#include "engines/savestate.h"
+
namespace Common {
class Serializer;
}
@@ -35,15 +37,33 @@ namespace Mohawk {
class MohawkEngine_Myst;
+struct MystSaveMetadata {
+ uint8 saveDay;
+ uint8 saveMonth;
+ uint16 saveYear;
+
+ uint8 saveHour;
+ uint8 saveMinute;
+
+ uint32 totalPlayTime;
+
+ Common::String saveDescription;
+
+ MystSaveMetadata();
+ bool sync(Common::Serializer &s);
+};
+
class MystGameState {
public:
MystGameState(MohawkEngine_Myst*, Common::SaveFileManager*);
~MystGameState();
- Common::StringArray generateSaveGameList();
- bool load(const Common::String &);
- bool save(const Common::String &);
- void deleteSave(const Common::String &);
+ static Common::StringArray generateSaveGameList();
+ static SaveStateDescriptor querySaveMetaInfos(const Common::String filename);
+
+ bool load(const Common::String &filename);
+ bool save(const Common::String &filename);
+ static void deleteSave(const Common::String &saveName);
void addZipDest(uint16 stack, uint16 view);
bool isReachableZipDest(uint16 stack, uint16 view);
@@ -268,8 +288,17 @@ public:
uint32 generatorDepletionTime;
} _stoneship;
+ MystSaveMetadata _metadata;
+
private:
void syncGameState(Common::Serializer &s, bool isME);
+ static Common::InSaveFile *openMetadataFile(const Common::String &filename);
+ bool loadState(const Common::String &filename);
+ void loadMetadata(const Common::String &filename);
+ bool saveState(const Common::String &desc);
+ void updateMetadateForSaving(const Common::String &desc);
+ bool saveMetadata(const Common::String &desc);
+ static Common::String removeExtension(const Common::String &filename);
// The values in these regions are lists of VIEW resources
// which correspond to visited zip destinations