[Scummvm-cvs-logs] SF.net SVN: scummvm:[48829] scummvm/trunk/engines/gob/draw.cpp

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Wed Apr 28 21:14:20 CEST 2010


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

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

Modified Paths:
--------------
    scummvm/trunk/engines/gob/draw.cpp

Modified: scummvm/trunk/engines/gob/draw.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw.cpp	2010-04-28 18:55:48 UTC (rev 48828)
+++ scummvm/trunk/engines/gob/draw.cpp	2010-04-28 19:14:20 UTC (rev 48829)
@@ -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