aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorMax Horn2007-02-13 23:37:44 +0000
committerMax Horn2007-02-13 23:37:44 +0000
commit7572d2b4f2ac98cf31602d6c5e4ed7399de54a30 (patch)
treed96c82e9cae2736feef9b6d5ac7801273c5107a7 /engines/kyra
parentde02e840a6dd619e221a750b0b2a63d157f05114 (diff)
downloadscummvm-rg350-7572d2b4f2ac98cf31602d6c5e4ed7399de54a30.tar.gz
scummvm-rg350-7572d2b4f2ac98cf31602d6c5e4ed7399de54a30.tar.bz2
scummvm-rg350-7572d2b4f2ac98cf31602d6c5e4ed7399de54a30.zip
Changed detectBestMatchingGame to return a pointer to a ADGameDescription (or a subclass of it); added a (currently fake) fallback callback entry in ADParams
svn-id: r25574
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/plugin.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/engines/kyra/plugin.cpp b/engines/kyra/plugin.cpp
index 0fdf766cc9..25b7df4ae4 100644
--- a/engines/kyra/plugin.cpp
+++ b/engines/kyra/plugin.cpp
@@ -97,6 +97,8 @@ const Common::ADParams detectionParams = {
0,
// List of files for file-based fallback detection (optional)
0,
+ // Fallback callback
+ 0,
// Flags
0
};
@@ -119,19 +121,16 @@ PluginError Engine_KYRA_create(OSystem *syst, Engine **engine) {
assert(engine);
const char *gameid = ConfMan.get("gameid").c_str();
- int id = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
- if (id == -1) {
- // FIXME: This case currently can never happen, as we simply error out
- // inside AdvancedDetector::detectBestMatchingGame.
-
+ const KYRAGameDescription *gd = (const KYRAGameDescription *)Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
+ if (gd == 0) {
// maybe add non md5 based detection again?
return kNoGameDataFoundError;
}
- Kyra::GameFlags flags = adGameDescs[id].flags;
+ Kyra::GameFlags flags = gd->flags;
- flags.lang = adGameDescs[id].desc.language;
- flags.platform = adGameDescs[id].desc.platform;
+ flags.lang = gd->desc.language;
+ flags.platform = gd->desc.platform;
Common::Platform platform = Common::parsePlatform(ConfMan.get("platform"));
if (platform != Common::kPlatformUnknown) {