[Scummvm-cvs-logs] CVS: scummvm/sword2 sword2.cpp,1.67,1.68

Max Horn fingolfin at users.sourceforge.net
Sat Nov 1 08:40:05 CET 2003


Update of /cvsroot/scummvm/scummvm/sword2
In directory sc8-pr-cvs1:/tmp/cvs-serv7194/sword2

Modified Files:
	sword2.cpp 
Log Message:
cleanup of game detector functions

Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sword2.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- sword2.cpp	28 Oct 2003 19:51:30 -0000	1.67
+++ sword2.cpp	1 Nov 2003 16:39:26 -0000	1.68
@@ -74,20 +74,17 @@
 GameList Engine_SWORD2_detectGames(const FSList &fslist) {
 	GameList detectedGames;
 	const GameSettings *g;
-	char detectName[128];
-	char detectName2[128];
+	
+	// TODO: It would be nice if we had code here which distinguishes between
+	// the 'sword2' and Ôsword2demoÔ targets. The current code can't do that
+	// since they use the same detectname.
 
 	for (g = sword2_settings; g->gameName; ++g) {
-		strcpy(detectName, g->detectname);
-		strcpy(detectName2, g->detectname);
-		strcat(detectName2, ".");
-
 		// Iterate over all files in the given directory
 		for (FSList::ConstIterator file = fslist.begin(); file != fslist.end(); ++file) {
 			const char *gameName = file->displayName().c_str();
 
-			if ((0 == scumm_stricmp(detectName, gameName))  || 
-				(0 == scumm_stricmp(detectName2, gameName))) {
+			if (0 == scumm_stricmp(g->detectname, gameName)) {
 				// Match found, add to list of candidates, then abort inner loop.
 				detectedGames.push_back(*g);
 				break;





More information about the Scummvm-git-logs mailing list