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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Tue Jul 27 00:58:07 CEST 2010


Revision: 51335
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51335&view=rev
Author:   m_kiewitz
Date:     2010-07-26 22:58:06 +0000 (Mon, 26 Jul 2010)

Log Message:
-----------
SCI: fixing text fonts not working correctly

fixes sq5 and bug #3034766

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-07-26 21:25:07 UTC (rev 51334)
+++ scummvm/trunk/engines/sci/graphics/text16.cpp	2010-07-26 22:58:06 UTC (rev 51335)
@@ -289,6 +289,8 @@
 
 	if (fontId != -1)
 		SetFont(fontId);
+	else
+		fontId = oldFontId;
 
 	if (g_sci->getLanguage() == Common::JA_JPN)
 		SwitchToFont900OnSjis(text);
@@ -296,7 +298,7 @@
 	rect.top = rect.left = 0;
 
 	if (maxWidth < 0) { // force output as single line
-		StringWidth(text, oldFontId, textWidth, textHeight);
+		StringWidth(text, fontId, textWidth, textHeight);
 		rect.bottom = textHeight;
 		rect.right = textWidth;
 	} else {
@@ -308,7 +310,7 @@
 			charCount = GetLongest(curPos, rect.right, oldFontId);
 			if (charCount == 0)
 				break;
-			Width(curPos, 0, charCount, oldFontId, textWidth, textHeight);
+			Width(curPos, 0, charCount, fontId, textWidth, textHeight);
 			maxTextWidth = MAX(textWidth, maxTextWidth);
 			totalHeight += textHeight;
 			curPos += charCount;
@@ -390,6 +392,8 @@
 
 	if (fontId != -1)
 		SetFont(fontId);
+	else
+		fontId = orgFontId;
 
 	if (g_sci->getLanguage() == Common::JA_JPN) {
 		if (SwitchToFont900OnSjis(text))
@@ -420,9 +424,9 @@
 		_ports->moveTo(rect.left + offset, rect.top + hline);
 
 		if (bshow) {
-			Show(text, 0, charCount, orgFontId, orgPenColor);
+			Show(text, 0, charCount, fontId, orgPenColor);
 		} else {
-			Draw(text, 0, charCount, orgFontId, orgPenColor);
+			Draw(text, 0, charCount, fontId, orgPenColor);
 		}
 
 		hline += textHeight;


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