aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure/detection.cpp
diff options
context:
space:
mode:
authorBorja Lorente2016-08-21 16:19:55 +0200
committerBorja Lorente2016-08-21 16:19:55 +0200
commit0d868742d4016f8f50a8135c20115d911d920cf5 (patch)
tree9d958a2908fd897e3121ba8148a0da897c4fb35d /engines/macventure/detection.cpp
parent1210f05842b927ef07b4817552002b97cdd6906e (diff)
downloadscummvm-rg350-0d868742d4016f8f50a8135c20115d911d920cf5.tar.gz
scummvm-rg350-0d868742d4016f8f50a8135c20115d911d920cf5.tar.bz2
scummvm-rg350-0d868742d4016f8f50a8135c20115d911d920cf5.zip
MACVENTURE: Add thumbnail to savegames
Diffstat (limited to 'engines/macventure/detection.cpp')
-rw-r--r--engines/macventure/detection.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/engines/macventure/detection.cpp b/engines/macventure/detection.cpp
index 2b161142c4..801cc599cd 100644
--- a/engines/macventure/detection.cpp
+++ b/engines/macventure/detection.cpp
@@ -75,13 +75,16 @@ public:
virtual SaveStateList listSaves(const char *target) const;
virtual int getMaximumSaveSlot() const;
virtual void removeSaveState(const char *target, int slot) const;
+ SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
};
bool MacVentureMetaEngine::hasFeature(MetaEngineFeature f) const {
return
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup) ||
- (f == kSupportsDeleteSave);
+ (f == kSupportsDeleteSave) ||
+ (f == kSavesSupportMetaInfo) ||
+ (f == kSavesSupportThumbnail);
}
bool MacVentureEngine::hasFeature(EngineFeature f) const {
@@ -141,6 +144,30 @@ void MacVentureMetaEngine::removeSaveState(const char *target, int slot) const {
g_system->getSavefileManager()->removeSavefile(Common::String::format("%s.%03d", target, slot));
}
+
+SaveStateDescriptor MacVentureMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+ Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+ SaveStateDescriptor desc;
+ Common::String saveFileName;
+ Common::String pattern = target;
+ pattern += ".###";
+ Common::StringArray filenames = saveFileMan->listSavefiles(pattern);
+ for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
+ int slotNum = atoi(file->c_str() + file->size() - 3);
+ if (slotNum == slot) {
+ saveFileName = *file;
+ }
+ }
+
+ Common::InSaveFile *in = saveFileMan->openForLoading(saveFileName);
+ if (in) {
+ desc = loadMetaData(in, slot);
+ delete in;
+ return desc;
+ }
+ return SaveStateDescriptor(-1, "");
+}
+
} // End of namespace MacVenture
#if PLUGIN_ENABLED_DYNAMIC(MACVENTURE)