aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2006-07-08 14:51:26 +0000
committerJohannes Schickel2006-07-08 14:51:26 +0000
commitdb2ffa42856d0ecd337b7a0fdd342d7560f2bdca (patch)
treece728efa49478789a229dd77bf317da4a700c13a /engines/kyra
parentabdebd3bfd3596d073f40cc4d7452a053906f8b5 (diff)
downloadscummvm-rg350-db2ffa42856d0ecd337b7a0fdd342d7560f2bdca.tar.gz
scummvm-rg350-db2ffa42856d0ecd337b7a0fdd342d7560f2bdca.tar.bz2
scummvm-rg350-db2ffa42856d0ecd337b7a0fdd342d7560f2bdca.zip
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). svn-id: r23426
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/kyra.cpp4
-rw-r--r--engines/kyra/plugin.cpp15
2 files changed, 15 insertions, 4 deletions
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp
index d2f699343d..d8b0cfc1a4 100644
--- a/engines/kyra/kyra.cpp
+++ b/engines/kyra/kyra.cpp
@@ -115,10 +115,6 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system)
}
int KyraEngine::init() {
- if (setupGameFlags()) {
- return -1;
- }
-
// Setup mixer
if (!_mixer->isReady()) {
warning("Sound initialization failed.");
diff --git a/engines/kyra/plugin.cpp b/engines/kyra/plugin.cpp
index 18b9c4f1dd..18b56ab22c 100644
--- a/engines/kyra/plugin.cpp
+++ b/engines/kyra/plugin.cpp
@@ -272,6 +272,21 @@ PluginError Engine_KYRA_create(OSystem *syst, Engine **engine) {
*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;
}