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

kirben at users.sourceforge.net kirben at users.sourceforge.net
Sat Aug 26 13:56:54 CEST 2006


Revision: 23754
Author:   kirben
Date:     2006-08-26 04:56:49 -0700 (Sat, 26 Aug 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23754&view=rev

Log Message:
-----------
Fix bug #1544810 - AGI: Launching undefined target 'agi' shows a blank screen

Modified Paths:
--------------
    scummvm/trunk/engines/agi/agi.cpp
Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp	2006-08-26 11:34:35 UTC (rev 23753)
+++ scummvm/trunk/engines/agi/agi.cpp	2006-08-26 11:56:49 UTC (rev 23754)
@@ -635,9 +635,29 @@
 }
 
 PluginError Engine_AGI_create(OSystem *syst, Engine **engine) {
+	assert(syst);
 	assert(engine);
-	*engine = new Agi::AgiEngine(syst);
-	return kNoError;
+
+	FSList fslist;
+	FilesystemNode dir(ConfMan.get("path"));
+	if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {
+		warning("AgiEngine: invalid game path '%s'", dir.path().c_str());
+		return kInvalidPathError;
+	}
+
+	// Invoke the detector
+	Common::String gameid = ConfMan.get("gameid");
+	DetectedGameList detectedGames = Engine_AGI_detectGames(fslist);
+
+	for (uint i = 0; i < detectedGames.size(); i++) {
+		if (detectedGames[i].gameid == gameid) {
+			*engine = new Agi::AgiEngine(syst);
+			return kNoError;
+		}
+	}
+
+	warning("AgiEngine: Unable to locate game data at path '%s'", dir.path().c_str());
+	return kNoGameDataFoundError;
 }
 
 REGISTER_PLUGIN(AGI, "AGI 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