aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/glk/advsys/detection.cpp12
-rw-r--r--engines/glk/alan2/detection.cpp17
-rw-r--r--engines/glk/frotz/detection.cpp21
-rw-r--r--engines/glk/glulxe/detection.cpp20
-rw-r--r--engines/glk/hugo/detection.cpp12
-rw-r--r--engines/glk/magnetic/detection.cpp12
-rw-r--r--engines/glk/scott/detection.cpp20
-rw-r--r--engines/glk/tads/detection.cpp16
8 files changed, 66 insertions, 64 deletions
diff --git a/engines/glk/advsys/detection.cpp b/engines/glk/advsys/detection.cpp
index d3b376f0b6..d6641a6a7c 100644
--- a/engines/glk/advsys/detection.cpp
+++ b/engines/glk/advsys/detection.cpp
@@ -86,13 +86,15 @@ bool AdvSysMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &
gameList.push_back(gd);
} else {
- if (gDebugLevel > 0) {
- // Print an entry suitable for putting into the detection_tables.h
- debug("ENTRY0(\"%s\", \"%s\", %u),", filename.c_str(), md5.c_str(), (uint)filesize);
- }
-
const PlainGameDescriptor &desc = ADVSYS_GAME_LIST[0];
DetectedGame gd(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
+ gd.canBeAdded = true;
+ gd.hasUnknownFiles = true;
+ FileProperties fp;
+ fp.md5 = md5;
+ fp.size = filesize;
+ gd.matchedFiles[file->getName()] = fp;
+
gameList.push_back(gd);
}
}
diff --git a/engines/glk/alan2/detection.cpp b/engines/glk/alan2/detection.cpp
index 0b146ada6e..2338ebb1db 100644
--- a/engines/glk/alan2/detection.cpp
+++ b/engines/glk/alan2/detection.cpp
@@ -73,18 +73,15 @@ bool Alan2MetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
DetectedGame gd;
if (!p->_gameId) {
- if (gDebugLevel > 0) {
- // Print an entry suitable for putting into the detection_tables.h, using the
- // name of the parent folder the game is in as the presumed game Id
- Common::String fname = filename;
- const char *dot = strchr(fname.c_str(), '.');
- if (dot)
- fname = Common::String(fname.c_str(), dot);
-
- debug("ENTRY0(\"%s\", \"%s\", %u),", fname.c_str(), md5.c_str(), (uint)filesize);
- }
const PlainGameDescriptor &desc = ALAN2_GAME_LIST[0];
gd = DetectedGame(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
+ gd.canBeAdded = true;
+ gd.hasUnknownFiles = true;
+ FileProperties fp;
+ fp.md5 = md5;
+ fp.size = filesize;
+ gd.matchedFiles[filename] = fp;
+
} else {
PlainGameDescriptor gameDesc = findGame(p->_gameId);
gd = DetectedGame(p->_gameId, gameDesc.description, Common::EN_ANY, Common::kPlatformUnknown);
diff --git a/engines/glk/frotz/detection.cpp b/engines/glk/frotz/detection.cpp
index 0c8a92b9ab..4502fc66af 100644
--- a/engines/glk/frotz/detection.cpp
+++ b/engines/glk/frotz/detection.cpp
@@ -120,22 +120,15 @@ bool FrotzMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
if (filename.hasSuffixIgnoreCase(".dat") || filename.hasSuffixIgnoreCase(".zip") || emptyBlorb)
continue;
- if (gDebugLevel > 0) {
- // Print an entry suitable for putting into the detection_tables.h, using the
- // name of the parent folder the game is in as the presumed game Id
- Common::String folderName = file->getParent().getName();
- if (folderName.hasSuffix("\\"))
- folderName.deleteLastChar();
- Common::String fname = filename;
- const char *dot = strchr(fname.c_str(), '.');
- if (dot)
- fname = Common::String(fname.c_str(), dot);
-
- debug("ENTRY0(\"%s\", %s, \"%s\", %u),",
- fname.c_str(), strlen(serial) ? serial : "nullptr", md5.c_str(), (uint)filesize);
- }
const PlainGameDescriptor &desc = ZCODE_GAME_LIST[0];
gd = DetectedGame(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
+ gd.canBeAdded = true;
+ gd.hasUnknownFiles = true;
+ FileProperties fp;
+ fp.md5 = md5;
+ fp.size = filesize;
+ gd.matchedFiles[filename] = fp;
+
} else {
GameDescriptor gameDesc = findGame(p->_gameId);
gd = DetectedGame(p->_gameId, gameDesc._description, p->_language, Common::kPlatformUnknown, p->_extra);
diff --git a/engines/glk/glulxe/detection.cpp b/engines/glk/glulxe/detection.cpp
index d75f1b73ec..5ee6285473 100644
--- a/engines/glk/glulxe/detection.cpp
+++ b/engines/glk/glulxe/detection.cpp
@@ -81,21 +81,15 @@ bool GlulxeMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &
DetectedGame gd;
if (!p->_gameId) {
- if (gDebugLevel > 0) {
- // Print an entry suitable for putting into the detection_tables.h, using the
- // name of the parent folder the game is in as the presumed game Id
- Common::String folderName = file->getParent().getName();
- if (folderName.hasSuffix("\\"))
- folderName.deleteLastChar();
- Common::String fname = filename;
- const char *dot = strchr(fname.c_str(), '.');
- if (dot)
- fname = Common::String(fname.c_str(), dot);
-
- debug("ENTRY0(\"%s\", \"%s\", %u),", fname.c_str(), md5.c_str(), (uint)filesize);
- }
const PlainGameDescriptor &desc = GLULXE_GAME_LIST[0];
gd = DetectedGame(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
+ gd.canBeAdded = true;
+ gd.hasUnknownFiles = true;
+ FileProperties fp;
+ fp.md5 = md5;
+ fp.size = filesize;
+ gd.matchedFiles[filename] = fp;
+
} else {
PlainGameDescriptor gameDesc = findGame(p->_gameId);
gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra);
diff --git a/engines/glk/hugo/detection.cpp b/engines/glk/hugo/detection.cpp
index 299c8374ee..daff460e4a 100644
--- a/engines/glk/hugo/detection.cpp
+++ b/engines/glk/hugo/detection.cpp
@@ -76,13 +76,15 @@ bool HugoMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &ga
DetectedGame gd;
if (!p->_gameId) {
- if (gDebugLevel > 0) {
- // Print an entry suitable for putting into the detection_tables.h
- debug("ENTRY0(\"%s\", \"%s\", %u),", filename.c_str(), md5.c_str(), (uint)filesize);
- }
-
const PlainGameDescriptor &desc = HUGO_GAME_LIST[0];
gd = DetectedGame(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
+ gd.canBeAdded = true;
+ gd.hasUnknownFiles = true;
+ FileProperties fp;
+ fp.md5 = md5;
+ fp.size = filesize;
+ gd.matchedFiles[filename] = fp;
+
} else {
PlainGameDescriptor gameDesc = findGame(p->_gameId);
gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra);
diff --git a/engines/glk/magnetic/detection.cpp b/engines/glk/magnetic/detection.cpp
index 83d1143dd0..1552eec77a 100644
--- a/engines/glk/magnetic/detection.cpp
+++ b/engines/glk/magnetic/detection.cpp
@@ -81,13 +81,15 @@ bool MagneticMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames
DetectedGame gd;
if (!p->_gameId) {
- if (gDebugLevel > 0) {
- // Print an entry suitable for putting into the detection_tables.h
- debug("ENTRY0(\"%s\", \"%s\", %u),", filename.c_str(), md5.c_str(), (uint)filesize);
- }
-
const PlainGameDescriptor &desc = MAGNETIC_GAME_LIST[0];
gd = DetectedGame(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
+ gd.canBeAdded = true;
+ gd.hasUnknownFiles = true;
+ FileProperties fp;
+ fp.md5 = md5;
+ fp.size = filesize;
+ gd.matchedFiles[filename] = fp;
+
} else {
PlainGameDescriptor gameDesc = findGame(p->_gameId);
gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra);
diff --git a/engines/glk/scott/detection.cpp b/engines/glk/scott/detection.cpp
index e2c98723c4..03445ea090 100644
--- a/engines/glk/scott/detection.cpp
+++ b/engines/glk/scott/detection.cpp
@@ -77,14 +77,28 @@ bool ScottMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
while (p->_md5 && p->_filesize != filesize && md5 != p->_md5)
++p;
- if (p->_filesize) {
+ DetectedGame gd;
+ if (!p->_gameId) {
+ if (!isBlorb && filename.hasSuffixIgnoreCase(".dat"))
+ continue;
+
+ const PlainGameDescriptor &desc = SCOTT_GAME_LIST[0];
+ gd = DetectedGame(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
+ gd.canBeAdded = true;
+ gd.hasUnknownFiles = true;
+ FileProperties fp;
+ fp.md5 = md5;
+ fp.size = filesize;
+ gd.matchedFiles[filename] = fp;
+
+ } else {
// Found a match
PlainGameDescriptor gameDesc = findGame(p->_gameId);
DetectedGame gd(p->_gameId, gameDesc.description, Common::EN_ANY, Common::kPlatformUnknown);
gd.addExtraEntry("filename", file->getName());
-
- gameList.push_back(gd);
}
+
+ gameList.push_back(gd);
}
return !gameList.empty();
diff --git a/engines/glk/tads/detection.cpp b/engines/glk/tads/detection.cpp
index 51a29d1074..8ea996b7bc 100644
--- a/engines/glk/tads/detection.cpp
+++ b/engines/glk/tads/detection.cpp
@@ -106,17 +106,15 @@ bool TADSMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &ga
DetectedGame gd;
if (!p->_gameId) {
- if (gDebugLevel > 0) {
- // Print an entry suitable for putting into the detection_tables.h
- Common::String fname = filename;
- const char *dot = strchr(fname.c_str(), '.');
- if (dot)
- fname = Common::String(fname.c_str(), dot);
-
- debug("TADS%d ENTRY0(\"%s\", \"%s\", %u),", tadsVersion, fname.c_str(), md5.c_str(), (uint)filesize);
- }
const GameDescriptor &desc = tadsVersion == 2 ? TADS2_GAME_LIST[0] : TADS3_GAME_LIST[0];
gd = DetectedGame(desc._gameId, desc._description, Common::UNK_LANG, Common::kPlatformUnknown);
+ gd.canBeAdded = true;
+ gd.hasUnknownFiles = true;
+ FileProperties fp;
+ fp.md5 = md5;
+ fp.size = filesize;
+ gd.matchedFiles[filename] = fp;
+
} else {
PlainGameDescriptor gameDesc = findGame(p->_gameId);
gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra);