[Scummvm-cvs-logs] SF.net SVN: scummvm:[36166] scummvm/branches/branch-0-13-0/engines/lure

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sat Jan 31 13:29:06 CET 2009


Revision: 36166
          http://scummvm.svn.sourceforge.net/scummvm/?rev=36166&view=rev
Author:   dreammaster
Date:     2009-01-31 12:29:06 +0000 (Sat, 31 Jan 2009)

Log Message:
-----------
Backport of GMM Save/Loading functionality and savegame list fix

Modified Paths:
--------------
    scummvm/branches/branch-0-13-0/engines/lure/animseq.cpp
    scummvm/branches/branch-0-13-0/engines/lure/detection.cpp
    scummvm/branches/branch-0-13-0/engines/lure/lure.cpp
    scummvm/branches/branch-0-13-0/engines/lure/lure.h

Modified: scummvm/branches/branch-0-13-0/engines/lure/animseq.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/lure/animseq.cpp	2009-01-31 12:26:44 UTC (rev 36165)
+++ scummvm/branches/branch-0-13-0/engines/lure/animseq.cpp	2009-01-31 12:29:06 UTC (rev 36166)
@@ -216,6 +216,9 @@
 	if (_lineRefs != NULL)
 		delete _lineRefs;
 	delete _decodedData;
+
+	// Renable GMM saving/loading now that the animation is done
+	LureEngine::getReference()._saveLoadAllowed = true;
 }
 
 // show
@@ -227,6 +230,9 @@
 	const AnimSoundSequence *soundFrame = _soundList;
 	int frameCtr = 0;
 
+	// Disable GMM saving/loading whilst animation is running
+	LureEngine::getReference()._saveLoadAllowed = false;
+
 	// Loop through displaying the animations
 	while (_pPixels < _pPixelsEnd) {
 		if ((soundFrame != NULL) && (frameCtr == 0))

Modified: scummvm/branches/branch-0-13-0/engines/lure/detection.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/lure/detection.cpp	2009-01-31 12:26:44 UTC (rev 36165)
+++ scummvm/branches/branch-0-13-0/engines/lure/detection.cpp	2009-01-31 12:29:06 UTC (rev 36166)
@@ -26,6 +26,7 @@
 #include "base/plugins.h"
 
 #include "common/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 Common::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/branches/branch-0-13-0/engines/lure/lure.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/lure/lure.cpp	2009-01-31 12:26:44 UTC (rev 36165)
+++ scummvm/branches/branch-0-13-0/engines/lure/lure.cpp	2009-01-31 12:29:06 UTC (rev 36166)
@@ -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/branches/branch-0-13-0/engines/lure/lure.h
===================================================================
--- scummvm/branches/branch-0-13-0/engines/lure/lure.h	2009-01-31 12:26:44 UTC (rev 36165)
+++ scummvm/branches/branch-0-13-0/engines/lure/lure.h	2009-01-31 12:29:06 UTC (rev 36166)
@@ -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,21 @@
 	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