diff options
author | Paul Gilbert | 2019-07-06 10:25:28 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-07-06 15:27:10 -0700 |
commit | 5dda48c1c785b8a477785ee6040db82b904858bb (patch) | |
tree | 258a1650bfa5f51402530ddca822e03f1b984ff7 /engines/glk | |
parent | 0502ac4bb1b41b17664adf46a2c3600553023c84 (diff) | |
download | scummvm-rg350-5dda48c1c785b8a477785ee6040db82b904858bb.tar.gz scummvm-rg350-5dda48c1c785b8a477785ee6040db82b904858bb.tar.bz2 scummvm-rg350-5dda48c1c785b8a477785ee6040db82b904858bb.zip |
GLK: Change other sub-engines to use GlkDetectedGame
Diffstat (limited to 'engines/glk')
-rw-r--r-- | engines/glk/advsys/detection.cpp | 21 | ||||
-rw-r--r-- | engines/glk/alan2/detection.cpp | 15 | ||||
-rw-r--r-- | engines/glk/detection.cpp | 6 | ||||
-rw-r--r-- | engines/glk/frotz/detection.cpp | 18 | ||||
-rw-r--r-- | engines/glk/glulxe/detection.cpp | 16 | ||||
-rw-r--r-- | engines/glk/hugo/detection.cpp | 16 | ||||
-rw-r--r-- | engines/glk/magnetic/detection.cpp | 16 | ||||
-rw-r--r-- | engines/glk/scott/detection.cpp | 15 | ||||
-rw-r--r-- | engines/glk/tads/detection.cpp | 14 |
9 files changed, 26 insertions, 111 deletions
diff --git a/engines/glk/advsys/detection.cpp b/engines/glk/advsys/detection.cpp index d6641a6a7c..f14fda2983 100644 --- a/engines/glk/advsys/detection.cpp +++ b/engines/glk/advsys/detection.cpp @@ -78,24 +78,13 @@ bool AdvSysMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames & while (p->_md5 && p->_filesize != filesize && md5 != p->_md5) ++p; - if (p->_filesize) { + if (!p->_gameId) { + const PlainGameDescriptor &desc = ADVSYS_GAME_LIST[0]; + gameList.push_back(GlkDetectedGame(desc.gameId, desc.description, filename, md5, filesize)); + } 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); - } else { - 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); + gameList.push_back(GlkDetectedGame(p->_gameId, gameDesc.description, filename)); } } diff --git a/engines/glk/alan2/detection.cpp b/engines/glk/alan2/detection.cpp index 2338ebb1db..345e230936 100644 --- a/engines/glk/alan2/detection.cpp +++ b/engines/glk/alan2/detection.cpp @@ -71,24 +71,13 @@ bool Alan2MetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g while (p->_gameId && (md5 != p->_md5 || filesize != p->_filesize)) ++p; - DetectedGame gd; if (!p->_gameId) { 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; - + gameList.push_back(GlkDetectedGame(desc.gameId, desc.description, filename, md5, filesize)); } else { PlainGameDescriptor gameDesc = findGame(p->_gameId); - gd = DetectedGame(p->_gameId, gameDesc.description, Common::EN_ANY, Common::kPlatformUnknown); + gameList.push_back(GlkDetectedGame(p->_gameId, gameDesc.description, filename)); } - - gd.addExtraEntry("filename", filename); - gameList.push_back(gd); } return !gameList.empty(); diff --git a/engines/glk/detection.cpp b/engines/glk/detection.cpp index 43f1291b0d..7c6de28456 100644 --- a/engines/glk/detection.cpp +++ b/engines/glk/detection.cpp @@ -58,20 +58,20 @@ namespace Glk { GlkDetectedGame::GlkDetectedGame(const char *gameId, const char *gameDesc, const Common::String &filename) : DetectedGame(gameId, gameDesc, Common::EN_ANY, Common::kPlatformUnknown) { - setGUIOptions(GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)); + setGUIOptions(GUIO4(GUIO_NOSPEECH, GUIO_NOSFX, GUIO_NOMUSIC, GUIO_NOSUBTITLES)); addExtraEntry("filename", filename); } GlkDetectedGame::GlkDetectedGame(const char *gameId, const char *gameDesc, const Common::String &filename, Common::Language lang) : DetectedGame(gameId, gameDesc, lang, Common::kPlatformUnknown) { - setGUIOptions(GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)); + setGUIOptions(GUIO4(GUIO_NOSPEECH, GUIO_NOSFX, GUIO_NOMUSIC, GUIO_NOSUBTITLES)); addExtraEntry("filename", filename); } GlkDetectedGame::GlkDetectedGame(const char *gameId, const char *gameDesc, const Common::String &filename, const Common::String &md5, size_t filesize) : DetectedGame(gameId, gameDesc, Common::UNK_LANG, Common::kPlatformUnknown) { - setGUIOptions(GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)); + setGUIOptions(GUIO4(GUIO_NOSPEECH, GUIO_NOSFX, GUIO_NOMUSIC, GUIO_NOSUBTITLES)); addExtraEntry("filename", filename); canBeAdded = true; diff --git a/engines/glk/frotz/detection.cpp b/engines/glk/frotz/detection.cpp index 4502fc66af..d4ffee33a3 100644 --- a/engines/glk/frotz/detection.cpp +++ b/engines/glk/frotz/detection.cpp @@ -114,29 +114,21 @@ bool FrotzMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g (filesize != p->_filesize && isBlorb))) ++p; - DetectedGame gd; if (!p->_gameId) { // Generic .dat/.zip files don't get reported as matches unless they have a known md5 if (filename.hasSuffixIgnoreCase(".dat") || filename.hasSuffixIgnoreCase(".zip") || emptyBlorb) continue; 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; - + gameList.push_back(GlkDetectedGame(desc.gameId, desc.description, filename, md5, filesize)); } else { GameDescriptor gameDesc = findGame(p->_gameId); - gd = DetectedGame(p->_gameId, gameDesc._description, p->_language, Common::kPlatformUnknown, p->_extra); + DetectedGame gd = DetectedGame(p->_gameId, gameDesc._description, p->_language, Common::kPlatformUnknown, p->_extra); gd.setGUIOptions(p->_guiOptions); - } - gd.addExtraEntry("filename", filename); - gameList.push_back(gd); + gd.addExtraEntry("filename", filename); + gameList.push_back(gd); + } } return !gameList.empty(); diff --git a/engines/glk/glulxe/detection.cpp b/engines/glk/glulxe/detection.cpp index 5ee6285473..39233e4c6b 100644 --- a/engines/glk/glulxe/detection.cpp +++ b/engines/glk/glulxe/detection.cpp @@ -79,25 +79,13 @@ bool GlulxeMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames & while (p->_gameId && (md5 != p->_md5 || filesize != p->_filesize)) ++p; - DetectedGame gd; if (!p->_gameId) { 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; - + gameList.push_back(GlkDetectedGame(desc.gameId, desc.description, filename, md5, filesize)); } else { PlainGameDescriptor gameDesc = findGame(p->_gameId); - gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra); - gd.setGUIOptions(GUIO4(GUIO_NOSPEECH, GUIO_NOSFX, GUIO_NOMUSIC, GUIO_NOSUBTITLES)); + gameList.push_back(GlkDetectedGame(p->_gameId, gameDesc.description, filename)); } - - gd.addExtraEntry("filename", filename); - gameList.push_back(gd); } return !gameList.empty(); diff --git a/engines/glk/hugo/detection.cpp b/engines/glk/hugo/detection.cpp index daff460e4a..bd59717c8d 100644 --- a/engines/glk/hugo/detection.cpp +++ b/engines/glk/hugo/detection.cpp @@ -74,25 +74,13 @@ bool HugoMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &ga while (p->_gameId && (md5 != p->_md5 || filesize != p->_filesize)) ++p; - DetectedGame gd; if (!p->_gameId) { 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; - + gameList.push_back(GlkDetectedGame(desc.gameId, desc.description, filename, md5, filesize)); } else { PlainGameDescriptor gameDesc = findGame(p->_gameId); - gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra); - gd.setGUIOptions(GUIO4(GUIO_NOSPEECH, GUIO_NOSFX, GUIO_NOMUSIC, GUIO_NOSUBTITLES)); + gameList.push_back(GlkDetectedGame(p->_gameId, gameDesc.description, filename)); } - - gd.addExtraEntry("filename", filename); - gameList.push_back(gd); } return !gameList.empty(); diff --git a/engines/glk/magnetic/detection.cpp b/engines/glk/magnetic/detection.cpp index 1552eec77a..cc1714eaf1 100644 --- a/engines/glk/magnetic/detection.cpp +++ b/engines/glk/magnetic/detection.cpp @@ -79,25 +79,13 @@ bool MagneticMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames while (p->_gameId && (md5 != p->_md5 || filesize != p->_filesize)) ++p; - DetectedGame gd; if (!p->_gameId) { 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; - + gameList.push_back(GlkDetectedGame(desc.gameId, desc.description, filename, md5, filesize)); } else { PlainGameDescriptor gameDesc = findGame(p->_gameId); - gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra); - gd.setGUIOptions(GUIO4(GUIO_NOSPEECH, GUIO_NOSFX, GUIO_NOMUSIC, GUIO_NOSUBTITLES)); + gameList.push_back(GlkDetectedGame(p->_gameId, gameDesc.description, filename)); } - - gd.addExtraEntry("filename", filename); - gameList.push_back(gd); } return !gameList.empty(); diff --git a/engines/glk/scott/detection.cpp b/engines/glk/scott/detection.cpp index 03445ea090..f0a6e47174 100644 --- a/engines/glk/scott/detection.cpp +++ b/engines/glk/scott/detection.cpp @@ -77,28 +77,17 @@ bool ScottMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g while (p->_md5 && p->_filesize != filesize && md5 != p->_md5) ++p; - 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; - + gameList.push_back(GlkDetectedGame(desc.gameId, desc.description, filename, md5, filesize)); } 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(GlkDetectedGame(p->_gameId, gameDesc.description, filename)); } - - gameList.push_back(gd); } return !gameList.empty(); diff --git a/engines/glk/tads/detection.cpp b/engines/glk/tads/detection.cpp index 8ea996b7bc..4cb7e560e3 100644 --- a/engines/glk/tads/detection.cpp +++ b/engines/glk/tads/detection.cpp @@ -107,21 +107,13 @@ bool TADSMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &ga DetectedGame gd; if (!p->_gameId) { 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; - + gameList.push_back(GlkDetectedGame(desc._gameId, desc._description, filename, md5, filesize)); } else { PlainGameDescriptor gameDesc = findGame(p->_gameId); gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra); + gd.addExtraEntry("filename", filename); + gameList.push_back(gd); } - - gd.addExtraEntry("filename", filename); - gameList.push_back(gd); } return !gameList.empty(); |