[Scummvm-cvs-logs] SF.net SVN: scummvm: [23750] scummvm/branches/branch-0-9-0/engines/simon/game.cpp
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Sat Aug 26 13:25:37 CEST 2006
Revision: 23750
Author: kirben
Date: 2006-08-26 04:25:28 -0700 (Sat, 26 Aug 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=23750&view=rev
Log Message:
-----------
Fix bug #1544799 - SIMON: Engine creates launcher entry when failing to launch.
Modified Paths:
--------------
scummvm/branches/branch-0-9-0/engines/simon/game.cpp
Modified: scummvm/branches/branch-0-9-0/engines/simon/game.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/engines/simon/game.cpp 2006-08-26 11:25:08 UTC (rev 23749)
+++ scummvm/branches/branch-0-9-0/engines/simon/game.cpp 2006-08-26 11:25:28 UTC (rev 23750)
@@ -112,6 +112,8 @@
}
PluginError Engine_SIMON_create(OSystem *syst, Engine **engine) {
+ assert(syst);
+ assert(engine);
const char *gameid = ConfMan.get("gameid").c_str();
for (const ObsoleteGameID *o = obsoleteGameIDsTable; o->from; ++o) {
@@ -129,9 +131,25 @@
}
}
- assert(engine);
- *engine = new Simon::SimonEngine(syst);
- return kNoError;
+ FSList fslist;
+ FilesystemNode dir(ConfMan.get("path"));
+ if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {
+ warning("SimonEngine: invalid game path '%s'", dir.path().c_str());
+ return kInvalidPathError;
+ }
+
+ // Invoke the detector
+ DetectedGameList detectedGames = Engine_SIMON_detectGames(fslist);
+
+ for (uint i = 0; i < detectedGames.size(); i++) {
+ if (detectedGames[i].gameid == gameid) {
+ *engine = new Simon::SimonEngine(syst);
+ return kNoError;
+ }
+ }
+
+ warning("SimonEngine: Unable to locate game data at path '%s'", dir.path().c_str());
+ return kNoGameDataFoundError;
}
REGISTER_PLUGIN(SIMON, "Simon the Sorcerer");
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