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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Thu Jan 27 21:50:43 CET 2011


Revision: 55574
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55574&view=rev
Author:   drmccoy
Date:     2011-01-27 20:50:43 +0000 (Thu, 27 Jan 2011)

Log Message:
-----------
GOB: Stop drawing a letter on surface boundaries

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

Modified: scummvm/trunk/engines/gob/video.cpp
===================================================================
--- scummvm/trunk/engines/gob/video.cpp	2011-01-27 20:50:18 UTC (rev 55573)
+++ scummvm/trunk/engines/gob/video.cpp	2011-01-27 20:50:43 UTC (rev 55574)
@@ -110,18 +110,21 @@
 
 	nWidth >>= 3;
 
-	for (int i = 0; i < _itemHeight; i++) {
+	for (int i = 0; (i < _itemHeight) && dst.isValid(); i++) {
 		int width = _itemWidth;
 
 		for (int k = 0; k < nWidth; k++) {
 
 			data = *src++;
 			for (int j = 0; j < MIN(8, width); j++) {
-				if (data & 0x80)
-					dst.set(color1);
-				else if (!transp)
-					dst.set(color2);
 
+				if (dst.isValid()) {
+					if (data & 0x80)
+						dst.set(color1);
+					else if (!transp)
+						dst.set(color2);
+				}
+
 				dst++;
 				data <<= 1;
 			}


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