mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-26 20:59:00 +00:00
SCUMM/FM-TOWNS: more improvements to japanese font drawing
(MI1 intro is still not right) svn-id: r53558
This commit is contained in:
parent
3dc498c5ec
commit
1d60fc45f2
@ -383,8 +383,8 @@ int CharsetRendererClassic::getCharWidth(uint16 chr) {
|
||||
|
||||
if (_vm->_useCJKMode) {
|
||||
if (_vm->_game.platform == Common::kPlatformFMTowns) {
|
||||
if ((chr & 0xff00) == 0xfd00) {
|
||||
chr &= 0xff;
|
||||
if ((chr & 0x00ff) == 0x00fd) {
|
||||
chr >>= 8;
|
||||
} else if (chr >= 256) {
|
||||
spacing = 8;
|
||||
} else if (useTownsFontRomCharacter(chr)) {
|
||||
@ -496,8 +496,8 @@ int CharsetRenderer::getStringWidth(int arg, const byte *text) {
|
||||
|
||||
if (_vm->_useCJKMode) {
|
||||
if (_vm->_game.platform == Common::kPlatformFMTowns) {
|
||||
if ((chr >= 0x80 && chr <= 0x9f) || (chr >= 0xe0 && chr <= 0xfd))
|
||||
chr = (chr << 8) | text[pos++];
|
||||
if (checkSJISCode(chr))
|
||||
chr |= (text[pos++] << 8);
|
||||
} else if (chr & 0x80) {
|
||||
pos++;
|
||||
width += _vm->_2byteWidth;
|
||||
@ -515,7 +515,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;
|
||||
byte chr;
|
||||
uint16 chr;
|
||||
int oldID = getCurID();
|
||||
int code = (_vm->_game.heversion >= 80) ? 127 : 64;
|
||||
|
||||
@ -579,8 +579,8 @@ void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth) {
|
||||
|
||||
if (_vm->_useCJKMode) {
|
||||
if (_vm->_game.platform == Common::kPlatformFMTowns) {
|
||||
if ((chr >= 0x80 && chr <= 0x9f) || (chr >= 0xe0 && chr <= 0xfd))
|
||||
chr = (chr << 8) | str[pos++];
|
||||
if (checkSJISCode(chr))
|
||||
chr |= (str[pos++] << 8);
|
||||
curw += getCharWidth(chr);
|
||||
} else if (chr & 0x80) {
|
||||
pos++;
|
||||
@ -894,13 +894,16 @@ void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) {
|
||||
|
||||
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
|
||||
processTownsCharsetColors(_bytesPerPixel);
|
||||
bool noSjis = false;
|
||||
|
||||
if (_vm->_game.platform == Common::kPlatformFMTowns && _vm->_useCJKMode) {
|
||||
if ((chr & 0xff00) == 0xfd00)
|
||||
chr &= 0xff;
|
||||
if ((chr & 0x00ff) == 0x00fd) {
|
||||
chr >>= 8;
|
||||
noSjis = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (useTownsFontRomCharacter(chr)) {
|
||||
if (useTownsFontRomCharacter(chr) && !noSjis) {
|
||||
charPtr = 0;
|
||||
_vm->_cjkChar = chr;
|
||||
enableShadow(true);
|
||||
@ -909,7 +912,7 @@ void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) {
|
||||
offsX = offsY = 0;
|
||||
} else
|
||||
#endif
|
||||
if (_vm->_useCJKMode && (chr >= 128)) {
|
||||
if (_vm->_useCJKMode && (chr >= 128) && !noSjis) {
|
||||
enableShadow(true);
|
||||
origWidth = width = _vm->_2byteWidth;
|
||||
origHeight = height = _vm->_2byteHeight;
|
||||
|
@ -1016,6 +1016,7 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize)
|
||||
uint num = 0;
|
||||
uint32 val;
|
||||
byte chr;
|
||||
byte lastChr = 0;
|
||||
const byte *src;
|
||||
byte *end;
|
||||
byte transBuf[384];
|
||||
@ -1123,12 +1124,12 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize)
|
||||
} else if (_game.id == GID_DIG && (chr == 1 || chr == 2 || chr == 3 || chr == 8)) {
|
||||
// Skip these characters
|
||||
} else {
|
||||
if (!(chr == '@') || (_game.id == GID_CMI && _language == Common::ZH_TWN) ||
|
||||
if ((chr != '@') || (_game.id == GID_CMI && _language == Common::ZH_TWN) ||
|
||||
(_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine && _language == Common::JA_JPN) ||
|
||||
(_game.platform == Common::kPlatformFMTowns && _language == Common::JA_JPN))
|
||||
{
|
||||
(_game.platform == Common::kPlatformFMTowns && _language == Common::JA_JPN && checkSJISCode(lastChr))) {
|
||||
*dst++ = chr;
|
||||
}
|
||||
lastChr = chr;
|
||||
}
|
||||
|
||||
// Check for a buffer overflow
|
||||
|
Loading…
x
Reference in New Issue
Block a user