diff options
author | Johannes Schickel | 2016-03-09 01:22:12 +0100 |
---|---|---|
committer | Johannes Schickel | 2016-03-09 01:22:12 +0100 |
commit | 2ca642e3e27ceb698909100953dfdcbd3f2f969f (patch) | |
tree | b3f59845e6c01a1caa4c23d2b1dcf723ffd551da | |
parent | c0163de084a29303972e52d2a659f7163795895f (diff) | |
download | scummvm-rg350-2ca642e3e27ceb698909100953dfdcbd3f2f969f.tar.gz scummvm-rg350-2ca642e3e27ceb698909100953dfdcbd3f2f969f.tar.bz2 scummvm-rg350-2ca642e3e27ceb698909100953dfdcbd3f2f969f.zip |
SCUMM: Fix bugs #7070, #7071.
When adding support for Russian fan translations the font source data was
accidentally switched to the Russian font data for all game versions, not just
the Russian one. Now we only use the Russian font data only for the Russian
versions.
Bug #7071 "MM V2: Umlauts disappeared in German versions" is a regression from
556d65713b8ed50c734b2466529cb1c4ac44cf36.
Bug #7070 "ZAK V2: Umlauts disappeared in German versions" is a regression from
c809a65b93d23aa30296f7f22ef4b160f628b9aa.
-rw-r--r-- | engines/scumm/charset-fontdata.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/engines/scumm/charset-fontdata.cpp b/engines/scumm/charset-fontdata.cpp index 23e89b1878..a1e92a9950 100644 --- a/engines/scumm/charset-fontdata.cpp +++ b/engines/scumm/charset-fontdata.cpp @@ -591,35 +591,40 @@ CharsetRendererV2::CharsetRendererV2(ScummEngine *vm, Common::Language language) _fontHeight = 8; _curId = 0; - const byte *replacementData = NULL; + const byte *replacementMap = NULL, *replacementData = NULL; int replacementChars = 0; switch (language) { case Common::DE_DEU: if (_vm->_game.version == 0) { - replacementData = germanCharsetDataV0; + replacementMap = germanCharsetDataV0; replacementChars = sizeof(germanCharsetDataV0) / 2; } else { - replacementData = germanCharsetDataV2; + replacementMap = germanCharsetDataV2; replacementChars = sizeof(germanCharsetDataV2) / 2; } + replacementData = specialCharsetData; break; case Common::FR_FRA: - replacementData = frenchCharsetDataV2; + replacementMap = frenchCharsetDataV2; replacementChars = sizeof(frenchCharsetDataV2) / 2; + replacementData = specialCharsetData; break; case Common::IT_ITA: - replacementData = italianCharsetDataV2; + replacementMap = italianCharsetDataV2; replacementChars = sizeof(italianCharsetDataV2) / 2; + replacementData = specialCharsetData; break; case Common::ES_ESP: - replacementData = spanishCharsetDataV2; + replacementMap = spanishCharsetDataV2; replacementChars = sizeof(spanishCharsetDataV2) / 2; + replacementData = specialCharsetData; break; case Common::RU_RUS: if (((_vm->_game.id == GID_MANIAC) || (_vm->_game.id == GID_ZAK)) && (_vm->_game.version == 2)) { - replacementData = russCharsetDataV2; + replacementMap = russCharsetDataV2; replacementChars = sizeof(russCharsetDataV2) / 2; + replacementData = russianCharsetDataV2; } else { _fontPtr = russianCharsetDataV2; } @@ -629,20 +634,16 @@ CharsetRendererV2::CharsetRendererV2(ScummEngine *vm, Common::Language language) break; } - if (replacementData) { + if (replacementMap && replacementData) { _fontPtr = new byte[sizeof(englishCharsetDataV2)]; _deleteFontPtr = true; memcpy(const_cast<byte *>(_fontPtr), englishCharsetDataV2, sizeof(englishCharsetDataV2)); for (int i = 0; i < replacementChars; i++) { - int ch1 = replacementData[2 * i]; - int ch2 = replacementData[2 * i + 1]; + int ch1 = replacementMap[2 * i]; + int ch2 = replacementMap[2 * i + 1]; - if (((_vm->_game.id == GID_MANIAC) || (_vm->_game.id == GID_ZAK)) && (_vm->_game.version == 2)) { - memcpy(const_cast<byte *>(_fontPtr) + 8 * ch1, russianCharsetDataV2 + 8 * ch2, 8); - } else { - memcpy(const_cast<byte *>(_fontPtr) + 8 * ch1, specialCharsetData + 8 * ch2, 8); - } + memcpy(const_cast<byte *>(_fontPtr) + 8 * ch1, replacementData + 8 * ch2, 8); } } else _deleteFontPtr = false; |