diff options
author | Paul Gilbert | 2009-01-31 12:15:21 +0000 |
---|---|---|
committer | Paul Gilbert | 2009-01-31 12:15:21 +0000 |
commit | e2baabcab918165e4fc09345ad48343111342ba8 (patch) | |
tree | 8de11d36d3313da7392d33ce82a844f8f53c93f1 /engines | |
parent | 71dcc140f9e51ab1c6dc99bfd75223557e44cec3 (diff) | |
download | scummvm-rg350-e2baabcab918165e4fc09345ad48343111342ba8.tar.gz scummvm-rg350-e2baabcab918165e4fc09345ad48343111342ba8.tar.bz2 scummvm-rg350-e2baabcab918165e4fc09345ad48343111342ba8.zip |
Enabled runtime save/loading from the GMM menu, and fixed launcher listing of savegames
svn-id: r36164
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lure/detection.cpp | 8 | ||||
-rw-r--r-- | engines/lure/lure.cpp | 2 | ||||
-rw-r--r-- | engines/lure/lure.h | 15 |
3 files changed, 22 insertions, 3 deletions
diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index d62a440731..4499819574 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -26,6 +26,7 @@ #include "base/plugins.h" #include "engines/advancedDetector.h" +#include "engines/engine.h" #include "common/savefile.h" #include "lure/lure.h" @@ -201,7 +202,9 @@ bool LureMetaEngine::hasFeature(MetaEngineFeature f) const { bool Lure::LureEngine::hasFeature(EngineFeature f) const { return - (f == kSupportsRTL); + (f == kSupportsRTL) || + (f == kSupportsLoadingDuringRuntime) || + (f == kSupportsSavingDuringRuntime); } bool LureMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const { @@ -216,8 +219,7 @@ SaveStateList LureMetaEngine::listSaves(const char *target) const { Common::SaveFileManager *saveFileMan = g_system->getSavefileManager(); Common::StringList filenames; Common::String saveDesc; - Common::String pattern = target; - pattern += ".???"; + Common::String pattern = "lure.???"; filenames = saveFileMan->listSavefiles(pattern.c_str()); sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp index 2aa6ea4b5d..32d739ecf1 100644 --- a/engines/lure/lure.cpp +++ b/engines/lure/lure.cpp @@ -51,6 +51,7 @@ LureEngine::LureEngine(OSystem *system, const LureGameDescription *gameDesc): En Common::Error LureEngine::init() { int_engine = this; _initialised = false; + _saveLoadAllowed = false; initGraphics(FULL_SCREEN_WIDTH, FULL_SCREEN_HEIGHT, false); @@ -150,6 +151,7 @@ Common::Error LureEngine::go() { // Play the game if (!shouldQuit()) { // Play the game + _saveLoadAllowed = true; Sound.loadSection(Sound.isRoland() ? ROLAND_MAIN_SOUND_RESOURCE_ID : ADLIB_MAIN_SOUND_RESOURCE_ID); gameInstance->execute(); } diff --git a/engines/lure/lure.h b/engines/lure/lure.h index 13639f0e9f..93b0d68c99 100644 --- a/engines/lure/lure.h +++ b/engines/lure/lure.h @@ -68,6 +68,7 @@ public: LureEngine(OSystem *system, const LureGameDescription *gameDesc); ~LureEngine(); static LureEngine &getReference(); + bool _saveLoadAllowed; // Engine APIs virtual Common::Error init(); @@ -90,6 +91,20 @@ public: Common::Platform getPlatform() const; virtual GUI::Debugger *getDebugger(); bool isEGA() const { return (getFeatures() & GF_EGA) != 0; } + + virtual Common::Error loadGameState(int slot) { + return loadGame(slot) ? Common::kReadingFailed : Common::kNoError; + } + virtual Common::Error saveGameState(int slot, const char *desc) { + String s(desc); + return saveGame(slot, s) ? Common::kReadingFailed : Common::kNoError; + } + virtual bool canLoadGameStateCurrently() { + return _saveLoadAllowed && !Fights.isFighting(); + } + virtual bool canSaveGameStateCurrently() { + return _saveLoadAllowed && !Fights.isFighting(); + } }; Common::String getSaveName(Common::InSaveFile *in); } // End of namespace Lure |