[Scummvm-cvs-logs] CVS: scummvm/bs2/driver render.cpp,1.29,1.30

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Sun Sep 28 10:19:06 CEST 2003


Update of /cvsroot/scummvm/scummvm/bs2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv10146/driver

Modified Files:
	render.cpp 
Log Message:
cleanup


Index: render.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/render.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- render.cpp	28 Sep 2003 14:13:57 -0000	1.29
+++ render.cpp	28 Sep 2003 16:27:51 -0000	1.30
@@ -64,7 +64,6 @@
 
 uint8 xblocks[MAXLAYERS];
 uint8 yblocks[MAXLAYERS];
-uint8 restoreLayer[MAXLAYERS];
 
 // blockSurfaces stores an array of sub-blocks for each of the parallax layers.
 
@@ -378,15 +377,15 @@
 int32 RestoreBackgroundLayer(_parallax *p, int16 l)
 {
 	int16 oldLayer = layer;
-	int16 i;
 
 	debug(2, "RestoreBackgroundLayer %d", l);
 
 	layer = l;
 	if (blockSurfaces[l]) {
-		for (i = 0; i < xblocks[l] * yblocks[l]; i++)
+		for (int i = 0; i < xblocks[l] * yblocks[l]; i++) {
 			if (blockSurfaces[l][i])
 				free(blockSurfaces[l][i]);
+		}
 
 		free(blockSurfaces[l]);
 		blockSurfaces[l] = NULL;
@@ -707,7 +706,6 @@
 
 int32 RenderParallax(_parallax *p, int16 l) {
 	int16 x, y;
-	int16 i, j;
 	ScummVM::Rect r;
 
 	if (locationWide == screenWide)
@@ -729,8 +727,8 @@
 	clip_rect.top = MENUDEEP;
 	clip_rect.bottom = screenDeep - MENUDEEP;
 
-	for (j = 0; j < yblocks[l]; j++) {
-		for (i = 0; i < xblocks[l]; i++) {
+	for (int j = 0; j < yblocks[l]; j++) {
+		for (int i = 0; i < xblocks[l]; i++) {
 			if (blockSurfaces[l][i + j * xblocks[l]]) {
 				r.left = i * BLOCKWIDTH - x;
 				r.right = r.left + BLOCKWIDTH;
@@ -988,10 +986,11 @@
 		} else
 			blockSurfaces[layer][i] = NULL;
 	}
+
 	free(memchunk);
 	layer++;
-	return RD_OK;
 
+	return RD_OK;
 }
 
 /**
@@ -1001,11 +1000,9 @@
 int32 CloseBackgroundLayer(void) {
 	debug(2, "CloseBackgroundLayer");
 
-	int16 i, j;
-
-	for (j = 0; j < MAXLAYERS; j++) {
+	for (int j = 0; j < MAXLAYERS; j++) {
 		if (blockSurfaces[j]) {
-			for (i = 0; i < xblocks[j] * yblocks[j]; i++)
+			for (int i = 0; i < xblocks[j] * yblocks[j]; i++)
 				if (blockSurfaces[j][i])
 					free(blockSurfaces[j][i]);
 			free(blockSurfaces[j]);





More information about the Scummvm-git-logs mailing list