[Scummvm-cvs-logs] SF.net SVN: scummvm: [23426] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sat Jul 8 16:51:31 CEST 2006


Revision: 23426
Author:   lordhoto
Date:     2006-07-08 07:51:26 -0700 (Sat, 08 Jul 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23426&view=rev

Log Message:
-----------
Changes init error handling of kyra engine (engine fails at Engine_KYRA_create now instead of KyraEngine::init, also adds check for invalid game path like the scumm 
engine does).

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra.cpp
    scummvm/trunk/engines/kyra/plugin.cpp
Modified: scummvm/trunk/engines/kyra/kyra.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra.cpp	2006-07-08 14:25:23 UTC (rev 23425)
+++ scummvm/trunk/engines/kyra/kyra.cpp	2006-07-08 14:51:26 UTC (rev 23426)
@@ -115,10 +115,6 @@
 }
 
 int KyraEngine::init() {
-	if (setupGameFlags()) {
-		return -1;
-	}
-
 	// Setup mixer
 	if (!_mixer->isReady()) {
 		warning("Sound initialization failed.");

Modified: scummvm/trunk/engines/kyra/plugin.cpp
===================================================================
--- scummvm/trunk/engines/kyra/plugin.cpp	2006-07-08 14:25:23 UTC (rev 23425)
+++ scummvm/trunk/engines/kyra/plugin.cpp	2006-07-08 14:51:26 UTC (rev 23426)
@@ -272,6 +272,21 @@
 		*engine = new KyraEngine_v3(syst);
 	} else
 		error("Kyra engine created with invalid gameid.");
+
+	FSList fslist;
+	FilesystemNode dir(ConfMan.get("path"));
+	if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {
+		warning("KyraEngine: invalid game path '%s'", dir.path().c_str());
+		return kInvalidPathError;
+	}
+
+	if (*engine) {
+		if (((KyraEngine*)(*engine))->setupGameFlags()) {
+			warning("KyraEngine: unable to locate game data at path '%s'", dir.path().c_str());
+			delete *engine;
+			return kNoGameDataFoundError;
+		}
+	}
 	
 	return kNoError;
 }


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