[Scummvm-cvs-logs] SF.net SVN: scummvm:[48426] scummvm/branches/branch-1-1-0/engines/ parallaction/detection.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Tue Mar 30 16:16:01 CEST 2010


Revision: 48426
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48426&view=rev
Author:   lordhoto
Date:     2010-03-30 14:16:01 +0000 (Tue, 30 Mar 2010)

Log Message:
-----------
Backport of r48418: "Use ConfMan to query the gameid of the passed target instead of deducing from the target to the gameid. Along with it fix the removeSaveState implementation."

Modified Paths:
--------------
    scummvm/branches/branch-1-1-0/engines/parallaction/detection.cpp

Modified: scummvm/branches/branch-1-1-0/engines/parallaction/detection.cpp
===================================================================
--- scummvm/branches/branch-1-1-0/engines/parallaction/detection.cpp	2010-03-30 10:46:04 UTC (rev 48425)
+++ scummvm/branches/branch-1-1-0/engines/parallaction/detection.cpp	2010-03-30 14:16:01 UTC (rev 48426)
@@ -296,16 +296,7 @@
 SaveStateList ParallactionMetaEngine::listSaves(const char *target) const {
 	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
 
-	// HACK: Parallaction game saves are compatible across platforms and use the
-	// gameId as pattern. Butchering the target to get the gameId is probably not
-	// robust...
-	Common::String pattern(target);
-	if (pattern.hasPrefix("nippon")) {
-		pattern = "nippon.0??";
-	} else {
-		pattern = "bra.0??";
-	}
-
+	Common::String pattern(ConfMan.getDomain(target)->getVal("gameid") + ".0??");
 	Common::StringList filenames = saveFileMan->listSavefiles(pattern);
 	sort(filenames.begin(), filenames.end());	// Sort (hopefully ensuring we are sorted numerically..)
 
@@ -330,12 +321,9 @@
 int ParallactionMetaEngine::getMaximumSaveSlot() const { return 99; }
 
 void ParallactionMetaEngine::removeSaveState(const char *target, int slot) const {
-	char extension[6];
-	snprintf(extension, sizeof(extension), ".0%02d", slot);
+	Common::String filename = ConfMan.getDomain(target)->getVal("gameid");
+	filename += Common::String::printf(".0%02d", slot);
 
-	Common::String filename = target;
-	filename += extension;
-
 	g_system->getSavefileManager()->removeSavefile(filename);
 }
 


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