[Scummvm-cvs-logs] SF.net SVN: scummvm:[35207] scummvm/trunk/engines/tinsel

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Dec 2 19:34:32 CET 2008


Revision: 35207
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35207&view=rev
Author:   thebluegr
Date:     2008-12-02 18:34:32 +0000 (Tue, 02 Dec 2008)

Log Message:
-----------
- 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)

Modified Paths:
--------------
    scummvm/trunk/engines/tinsel/detection.cpp
    scummvm/trunk/engines/tinsel/saveload.cpp
    scummvm/trunk/engines/tinsel/savescn.h
    scummvm/trunk/engines/tinsel/tinsel.h

Modified: scummvm/trunk/engines/tinsel/detection.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/detection.cpp	2008-12-02 17:53:58 UTC (rev 35206)
+++ scummvm/trunk/engines/tinsel/detection.cpp	2008-12-02 18:34:32 UTC (rev 35207)
@@ -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 @@
 
 	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 @@
 	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

Modified: scummvm/trunk/engines/tinsel/saveload.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/saveload.cpp	2008-12-02 17:53:58 UTC (rev 35206)
+++ scummvm/trunk/engines/tinsel/saveload.cpp	2008-12-02 18:34:32 UTC (rev 35207)
@@ -118,6 +118,8 @@
 
 //------------- SAVE/LOAD SUPPORT METHODS ----------------
 
+void setNeedLoad() { NeedLoad = true; }
+
 static void syncTime(Serializer &s, struct tm &t) {
 	s.syncAsUint16LE(t.tm_year);
 	s.syncAsByte(t.tm_mon);

Modified: scummvm/trunk/engines/tinsel/savescn.h
===================================================================
--- scummvm/trunk/engines/tinsel/savescn.h	2008-12-02 17:53:58 UTC (rev 35206)
+++ scummvm/trunk/engines/tinsel/savescn.h	2008-12-02 18:34:32 UTC (rev 35207)
@@ -42,7 +42,7 @@
 
 enum {
 	SG_DESC_LEN	= 40,	// Max. saved game description length
-	MAX_SAVED_FILES	= 30,
+	MAX_SAVED_FILES	= 100,
 
 	// FIXME: Save file names in ScummVM can be longer than 8.3, overflowing the
 	// name field in savedFiles. Raising it to 256 as a preliminary fix.
@@ -101,6 +101,7 @@
 
 char *ListEntry(int i, letype which);
 int getList(void);
+void setNeedLoad(void);
 
 void RestoreGame(int num);
 void SaveGame(char *name, char *desc);

Modified: scummvm/trunk/engines/tinsel/tinsel.h
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.h	2008-12-02 17:53:58 UTC (rev 35206)
+++ scummvm/trunk/engines/tinsel/tinsel.h	2008-12-02 18:34:32 UTC (rev 35207)
@@ -140,6 +140,9 @@
 	// Engine APIs
 	virtual Common::Error init();
 	virtual Common::Error go();
+	virtual bool hasFeature(EngineFeature f) const;
+	Common::Error loadGameState(int slot);
+	bool canLoadGameStateCurrently();
 	virtual void syncSoundSettings();
 
 public:


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