[Scummvm-cvs-logs] SF.net SVN: scummvm:[36164] scummvm/trunk/engines/lure
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Sat Jan 31 13:15:21 CET 2009
Revision: 36164
http://scummvm.svn.sourceforge.net/scummvm/?rev=36164&view=rev
Author: dreammaster
Date: 2009-01-31 12:15:21 +0000 (Sat, 31 Jan 2009)
Log Message:
-----------
Enabled runtime save/loading from the GMM menu, and fixed launcher listing of savegames
Modified Paths:
--------------
scummvm/trunk/engines/lure/detection.cpp
scummvm/trunk/engines/lure/lure.cpp
scummvm/trunk/engines/lure/lure.h
Modified: scummvm/trunk/engines/lure/detection.cpp
===================================================================
--- scummvm/trunk/engines/lure/detection.cpp 2009-01-31 12:06:33 UTC (rev 36163)
+++ scummvm/trunk/engines/lure/detection.cpp 2009-01-31 12:15:21 UTC (rev 36164)
@@ -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 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 @@
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..)
Modified: scummvm/trunk/engines/lure/lure.cpp
===================================================================
--- scummvm/trunk/engines/lure/lure.cpp 2009-01-31 12:06:33 UTC (rev 36163)
+++ scummvm/trunk/engines/lure/lure.cpp 2009-01-31 12:15:21 UTC (rev 36164)
@@ -51,6 +51,7 @@
Common::Error LureEngine::init() {
int_engine = this;
_initialised = false;
+ _saveLoadAllowed = false;
initGraphics(FULL_SCREEN_WIDTH, FULL_SCREEN_HEIGHT, false);
@@ -150,6 +151,7 @@
// 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();
}
Modified: scummvm/trunk/engines/lure/lure.h
===================================================================
--- scummvm/trunk/engines/lure/lure.h 2009-01-31 12:06:33 UTC (rev 36163)
+++ scummvm/trunk/engines/lure/lure.h 2009-01-31 12:15:21 UTC (rev 36164)
@@ -68,6 +68,7 @@
LureEngine(OSystem *system, const LureGameDescription *gameDesc);
~LureEngine();
static LureEngine &getReference();
+ bool _saveLoadAllowed;
// Engine APIs
virtual Common::Error init();
@@ -90,6 +91,20 @@
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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list