[Scummvm-cvs-logs] SF.net SVN: scummvm:[48784] scummvm/trunk/engines/sci/graphics/text16.cpp

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Apr 24 17:50:23 CEST 2010


Revision: 48784
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48784&view=rev
Author:   m_kiewitz
Date:     2010-04-24 15:50:23 +0000 (Sat, 24 Apr 2010)

Log Message:
-----------
SCI: changing GetLongest() on kanji (again) hopefully it's now working as in sierra sci :P

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/text16.cpp

Modified: scummvm/trunk/engines/sci/graphics/text16.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/text16.cpp	2010-04-24 14:10:52 UTC (rev 48783)
+++ scummvm/trunk/engines/sci/graphics/text16.cpp	2010-04-24 15:50:23 UTC (rev 48784)
@@ -212,15 +212,25 @@
 		curCharCount++;
 	}
 	if (maxChars == 0) {
-		// Text w/o space, supposingly kanji - we don't adjust back to last char here strangely. If we do, we don't
-		//  get the same text cutting like in sierra sci
+		// Text w/o space, supposingly kanji
 		maxChars = curCharCount;
 
+		uint16 nextChar;
+
+		// we remove the last char only, if maxWidth was actually equal width before adding the last char
+		//  otherwise we won't get the same cutting as in sierra sci
+		if (maxWidth == (width - _font->getCharWidth(curChar))) {
+			maxChars--;
+			if (curChar > 0xFF)
+				maxChars--;
+			nextChar = curChar;
+		} else {
+			nextChar = (*(const byte *)text++);
+			if (_font->isDoubleByte(nextChar))
+				nextChar |= (*(const byte *)text++) << 8;
+		}
 		// sierra checked the following character against a punctuation kanji table
-		uint16 nextChar = (*(const byte *)text++);
-		if (_font->isDoubleByte(nextChar)) {
-			nextChar |= (*(const byte *)text++) << 8;
-
+		if (nextChar > 0xFF) {
 			// if the character is punctuation, we go back one character
 			uint nonBreakingNr = 0;
 			while (text16_punctuationSjis[nonBreakingNr]) {


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