aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel/detection.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2008-12-02 18:34:32 +0000
committerFilippos Karapetis2008-12-02 18:34:32 +0000
commit5bfb248301a917bf08a462791343b0e1637029f0 (patch)
tree31894652c2e0754fec16a4ad7957d96f3414d3f5 /engines/tinsel/detection.cpp
parent702b7be59438ec42b7340a2e8efeefeef0e48b68 (diff)
downloadscummvm-rg350-5bfb248301a917bf08a462791343b0e1637029f0.tar.gz
scummvm-rg350-5bfb248301a917bf08a462791343b0e1637029f0.tar.bz2
scummvm-rg350-5bfb248301a917bf08a462791343b0e1637029f0.zip
- Set the maximum number of save games in DW1 and DW2 to 100, up from 30
- It's now possible to load and delete save games using the GMM (although not through the launcher screen yet) svn-id: r35207
Diffstat (limited to 'engines/tinsel/detection.cpp')
-rw-r--r--engines/tinsel/detection.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp
index e56198c76c..53a7aaea1a 100644
--- a/engines/tinsel/detection.cpp
+++ b/engines/tinsel/detection.cpp
@@ -27,6 +27,7 @@
#include "common/advancedDetector.h"
#include "common/file.h"
+#include "common/savefile.h"
#include "tinsel/tinsel.h"
#include "tinsel/savescn.h" // needed by TinselMetaEngine::listSaves
@@ -344,19 +345,31 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual SaveStateList listSaves(const char *target) const;
+ virtual int getMaximumSaveSlot() const;
+ virtual void removeSaveState(const char *target, int slot) const;
};
bool TinselMetaEngine::hasFeature(MetaEngineFeature f) const {
- return (f == kSupportsListSaves);
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDeleteSave);
+}
+
+bool Tinsel::TinselEngine::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsLoadingDuringRuntime);
}
namespace Tinsel {
extern int getList(Common::SaveFileManager *saveFileMan, const Common::String &target);
+extern void setNeedLoad();
+extern bool MoviePlaying(void);
}
SaveStateList TinselMetaEngine::listSaves(const char *target) const {
+ Tinsel::setNeedLoad();
int numStates = Tinsel::getList(g_system->getSavefileManager(), target);
SaveStateList saveList;
@@ -377,8 +390,30 @@ bool TinselMetaEngine::createInstance(OSystem *syst, Engine **engine, const Comm
return gd != 0;
}
+int TinselMetaEngine::getMaximumSaveSlot() const { return 99; }
+
+void TinselMetaEngine::removeSaveState(const char *target, int slot) const {
+ Tinsel::setNeedLoad();
+ Tinsel::getList(g_system->getSavefileManager(), target);
+
+ g_system->getSavefileManager()->removeSavefile(Tinsel::ListEntry(slot, Tinsel::LE_NAME));
+ Tinsel::setNeedLoad();
+ Tinsel::getList(g_system->getSavefileManager(), target);
+}
+
#if PLUGIN_ENABLED_DYNAMIC(TINSEL)
REGISTER_PLUGIN_DYNAMIC(TINSEL, PLUGIN_TYPE_ENGINE, TinselMetaEngine);
#else
REGISTER_PLUGIN_STATIC(TINSEL, PLUGIN_TYPE_ENGINE, TinselMetaEngine);
#endif
+
+namespace Tinsel {
+
+Common::Error TinselEngine::loadGameState(int slot) {
+ RestoreGame(slot);
+ return Common::kNoError; // TODO: return success/failure
+}
+
+bool TinselEngine::canLoadGameStateCurrently() { return !MoviePlaying(); }
+
+} // End of namespace Tinsel