[Scummvm-cvs-logs] SF.net SVN: scummvm:[48830] scummvm/branches/branch-1-1-0/engines/gob/draw. cpp

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Wed Apr 28 21:17:22 CEST 2010


Revision: 48830
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48830&view=rev
Author:   drmccoy
Date:     2010-04-28 19:17:22 +0000 (Wed, 28 Apr 2010)

Log Message:
-----------
Backport: Only draw letters that actually fit on the surface. Should fix bug #2992268 (Reproducible crash creating Intuition formula

Modified Paths:
--------------
    scummvm/branches/branch-1-1-0/engines/gob/draw.cpp

Modified: scummvm/branches/branch-1-1-0/engines/gob/draw.cpp
===================================================================
--- scummvm/branches/branch-1-1-0/engines/gob/draw.cpp	2010-04-28 19:14:20 UTC (rev 48829)
+++ scummvm/branches/branch-1-1-0/engines/gob/draw.cpp	2010-04-28 19:17:22 UTC (rev 48830)
@@ -384,7 +384,12 @@
 		int16 transp, SurfaceDesc &dest, const Font &font) {
 
 	while (*str != '\0') {
-		_vm->_video->drawLetter(*str, x, y, font, transp, color1, color2, dest);
+		const int16 charRight  = x + font.getCharWidth(*str);
+		const int16 charBottom = y + font.getCharHeight();
+
+		if ((charRight <= dest.getWidth()) && (charBottom <= dest.getHeight()))
+			_vm->_video->drawLetter(*str, x, y, font, transp, color1, color2, dest);
+
 		x += font.getCharWidth(*str);
 		str++;
 	}


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