From 9bd7bc87b6bc33321298ddeba6fa490c8a34d527 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 4 Nov 2018 18:02:36 -0800 Subject: GLK: Added savegame meta info retrieval --- engines/gargoyle/detection.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'engines') 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(); } -- cgit v1.2.3