[Scummvm-cvs-logs] SF.net SVN: scummvm: [23749] scummvm/trunk/engines/simon/game.cpp
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Sat Aug 26 13:25:15 CEST 2006
Revision: 23749
Author: kirben
Date: 2006-08-26 04:25:08 -0700 (Sat, 26 Aug 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=23749&view=rev
Log Message:
-----------
Fix bug #1544799 - SIMON: Engine creates launcher entry when failing to launch.
Modified Paths:
--------------
scummvm/trunk/engines/simon/game.cpp
Modified: scummvm/trunk/engines/simon/game.cpp
===================================================================
--- scummvm/trunk/engines/simon/game.cpp 2006-08-25 18:17:39 UTC (rev 23748)
+++ scummvm/trunk/engines/simon/game.cpp 2006-08-26 11:25:08 UTC (rev 23749)
@@ -113,6 +113,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) {
@@ -130,9 +132,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", "Simon the Sorcerer (C) Adventure Soft");
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