aboutsummaryrefslogtreecommitdiff
path: root/engines/cine
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-08-04 09:46:40 +0000
committerTorbjörn Andersson2006-08-04 09:46:40 +0000
commitaf3241f70035db44a7510d4558a52bd7e1e92722 (patch)
treed139982ea8a989874535bfcf4b8eccd9c8ca400b /engines/cine
parent44dd6a386e9342e4088125fef680b1232da35692 (diff)
downloadscummvm-rg350-af3241f70035db44a7510d4558a52bd7e1e92722.tar.gz
scummvm-rg350-af3241f70035db44a7510d4558a52bd7e1e92722.tar.bz2
scummvm-rg350-af3241f70035db44a7510d4558a52bd7e1e92722.zip
Run the Cine engine's game detector before starting a game, to ensure that it
really is there. I hope this is the right way of fixing bug #1534073. svn-id: r23660
Diffstat (limited to 'engines/cine')
-rw-r--r--engines/cine/cine.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index 6223c64398..e02c04d7cf 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -112,9 +112,29 @@ DetectedGameList Engine_CINE_detectGames(const FSList &fslist) {
}
PluginError Engine_CINE_create(OSystem *syst, Engine **engine) {
+ assert(syst);
assert(engine);
- *engine = new Cine::CineEngine(syst);
- return kNoError;
+
+ FSList fslist;
+ FilesystemNode dir(ConfMan.get("path"));
+ if (!dir.listDir(fslist, FilesystemNode::kListFilesOnly)) {
+ warning("CineEngine: invalid game path '%s'", dir.path().c_str());
+ return kInvalidPathError;
+ }
+
+ // Invoke the detector
+ Common::String gameid = ConfMan.get("gameid");
+ DetectedGameList detectedGames = Engine_CINE_detectGames(fslist);
+
+ for (uint i = 0; i < detectedGames.size(); i++) {
+ if (detectedGames[i].gameid == gameid) {
+ *engine = new Cine::CineEngine(syst);
+ return kNoError;
+ }
+ }
+
+ warning("CineEngine: Unable to locate game data at path '%s'", dir.path().c_str());
+ return kNoGameDataFoundError;
}
REGISTER_PLUGIN(CINE, "CINE Engine", "TODO (C) TODO");