aboutsummaryrefslogtreecommitdiff
path: root/scumm/smush
diff options
context:
space:
mode:
authorMax Horn2004-10-23 23:08:53 +0000
committerMax Horn2004-10-23 23:08:53 +0000
commitb60febe8a81120a21c2346bb8bc4255038b695e8 (patch)
tree57aa745c3b460152db976ecf1bf6d78ef6e03d14 /scumm/smush
parente8811e71584ff4f4530b462e0b390281fadba88b (diff)
downloadscummvm-rg350-b60febe8a81120a21c2346bb8bc4255038b695e8.tar.gz
scummvm-rg350-b60febe8a81120a21c2346bb8bc4255038b695e8.tar.bz2
scummvm-rg350-b60febe8a81120a21c2346bb8bc4255038b695e8.zip
Patch #1048283 (Improved CJK / FM-TOWNS support & some documention)
svn-id: r15671
Diffstat (limited to 'scumm/smush')
-rw-r--r--scumm/smush/smush_font.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/scumm/smush/smush_font.cpp b/scumm/smush/smush_font.cpp
index 188dfd6773..b830a78e82 100644
--- a/scumm/smush/smush_font.cpp
+++ b/scumm/smush/smush_font.cpp
@@ -43,7 +43,11 @@ int SmushFont::getStringWidth(const char *str) {
int width = 0;
while (*str) {
- width += getCharWidth(*str++);
+ if(*str & 0x80 && g_scumm->_useCJKMode) {
+ width += g_scumm->_2byteWidth + 1;
+ str += 2;
+ } else
+ width += getCharWidth(*str++);
}
return width;
}
@@ -118,18 +122,25 @@ int SmushFont::draw2byte(byte *buffer, int dst_width, int x, int y, int idx) {
int h = _vm->_2byteHeight;
byte *src = _vm->get2byteCharPtr(idx);
- byte *dst = buffer + dst_width * (y + (_vm->_gameId == GID_CMI ? 7 : 2)) + x;
+ byte *dst = buffer + dst_width * (y + (_vm->_gameId == GID_CMI ? 7 : (_vm->_gameId == GID_DIG ? 2 : 0))) + x;
byte bits = 0;
char color = (_color != -1) ? _color : 1;
+
if (_new_colors)
- color = (char)0xff; //FIXME;
+ color = (char)0xff;
+
+ if (g_scumm->_gameId == GID_FT)
+ color = 1;
+
for (int j = 0; j < h; j++) {
for (int i = 0; i < w; i++) {
if ((i % 8) == 0)
bits = *src++;
if (bits & revBitMask[i % 8]) {
dst[i + 1] = 0;
+ dst[dst_width + i] = 0;
+ dst[dst_width + i + 1] = 0;
dst[i] = color;
}
}