aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorEugene Sandulenko2008-06-02 18:19:58 +0000
committerEugene Sandulenko2008-06-02 18:19:58 +0000
commit70dd879e2f2c48e59a199d0555c5e11608641f6c (patch)
tree98a335b55d804f496014071d17a8e21067d97c4e /common
parent12c3798ffb3184b57ef604225415dfac7511a4a2 (diff)
downloadscummvm-rg350-70dd879e2f2c48e59a199d0555c5e11608641f6c.tar.gz
scummvm-rg350-70dd879e2f2c48e59a199d0555c5e11608641f6c.tar.bz2
scummvm-rg350-70dd879e2f2c48e59a199d0555c5e11608641f6c.zip
Implement ADGF_KEEPMATCH
svn-id: r32497
Diffstat (limited to 'common')
-rw-r--r--common/advancedDetector.cpp8
-rw-r--r--common/advancedDetector.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp
index 79289072df..8999a60942 100644
--- a/common/advancedDetector.cpp
+++ b/common/advancedDetector.cpp
@@ -428,7 +428,13 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p
if (curFilesMatched > maxFilesMatched) {
debug(2, " ... new best match, removing all previous candidates");
maxFilesMatched = curFilesMatched;
- matched.clear();
+
+ for (uint j = 0; j < matched.size();) {
+ if (matched[j]->flags & ADGF_KEEPMATCH)
+ ++j;
+ else
+ matched.remove_at(j);
+ }
matched.push_back(g);
} else if (curFilesMatched == maxFilesMatched) {
matched.push_back(g);
diff --git a/common/advancedDetector.h b/common/advancedDetector.h
index bec03d5585..48b9e213d7 100644
--- a/common/advancedDetector.h
+++ b/common/advancedDetector.h
@@ -46,6 +46,8 @@ struct ADGameFileDescription {
enum ADGameFlags {
ADGF_NO_FLAGS = 0,
+ ADGF_KEEPMATCH = (1 << 27), // this entry is kept even when there are matched
+ // entries with more files
ADGF_DROPLANGUAGE = (1 << 28), // don't add language to gameid
ADGF_CD = (1 << 29), // add "-cd" to gameid
ADGF_DEMO = (1 << 30) // add "-demo" to gameid