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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Fri Jul 30 18:08:27 CEST 2010


Revision: 51511
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51511&view=rev
Author:   m_kiewitz
Date:     2010-07-30 16:08:27 +0000 (Fri, 30 Jul 2010)

Log Message:
-----------
SCI: fixing font code handling in kTextSize

fixes incorrect window proportions in sq5 when hailing ship at clorox II

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-30 15:26:30 UTC (rev 51510)
+++ scummvm/trunk/engines/sci/graphics/text16.cpp	2010-07-30 16:08:27 UTC (rev 51511)
@@ -233,9 +233,6 @@
 
 void GfxText16::Width(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight) {
 	uint16 curChar;
-	GuiResourceId oldFontId = GetFontId();
-	int16 oldPenColor = _ports->_curPort->penClr;
-
 	textWidth = 0; textHeight = 0;
 
 	GetFont();
@@ -264,13 +261,17 @@
 			}
 		}
 	}
-	SetFont(oldFontId);
-	_ports->penColor(oldPenColor);
 	return;
 }
 
 void GfxText16::StringWidth(const char *str, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight) {
+	GuiResourceId oldFontId = GetFontId();
+	int16 oldPenColor = _ports->_curPort->penClr;
+
 	Width(str, 0, (int16)strlen(str), orgFontId, textWidth, textHeight);
+
+	SetFont(oldFontId);
+	_ports->penColor(oldPenColor);
 }
 
 void GfxText16::ShowString(const char *str, GuiResourceId orgFontId, int16 orgPenColor) {


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