aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2018-11-04 18:02:36 -0800
committerPaul Gilbert2018-12-08 19:05:59 -0800
commit9bd7bc87b6bc33321298ddeba6fa490c8a34d527 (patch)
tree1831f2b445d9856153c41b22901c37f7eaa08a33 /engines
parent77a4e99c31c6058217b8a55ba5d5d048dc1dea52 (diff)
downloadscummvm-rg350-9bd7bc87b6bc33321298ddeba6fa490c8a34d527.tar.gz
scummvm-rg350-9bd7bc87b6bc33321298ddeba6fa490c8a34d527.tar.bz2
scummvm-rg350-9bd7bc87b6bc33321298ddeba6fa490c8a34d527.zip
GLK: Added savegame meta info retrieval
Diffstat (limited to 'engines')
-rw-r--r--engines/gargoyle/detection.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/engines/gargoyle/detection.cpp b/engines/gargoyle/detection.cpp
index 7ccb2f6311..295e50bd8e 100644
--- a/engines/gargoyle/detection.cpp
+++ b/engines/gargoyle/detection.cpp
@@ -125,10 +125,13 @@ public:
bool GargoyleMetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsListSaves) ||
+ (f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup) ||
(f == kSupportsDeleteSave) ||
- (f == kSavesSupportMetaInfo);
+ (f == kSavesSupportMetaInfo) ||
+ (f == kSavesSupportCreationDate) ||
+ (f == kSavesSupportPlayTime) ||
+ (f == kSimpleSavesNames);
}
bool Gargoyle::GargoyleEngine::hasFeature(EngineFeature f) const {
@@ -192,6 +195,23 @@ void GargoyleMetaEngine::removeSaveState(const char *target, int slot) const {
}
SaveStateDescriptor GargoyleMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+ Common::String filename = Common::String::format("%s.%03d", target, slot);
+ Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename);
+
+ if (in) {
+ Gargoyle::SavegameHeader header;
+ if (Gargoyle::FileStream::readSavegameHeader(in, header)) {
+ // Create the return descriptor
+ SaveStateDescriptor desc(slot, header._saveName);
+ desc.setSaveDate(header._year, header._month, header._day);
+ desc.setSaveTime(header._hour, header._minute);
+ desc.setPlayTime(header._totalFrames * GAME_FRAME_TIME);
+
+ delete in;
+ return desc;
+ }
+ }
+
return SaveStateDescriptor();
}