[Scummvm-cvs-logs] SF.net SVN: scummvm: [22163] scummvm/trunk/base

sev at users.sourceforge.net sev at users.sourceforge.net
Tue Apr 25 16:09:05 CEST 2006


Revision: 22163
Author:   sev
Date:     2006-04-25 16:07:59 -0700 (Tue, 25 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22163&view=rev

Log Message:
-----------
- Check if path specified for a game in scummvm.ini really exists and complain
  if it does not
- Give more understandable feedback to user when SCUMM module can't find
  a game
- Put TODO to kyra engine as their current detection scheme does not let
  easily tell if game data really present in specified directory

Modified Paths:
--------------
    scummvm/trunk/base/main.cpp
    scummvm/trunk/engines/kyra/kyra.cpp
    scummvm/trunk/engines/scumm/plugin.cpp
Modified: scummvm/trunk/base/main.cpp
===================================================================
--- scummvm/trunk/base/main.cpp	2006-04-25 22:38:00 UTC (rev 22162)
+++ scummvm/trunk/base/main.cpp	2006-04-25 23:07:59 UTC (rev 22163)
@@ -167,10 +167,15 @@
 static int runGame(const Plugin *plugin, OSystem &system, const Common::String &edebuglevels) {
 	// We add it here, so MD5-based detection will be able to
 	// read mixed case files
-	if (ConfMan.hasKey("path"))
+	if (ConfMan.hasKey("path")) {
+		if (!Common::File::exists(ConfMan.get("path"))) {
+			warning("Game directory does not exist (%s)", ConfMan.get("path").c_str());
+			return 0;
+		}
 		Common::File::addDefaultDirectory(ConfMan.get("path"));
-	else
+	} else {
 		Common::File::addDefaultDirectory(".");
+	}
 
 	// Create the game engine
 	Engine *engine = plugin->createInstance(&system);

Modified: scummvm/trunk/engines/kyra/kyra.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra.cpp	2006-04-25 22:38:00 UTC (rev 22162)
+++ scummvm/trunk/engines/kyra/kyra.cpp	2006-04-25 23:07:59 UTC (rev 22163)
@@ -299,7 +299,7 @@
 	}
 
 	if (!found) {
-		printf("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team", md5str);
+		printf("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str);
 		_features = 0;
 		_game = GI_KYRA1;
 		Common::File test;
@@ -323,6 +323,11 @@
 			_features |= GF_LNGUNK;
 		}
 	}
+
+	// FIXME: TODO:
+	// Please, deal with a case when _no_ valid game is present
+	// in specified directory. Currently it just asserts() later
+	// in the code which is not nice. [sev]
 }
 
 int KyraEngine::init() {

Modified: scummvm/trunk/engines/scumm/plugin.cpp
===================================================================
--- scummvm/trunk/engines/scumm/plugin.cpp	2006-04-25 22:38:00 UTC (rev 22162)
+++ scummvm/trunk/engines/scumm/plugin.cpp	2006-04-25 23:07:59 UTC (rev 22163)
@@ -1312,8 +1312,10 @@
 	detectGames(fslist, results, gameid);
 
 	// Unable to locate game data
-	if (results.empty())
+	if (results.empty()) {
+		warning("ScummEngine: unable to locate game data");
 		return 0;
+	}
 
 	DetectorResult res(*(results.begin()));
 


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