diff options
author | Florian Kagerer | 2010-10-23 00:30:21 +0000 |
---|---|---|
committer | Florian Kagerer | 2010-10-23 00:30:21 +0000 |
commit | a82b0435a2f6777fd91c85dc0058c9dbd2568306 (patch) | |
tree | 266e4c50dd47761049223fec1f6b9561aa5f92f4 | |
parent | fe06b7d151f4752b51191cd3475ba85953df2d6a (diff) | |
download | scummvm-rg350-a82b0435a2f6777fd91c85dc0058c9dbd2568306.tar.gz scummvm-rg350-a82b0435a2f6777fd91c85dc0058c9dbd2568306.tar.bz2 scummvm-rg350-a82b0435a2f6777fd91c85dc0058c9dbd2568306.zip |
SCUMM/FM-TOWNS JAPANESE: fix font drawing in MI1 intro
svn-id: r53725
-rw-r--r-- | engines/scumm/charset.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp index 7de424d291..e75a45212e 100644 --- a/engines/scumm/charset.cpp +++ b/engines/scumm/charset.cpp @@ -383,8 +383,8 @@ int CharsetRendererClassic::getCharWidth(uint16 chr) { if (_vm->_useCJKMode) { if (_vm->_game.platform == Common::kPlatformFMTowns) { - if ((chr & 0x00ff) == 0x00fd) { - chr >>= 8; + if ((chr & 0xff00) == 0xfd00) { + chr &= 0xff; } else if (chr >= 256) { spacing = 8; } else if (useTownsFontRomCharacter(chr)) { @@ -435,7 +435,7 @@ bool CharsetRendererClassic::useTownsFontRomCharacter(uint16 chr) { int CharsetRenderer::getStringWidth(int arg, const byte *text) { int pos = 0; int width = 1; - uint16 chr; + int chr; int oldID = getCurID(); int code = (_vm->_game.heversion >= 80) ? 127 : 64; @@ -497,7 +497,9 @@ int CharsetRenderer::getStringWidth(int arg, const byte *text) { if (_vm->_useCJKMode) { if (_vm->_game.platform == Common::kPlatformFMTowns) { if (checkSJISCode(chr)) - chr |= (text[pos++] << 8); + // This strange character conversion is the exact way the original does it here. + // This is the only way to get an accurate text formatting in the MI1 intro. + chr = (int8)text[pos++] | (chr << 8); } else if (chr & 0x80) { pos++; width += _vm->_2byteWidth; @@ -515,7 +517,7 @@ int CharsetRenderer::getStringWidth(int arg, const byte *text) { void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth) { int lastspace = -1; int curw = 1; - uint16 chr; + int chr; int oldID = getCurID(); int code = (_vm->_game.heversion >= 80) ? 127 : 64; @@ -580,7 +582,9 @@ void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth) { if (_vm->_useCJKMode) { if (_vm->_game.platform == Common::kPlatformFMTowns) { if (checkSJISCode(chr)) - chr |= (str[pos++] << 8); + // This strange character conversion is the exact way the original does it here. + // This is the only way to get an accurate text formatting in the MI1 intro. + chr = (int8)str[pos++] | (chr << 8); curw += getCharWidth(chr); } else if (chr & 0x80) { pos++; |