aboutsummaryrefslogtreecommitdiff
path: root/backends/dc/selector.cpp
diff options
context:
space:
mode:
authorMarcus Comstedt2004-03-13 12:47:27 +0000
committerMarcus Comstedt2004-03-13 12:47:27 +0000
commitac17175f6c39bbff85fdcb2ce97d10d85978ea11 (patch)
tree03317a50f9f958d7f84e24bac9e164d985ec1b27 /backends/dc/selector.cpp
parent7e3e79f41e6f56db1f83bbad629620f823c9e648 (diff)
downloadscummvm-rg350-ac17175f6c39bbff85fdcb2ce97d10d85978ea11.tar.gz
scummvm-rg350-ac17175f6c39bbff85fdcb2ce97d10d85978ea11.tar.bz2
scummvm-rg350-ac17175f6c39bbff85fdcb2ce97d10d85978ea11.zip
Merged in fixes from 0.6.0 release branch.
svn-id: r13240
Diffstat (limited to 'backends/dc/selector.cpp')
-rw-r--r--backends/dc/selector.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/backends/dc/selector.cpp b/backends/dc/selector.cpp
index 05af35d1c8..0cb9b624a7 100644
--- a/backends/dc/selector.cpp
+++ b/backends/dc/selector.cpp
@@ -160,7 +160,7 @@ static bool checkName(const char *base, char *text = 0)
return false;
}
-static const char *checkDetect(const FilesystemNode *entry)
+static const char *checkDetect(const FilesystemNode *entry, bool unique)
{
FSList files;
files.push_back(*entry);
@@ -173,18 +173,24 @@ static const char *checkDetect(const FilesystemNode *entry)
}
if (candidates.isEmpty())
return NULL;
+ if (unique && candidates.size() > 1)
+ return NULL;
return candidates[0].name;
}
static bool isGame(const FilesystemNode *entry, char *base)
{
const char *fn = entry->displayName().c_str();
+ if(const char *dtct = checkDetect(entry, true)) {
+ strcpy(base, dtct);
+ return true;
+ }
if(!strcasecmp(fn, "00.LFL") ||
!strcasecmp(fn, "000.LFL")) {
*base = '\0';
return true;
}
- if(const char *dtct = checkDetect(entry)) {
+ if(const char *dtct = checkDetect(entry, false)) {
strcpy(base, dtct);
return true;
}
@@ -198,7 +204,7 @@ static bool isGame(const FilesystemNode *entry, char *base)
base[l-4]='\0';
return true;
}
-#else
+#elsif 0
char *dot;
if(!stricmp(fn, "LOOM.EXE"))
return false;
@@ -306,8 +312,10 @@ static int findGames(Game *games, int max)
games[curr_game].dir[i+1]='\0';
#endif
}
+#if 0
if(checkExe(games[curr_game].dir, "loom"))
strcpy(games[curr_game].filename_base, "loomcd");
+#endif
}
if(uniqueGame(games[curr_game].filename_base,
games[curr_game].dir, games, curr_game)) {