[Scummvm-cvs-logs] SF.net SVN: scummvm:[53725] scummvm/trunk/engines/scumm/charset.cpp

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Sat Oct 23 02:30:22 CEST 2010


Revision: 53725
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53725&view=rev
Author:   athrxx
Date:     2010-10-23 00:30:21 +0000 (Sat, 23 Oct 2010)

Log Message:
-----------
SCUMM/FM-TOWNS JAPANESE: fix font drawing in MI1 intro

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/charset.cpp

Modified: scummvm/trunk/engines/scumm/charset.cpp
===================================================================
--- scummvm/trunk/engines/scumm/charset.cpp	2010-10-22 23:39:29 UTC (rev 53724)
+++ scummvm/trunk/engines/scumm/charset.cpp	2010-10-23 00:30:21 UTC (rev 53725)
@@ -383,8 +383,8 @@
 
  	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 @@
 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 @@
 		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 @@
 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 @@
 		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++;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list