[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.260,2.261

Max Horn fingolfin at users.sourceforge.net
Thu Jan 8 13:45:02 CET 2004


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

Modified Files:
	gfx.cpp 
Log Message:
more cleanup

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.260
retrieving revision 2.261
diff -u -d -r2.260 -r2.261
--- gfx.cpp	8 Jan 2004 21:21:40 -0000	2.260
+++ gfx.cpp	8 Jan 2004 21:44:03 -0000	2.261
@@ -544,9 +544,7 @@
 
 void ScummEngine::restoreBG(Common::Rect rect, byte backColor) {
 	VirtScreen *vs;
-	int topline, height, width;
 	byte *backbuff;
-	bool lightsOn;
 
 	if (rect.top < 0)
 		rect.top = 0;
@@ -559,8 +557,9 @@
 	if (rect.left > vs->width)
 		return;
 
-	topline = vs->topline;
+	const int topline = vs->topline;
 
+	// Move rect up
 	rect.top -= topline;
 	rect.bottom -= topline;
 
@@ -571,16 +570,18 @@
 	int offset = rect.top * vs->width + vs->xstart + rect.left;
 	backbuff = vs->screenPtr + offset;
 
-	height = rect.height();
-	width = rect.width();
-
-	// Check whether lights are turned on or not
-	lightsOn = isLightOn();
+	const int height = rect.height();
+	const int width = rect.width();
 
-	if (vs->hasTwoBuffers && _currentRoom != 0 && lightsOn ) {
+	if (vs->hasTwoBuffers && _currentRoom != 0 && isLightOn()) {
 		blit(backbuff, vs->backBuf + offset, width, height);
 		if (vs->number == kMainVirtScreen && _charset->_hasMask && height) {
 			byte *mask;
+
+			// Move rect back
+			rect.top += topline;
+			rect.bottom += topline;
+
 			// Note: At first sight it may look as if this could
 			// be optimized to (rect.right - rect.left) / 8 and
 			// thus to width / 8, but that's not the case since
@@ -591,8 +592,6 @@
 				mask_width++;
 
 			mask = getMaskBuffer(rect.left, rect.top + topline, 0);
-			if (vs->number == kMainVirtScreen)
-				mask += vs->topline * gdi._numStrips;
 
 			do {
 				memset(mask, 0, mask_width);





More information about the Scummvm-git-logs mailing list