[Scummvm-cvs-logs] CVS: scummvm/scumm debugger.cpp,1.55,1.56

Max Horn fingolfin at users.sourceforge.net
Sat May 31 07:42:07 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv4062

Modified Files:
	debugger.cpp 
Log Message:
perform y ciping for box polygons, too (avoids crashes)

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- debugger.cpp	31 May 2003 14:20:24 -0000	1.55
+++ debugger.cpp	31 May 2003 14:24:06 -0000	1.56
@@ -762,19 +762,24 @@
 	VirtScreen *vs = &scumm->virtscr[0];
 	byte *ptr;
 
+	// Clip y
+	y += scumm->_screenTop;
+	if (y < 0 || y >= scumm->_screenHeight)
+		return;
+
 	if (x2 < x1)
 		SWAP(x2, x1);
 	
 	// Clip x1 / x2
 	const int left = scumm->_screenStartStrip * 8;
-	const int right = left + scumm->_screenWidth;
+	const int right = scumm->_screenEndStrip * 8;
 	if (x1 < left)
 		x1 = left;
 	if (x2 >= right)
 		x2 = right - 1;
+	
 
-	ptr = vs->screenPtr + x1
-			+ (y + scumm->camera._cur.y - scumm->_screenHeight / 2) * scumm->_screenWidth;
+	ptr = vs->screenPtr + x1 + y * scumm->_screenWidth;
 
 	while (x1++ <= x2) {
 		*ptr++ = color;





More information about the Scummvm-git-logs mailing list