diff options
author | Eugene Sandulenko | 2009-12-31 18:52:42 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2009-12-31 18:52:42 +0000 |
commit | d10fc79836c03647c5332475a5a43ccf489fc7c3 (patch) | |
tree | 2090e5b8b95c2f1955d9124d2214b13d9d2f1985 /engines/scumm/detection.cpp | |
parent | 6d879f15b7d30b623ebf66ff79e801f6ad5a017c (diff) | |
download | scummvm-rg350-d10fc79836c03647c5332475a5a43ccf489fc7c3.tar.gz scummvm-rg350-d10fc79836c03647c5332475a5a43ccf489fc7c3.tar.bz2 scummvm-rg350-d10fc79836c03647c5332475a5a43ccf489fc7c3.zip |
Add support for Chinese translated games.
svn-id: r46805
Diffstat (limited to 'engines/scumm/detection.cpp')
-rw-r--r-- | engines/scumm/detection.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index c23d8a5529..a32c0892a7 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -210,7 +210,17 @@ static bool searchFSNode(const Common::FSList &fslist, const Common::String &nam // The following function tries to detect the language for COMI and DIG static Common::Language detectLanguage(const Common::FSList &fslist, byte id) { - assert(id == GID_CMI || id == GID_DIG); + // First try to detect Chinese translation + Common::FSNode fontFile; + + if (searchFSNode(fslist, "chinese_gb16x12.fnt", fontFile)) { + debug(0, "Chinese detected"); + return Common::ZH_CNA; + } + + // Now try to detect COMI and Dig by language files + if (id != GID_CMI && id != GID_DIG) + return Common::UNK_LANG; // Check for LANGUAGE.BND (Dig) resp. LANGUAGE.TAB (CMI). // These are usually inside the "RESOURCE" subdirectory. @@ -314,8 +324,8 @@ static void computeGameSettingsFromMD5(const Common::FSList &fslist, const GameF dr.game.features |= GF_DEMO; } - // HACK: Detect COMI & Dig languages - if (dr.language == UNK_LANG && (dr.game.id == GID_CMI || dr.game.id == GID_DIG)) { + // HACK: Try to detect languages for translated games + if (dr.language == UNK_LANG) { dr.language = detectLanguage(fslist, dr.game.id); } break; @@ -442,6 +452,8 @@ static void detectGames(const Common::FSList &fslist, Common::List<DetectorResul continue; } + // HACK: Perhaps it is some modified translation? + dr.language = detectLanguage(fslist, g->id); // Add the game/variant to the candidates list if it is consistent // with the file(s) we are seeing. |