[Scummvm-cvs-logs] SF.net SVN: scummvm:[41998] scummvm/branches/gsoc2009-draci/engines/draci

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Wed Jul 1 18:14:05 CEST 2009


Revision: 41998
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41998&view=rev
Author:   dkasak13
Date:     2009-07-01 16:14:04 +0000 (Wed, 01 Jul 2009)

Log Message:
-----------
Made Text objects calculate their widths and heights properly.

Modified Paths:
--------------
    scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp
    scummvm/branches/gsoc2009-draci/engines/draci/sprite.cpp

Modified: scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp	2009-07-01 16:01:07 UTC (rev 41997)
+++ scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp	2009-07-01 16:14:04 UTC (rev 41998)
@@ -129,7 +129,7 @@
 	Common::String testString = "Testing, testing, read all about it!";
 	xpos = (kScreenWidth - _font->getStringWidth(testString, 1)) / 2;
 	ypos = 130;
-	Text txt(testString, _font, kFontColour1, xpos, ypos, 1);
+	Text txt(testString, _font, kFontColour1, xpos, ypos, 0, 1);
 	
 	txt.draw(surf);
 

Modified: scummvm/branches/gsoc2009-draci/engines/draci/sprite.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/sprite.cpp	2009-07-01 16:01:07 UTC (rev 41997)
+++ scummvm/branches/gsoc2009-draci/engines/draci/sprite.cpp	2009-07-01 16:14:04 UTC (rev 41998)
@@ -145,6 +145,9 @@
 	_colour = fontColour;
 	
 	_font = font;
+
+	_width = _font->getStringWidth(str, _spacing);
+	_height = _font->getFontHeight();
 } 
 
 Text::~Text() {
@@ -157,6 +160,9 @@
 	uint len = str.size();
 	_length = len;
 
+	_width = _font->getStringWidth(str, _spacing);
+	_height = _font->getFontHeight();
+
 	 _text = new byte[len];
 	memcpy(_text, str.c_str(), len);
 }


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