aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/detection.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2019-07-22 13:55:06 +0200
committerEugene Sandulenko2019-09-03 17:17:26 +0200
commit312ebf6aaff590cf3a5c66d8064bb7fc88ec95cf (patch)
tree8f22f7d6d5b6dedcb3689a6955975dc70553588e /engines/hdb/detection.cpp
parentd61d93ebe183c29cdc8153df7dc9109ee71dc347 (diff)
downloadscummvm-rg350-312ebf6aaff590cf3a5c66d8064bb7fc88ec95cf.tar.gz
scummvm-rg350-312ebf6aaff590cf3a5c66d8064bb7fc88ec95cf.tar.bz2
scummvm-rg350-312ebf6aaff590cf3a5c66d8064bb7fc88ec95cf.zip
HDB: Load thumbnail from the launcher
Diffstat (limited to 'engines/hdb/detection.cpp')
-rw-r--r--engines/hdb/detection.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/engines/hdb/detection.cpp b/engines/hdb/detection.cpp
index e236a6c60f..245787f92f 100644
--- a/engines/hdb/detection.cpp
+++ b/engines/hdb/detection.cpp
@@ -109,6 +109,7 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual int getMaximumSaveSlot() const;
virtual SaveStateList listSaves(const char *target) const;
+ SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
};
@@ -174,6 +175,32 @@ SaveStateList HDBMetaEngine::listSaves(const char *target) const {
return saveList;
}
+SaveStateDescriptor HDBMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+ Common::ScopedPtr<Common::InSaveFile> in(g_system->getSavefileManager()->openForLoading(Common::String::format("%s.%03d", target, slot)));
+
+ if (in) {
+ SaveStateDescriptor desc;
+ char mapName[32];
+ Graphics::Surface *thumbnail;
+
+ if (!Graphics::loadThumbnail(*in, thumbnail)) {
+ warning("Error loading thumbnail");
+ }
+ desc.setThumbnail(thumbnail);
+
+ uint32 timeSeconds = in->readUint32LE();;
+ in->read(mapName, 32);
+
+ desc.setSaveSlot(slot);
+ desc.setPlayTime(timeSeconds * 1000);
+ desc.setDescription(mapName);
+
+ return desc;
+ }
+
+ return SaveStateDescriptor();
+}
+
bool HDBMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
if (desc) {
*engine = new HDB::HDBGame(syst, desc);