[Scummvm-cvs-logs] SF.net SVN: scummvm:[33893] scummvm/branches/gsoc2008-rtl
cpage88 at users.sourceforge.net
cpage88 at users.sourceforge.net
Fri Aug 15 09:10:24 CEST 2008
Revision: 33893
http://scummvm.svn.sourceforge.net/scummvm/?rev=33893&view=rev
Author: cpage88
Date: 2008-08-15 07:10:23 +0000 (Fri, 15 Aug 2008)
Log Message:
-----------
Added some MetaEngineFeatures, defined MEFs for the Scumm engine
Modified Paths:
--------------
scummvm/branches/gsoc2008-rtl/engines/metaengine.h
scummvm/branches/gsoc2008-rtl/engines/scumm/detection.cpp
scummvm/branches/gsoc2008-rtl/gui/launcher.cpp
Modified: scummvm/branches/gsoc2008-rtl/engines/metaengine.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/metaengine.h 2008-08-15 04:30:45 UTC (rev 33892)
+++ scummvm/branches/gsoc2008-rtl/engines/metaengine.h 2008-08-15 07:10:23 UTC (rev 33893)
@@ -91,6 +91,44 @@
virtual SaveStateList listSaves(const char *target) const {
return SaveStateList();
}
+
+ /**
+ * Remove the specified save state.
+ *
+ * For most engines this just involves a call removeSaveFile().
+ * Engines which keep an index file will also update it accordingly.
+ *
+ * @param slot slot number of the save state to be removed
+ * @param saveNames a list of all the save state description names
+ */
+ virtual void removeSaveState(int slot, Common::StringList saveNames) const {};
+
+
+ /** @name MetaEngineFeature flags */
+ //@{
+
+ /**
+ * A feature in this context means an ability of the engine which can be
+ * either on or off. Examples include:
+ * - Listing Save States (--list-saves)
+ * - Loading from the Launcher (-x)
+ * - Deleting Saves from the Launcher
+ *
+ * These determine whether the features will be available to the engine
+ * in the launcher.
+ */
+ enum MetaEngineFeature {
+ kSupportsListSaves,
+ kSupportsDirectLoad,
+ kSupportsDeleteSave
+ };
+
+ /**
+ * Determine whether the engine supports the specified feature
+ */
+ virtual bool hasFeature(MetaEngineFeature f) { return false; };
+
+ //@}
};
Modified: scummvm/branches/gsoc2008-rtl/engines/scumm/detection.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/scumm/detection.cpp 2008-08-15 04:30:45 UTC (rev 33892)
+++ scummvm/branches/gsoc2008-rtl/engines/scumm/detection.cpp 2008-08-15 07:10:23 UTC (rev 33893)
@@ -677,6 +677,7 @@
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
virtual GameList detectGames(const FSList &fslist) const;
+ virtual bool hasFeature(MetaEngineFeature f);
virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
@@ -691,6 +692,12 @@
return Common::AdvancedDetector::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable);
}
+bool ScummMetaEngine::hasFeature(MetaEngineFeature f) {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDirectLoad) ||
+ (f == kSupportsDeleteSave);
+}
GameList ScummMetaEngine::detectGames(const FSList &fslist) const {
GameList detectedGames;
Modified: scummvm/branches/gsoc2008-rtl/gui/launcher.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/gui/launcher.cpp 2008-08-15 04:30:45 UTC (rev 33892)
+++ scummvm/branches/gsoc2008-rtl/gui/launcher.cpp 2008-08-15 07:10:23 UTC (rev 33893)
@@ -951,7 +951,8 @@
int idx;
if (plugin) {
do {
- _loadDialog->setList(generateSavegameList(item, plugin));
+ Common::StringList saveNames = generateSavegameList(item, plugin);
+ _loadDialog->setList(saveNames);
SaveStateList saveList = (*plugin)->listSaves(description.c_str());
idx = _loadDialog->runModal();
if (idx >= 0) {
@@ -959,7 +960,7 @@
if (_loadDialog->delSave()) {
String filename = saveList[idx].filename();
printf("Deleting file: %s\n", filename.c_str());
- saveFileMan->removeSavefile(filename.c_str());
+ //saveFileMan->removeSavefile(filename.c_str());
}
// Load the savegame
else {
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