[Scummvm-cvs-logs] SF.net SVN: scummvm: [23660] scummvm/trunk/engines/cine/cine.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Fri Aug 4 11:46:44 CEST 2006


Revision: 23660
Author:   eriktorbjorn
Date:     2006-08-04 02:46:40 -0700 (Fri, 04 Aug 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23660&view=rev

Log Message:
-----------
Run the Cine engine's game detector before starting a game, to ensure that it
really is there. I hope this is the right way of fixing bug #1534073.

Modified Paths:
--------------
    scummvm/trunk/engines/cine/cine.cpp
Modified: scummvm/trunk/engines/cine/cine.cpp
===================================================================
--- scummvm/trunk/engines/cine/cine.cpp	2006-08-03 13:11:16 UTC (rev 23659)
+++ scummvm/trunk/engines/cine/cine.cpp	2006-08-04 09:46:40 UTC (rev 23660)
@@ -112,9 +112,29 @@
 }
 
 PluginError Engine_CINE_create(OSystem *syst, Engine **engine) {
+	assert(syst);
 	assert(engine);
-	*engine = new Cine::CineEngine(syst);
-	return kNoError;
+
+	FSList fslist;
+	FilesystemNode dir(ConfMan.get("path"));
+	if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {
+		warning("CineEngine: invalid game path '%s'", dir.path().c_str());
+		return kInvalidPathError;
+	}
+
+	// Invoke the detector
+	Common::String gameid = ConfMan.get("gameid");
+	DetectedGameList detectedGames = Engine_CINE_detectGames(fslist);
+
+	for (uint i = 0; i < detectedGames.size(); i++) {
+		if (detectedGames[i].gameid == gameid) {
+			*engine = new Cine::CineEngine(syst);
+			return kNoError;
+		}
+	}
+	
+	warning("CineEngine: Unable to locate game data at path '%s'", dir.path().c_str());
+	return kNoGameDataFoundError;
 }
 
 REGISTER_PLUGIN(CINE, "CINE Engine", "TODO (C) TODO");


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