aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus/detection.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-09-16 09:20:41 -0400
committerMatthew Hoops2011-09-16 09:20:41 -0400
commit2ae8a97c4d915b04e9824f2478812041e4c088f0 (patch)
treee6ba8803ab09e923e8fc5d5205baa079381bedbf /engines/pegasus/detection.cpp
parentecde87260c1db0de463f294b551402c08e731d0e (diff)
downloadscummvm-rg350-2ae8a97c4d915b04e9824f2478812041e4c088f0.tar.gz
scummvm-rg350-2ae8a97c4d915b04e9824f2478812041e4c088f0.tar.bz2
scummvm-rg350-2ae8a97c4d915b04e9824f2478812041e4c088f0.zip
PEGASUS: Stub off loading/saving games
Diffstat (limited to 'engines/pegasus/detection.cpp')
-rw-r--r--engines/pegasus/detection.cpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/engines/pegasus/detection.cpp b/engines/pegasus/detection.cpp
index 9c486f7548..af651c8f22 100644
--- a/engines/pegasus/detection.cpp
+++ b/engines/pegasus/detection.cpp
@@ -25,6 +25,7 @@
#include "engines/advancedDetector.h"
#include "common/config-manager.h"
#include "common/file.h"
+#include "common/savefile.h"
#include "pegasus/pegasus.h"
@@ -36,7 +37,9 @@ struct PegasusGameDescription {
bool PegasusEngine::hasFeature(EngineFeature f) const {
return
- (f == kSupportsRTL);
+ (f == kSupportsRTL)
+ || (f == kSupportsLoadingDuringRuntime)
+ || (f == kSupportsSavingDuringRuntime);
}
bool PegasusEngine::isDemo() const {
@@ -98,9 +101,44 @@ public:
return "The Journeyman Project: Pegasus Prime (C) Presto Studios";
}
+ virtual bool hasFeature(MetaEngineFeature f) const;
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
+ virtual SaveStateList listSaves(const char *target) const;
+ virtual int getMaximumSaveSlot() const { return 999; }
+ virtual void removeSaveState(const char *target, int slot) const;
};
+bool PegasusMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves)
+ || (f == kSupportsDeleteSave);
+}
+
+SaveStateList PegasusMetaEngine::listSaves(const char *target) const {
+ // The original had no pattern, so the user must rename theirs
+ // Note that we ignore the target because saves are compatible between
+ // all versions
+ Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles("pegasus-*.sav");
+
+ SaveStateList saveList;
+ for (uint32 i = 0; i < filenames.size(); i++) {
+ // Isolate the description from the file name
+ Common::String desc = filenames[i].c_str() + 8;
+ for (int j = 0; j < 4; j++)
+ desc.deleteLastChar();
+
+ saveList.push_back(SaveStateDescriptor(i, desc));
+ }
+
+ return saveList;
+}
+
+void PegasusMetaEngine::removeSaveState(const char *target, int slot) const {
+ // See listSaves() for info on the pattern
+ Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles("pegasus-*.sav");
+ g_system->getSavefileManager()->removeSavefile(filenames[slot].c_str());
+}
+
bool PegasusMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
const Pegasus::PegasusGameDescription *gd = (const Pegasus::PegasusGameDescription *)desc;