aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2007-01-25 00:07:48 +0000
committerMax Horn2007-01-25 00:07:48 +0000
commit1986fff67cf7f2f2a72befab82a5c83ecb288522 (patch)
tree043f2d6f7839d568e83f74418a72aeac6ca3c5e4 /engines
parent6a004d6b3cf3a128e4d0cbdac9f9eebd240a7bdb (diff)
downloadscummvm-rg350-1986fff67cf7f2f2a72befab82a5c83ecb288522.tar.gz
scummvm-rg350-1986fff67cf7f2f2a72befab82a5c83ecb288522.tar.bz2
scummvm-rg350-1986fff67cf7f2f2a72befab82a5c83ecb288522.zip
Merged setupGameFlags into Engine_KYRA_create (removing some obsolete code in the process)
svn-id: r25169
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/plugin.cpp67
1 files changed, 21 insertions, 46 deletions
diff --git a/engines/kyra/plugin.cpp b/engines/kyra/plugin.cpp
index 4a3de699e9..5b7bf4f1c5 100644
--- a/engines/kyra/plugin.cpp
+++ b/engines/kyra/plugin.cpp
@@ -73,51 +73,6 @@ static const KYRAGameDescription adGameDescs[] = {
{ { NULL, NULL, {NULL, 0, NULL, 0}, UNK_LANG, kPlatformUnknown }, KYRA2_UNK_FLAGS }
};
-static bool setupGameFlags(const ADList &list, GameFlags &flags) {
- if (!list.size()) {
- // maybe add non md5 based detection again?
- return false;
- }
-
- int id = list[0];
-
- // FIXME: Isn't the following check/loop obsolete (i.e. I was/am under the
- // impression that AdvancedDetector already performs this check).
- if (list.size() > 1) {
- int filesCount = 0;
- int curID = 0;
- // get's the entry which has most files to check (most specialized)
- for (ADList::const_iterator i = list.begin(); i != list.end(); ++i, ++curID) {
- int fCount = 0;
-
- for (int j = 0; adGameDescs[*i].desc.filesDescriptions[j].fileName; j++)
- fCount++;
-
- if (filesCount < fCount) {
- filesCount = fCount;
- id = curID;
- }
- }
- }
-
- flags = adGameDescs[id].flags;
-
- Platform platform = parsePlatform(ConfMan.get("platform"));
- if (platform != kPlatformUnknown) {
- flags.platform = platform;
- }
- Language lang = parseLanguage(ConfMan.get("language"));
- if (lang != UNK_LANG && flags.lang == UNK_LANG) {
- flags.lang = lang;
- }
-
- if (flags.lang == UNK_LANG) {
- flags.lang = EN_ANY;
- }
-
- return true;
-}
-
const PlainGameDescriptor gameList[] = {
{ "kyra1", "The Legend of Kyrandia" },
{ "kyra2", "The Legend of Kyrandia: The Hand of Fate" },
@@ -175,10 +130,30 @@ PluginError Engine_KYRA_create(OSystem *syst, Engine **engine) {
matches = ad.detectGame(&fslist, detectionParams, Common::UNK_LANG, Common::kPlatformUnknown);
- if (!setupGameFlags(matches, flags)) {
+ if (!matches.size()) {
+ // maybe add non md5 based detection again?
return kNoGameDataFoundError;
}
+ int id = matches[0];
+
+ flags = adGameDescs[id].flags;
+
+ Platform platform = parsePlatform(ConfMan.get("platform"));
+ if (platform != kPlatformUnknown) {
+ flags.platform = platform;
+ }
+
+ if (flags.lang == UNK_LANG) {
+ Language lang = parseLanguage(ConfMan.get("language"));
+ if (lang != UNK_LANG) {
+ flags.lang = lang;
+ } else {
+ flags.lang = EN_ANY;
+ }
+ }
+
+
if (!scumm_stricmp("kyra1", gameid)) {
*engine = new KyraEngine_v1(syst, flags);
} else if (!scumm_stricmp("kyra2", gameid)) {