[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.448,2.449

Max Horn fingolfin at users.sourceforge.net
Sat May 14 15:56:50 CEST 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30643

Modified Files:
	gfx.cpp 
Log Message:
Merge loop limits into one)

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.448
retrieving revision 2.449
diff -u -d -r2.448 -r2.449
--- gfx.cpp	14 May 2005 14:06:35 -0000	2.448
+++ gfx.cpp	14 May 2005 22:55:39 -0000	2.449
@@ -1414,9 +1414,17 @@
 	//if (_vm->_NESStartStrip > 0)
 	//	stripnr -= _vm->_NESStartStrip;
 
-	for (int k = 0; 
-		k < numstrip && sx + k < _numStrips && (x + k) * 8 < MAX(_vm->_roomWidth, (int) vs->w);
-		++k, ++stripnr) {
+	// Compute the number of strips we have to iterate over.
+	// TODO/FIXME: The computation of its initial value looks very fishy.
+	// It was added as a kind of hack to fix some corner cases, but it compares
+	// the room width to the virtual screen width; but the former should always
+	// be bigger than the latter (except for MM NES, maybe)... strange
+	int limit = MAX(_vm->_roomWidth, (int) vs->w) / 8 - x;
+	if (limit > numstrip)
+		limit = numstrip;
+	if (limit > _numStrips - sx)
+		limit = _numStrips - sx;
+	for (int k = 0; k < limit; ++k, ++stripnr) {
 		CHECK_HEAP;
 
 		if (y < vs->tdirty[sx + k])





More information about the Scummvm-git-logs mailing list