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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Apr 17 01:03:46 CEST 2010


Revision: 48678
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48678&view=rev
Author:   m_kiewitz
Date:     2010-04-16 23:03:46 +0000 (Fri, 16 Apr 2010)

Log Message:
-----------
SCI: handle given coordinate to draw() inside SJIS font support as if the horizontal part would be the center of the character, fixes not perfectly centered japanese text. I assume that PC98 ROM also handled it that way. The actual cause for those "bad" coordinates is GetLongest(), but that behaviour is definitely how sierra sci does it

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

Modified: scummvm/trunk/engines/sci/graphics/fontsjis.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/fontsjis.cpp	2010-04-16 20:49:16 UTC (rev 48677)
+++ scummvm/trunk/engines/sci/graphics/fontsjis.cpp	2010-04-16 23:03:46 UTC (rev 48678)
@@ -74,7 +74,12 @@
 void GfxFontSjis::draw(uint16 chr, int16 top, int16 left, byte color, bool greyedOutput) {
 	// TODO: Check, if character fits on screen - if it doesn't we need to skip it
 	//  Normally SCI cuts the character and draws the part that fits, but the common SJIS doesn't support that
-	_screen->putKanjiChar(_commonFont, left, top, chr, color);
+	// It seems as if the PC98 ROM actually uses the given position as the center of the character, that's why we
+	//  subtract 4 here. Otherwise the characters will be slightly to the right. The actual cause for "bad" coordinates
+	//  is GetLongest() inside GfxText16. It leaves the last character that is causing a split to a new line within the
+	//  current line instead of removing it. That way the result will actually be too long (not our fault, sierra sci
+	//  does it the same way)
+	_screen->putKanjiChar(_commonFont, left - 4, top, chr, color);
 }
 
 } // End of namespace Sci


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