aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel/detection.cpp
diff options
context:
space:
mode:
authorMax Horn2008-09-01 21:13:11 +0000
committerMax Horn2008-09-01 21:13:11 +0000
commit40e05acff329563df6432ad998f99074acb43486 (patch)
treeee780348f9643bf5a36cfc21403b256d8a19b562 /engines/tinsel/detection.cpp
parent4567cfc61c3981e4ed9da89ff07bfac7424c5fe3 (diff)
downloadscummvm-rg350-40e05acff329563df6432ad998f99074acb43486.tar.gz
scummvm-rg350-40e05acff329563df6432ad998f99074acb43486.tar.bz2
scummvm-rg350-40e05acff329563df6432ad998f99074acb43486.zip
TINSEL: Enabled listSaves support
svn-id: r34263
Diffstat (limited to 'engines/tinsel/detection.cpp')
-rw-r--r--engines/tinsel/detection.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp
index f4fe876290..bf59aae19b 100644
--- a/engines/tinsel/detection.cpp
+++ b/engines/tinsel/detection.cpp
@@ -29,6 +29,7 @@
#include "common/file.h"
#include "tinsel/tinsel.h"
+#include "tinsel/savescn.h" // needed by TinselMetaEngine::listSaves
namespace Tinsel {
@@ -309,13 +310,42 @@ public:
}
virtual const char *getCopyright() const {
+ // FIXME: Bad copyright string.
+ // Should be something like "Tinsel (C) Psygnosis" or so... ???
return "Tinsel Engine";
}
virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
+ virtual bool hasFeature(MetaEngineFeature f) const;
+ virtual SaveStateList listSaves(const char *target) const;
};
+bool TinselMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves);
+}
+
+namespace Tinsel {
+extern int getList(Common::SaveFileManager *saveFileMan, const Common::String &target);
+}
+
+SaveStateList TinselMetaEngine::listSaves(const char *target) const {
+ int numStates = Tinsel::getList(g_system->getSavefileManager(), target);
+
+ SaveStateList saveList;
+ for (int i = 0; i < numStates; i++) {
+ SaveStateDescriptor sd(i,
+ Tinsel::ListEntry(i, Tinsel::LE_DESC),
+ Tinsel::ListEntry(i, Tinsel::LE_NAME));
+ // TODO: Also add savedFiles[i].dateTime to the SaveStateDescriptor
+ saveList.push_back(sd);
+ }
+
+ return saveList;
+}
+
+
bool TinselMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
const Tinsel::TinselGameDescription *gd = (const Tinsel::TinselGameDescription *)desc;
if (gd) {