(svn r12140) -Codechange: A bit of code style fixes(Geektoo).
authorbelugas
Thu, 14 Feb 2008 15:13:36 +0000
changeset 9058 b9c3fec968b8
parent 9057 f9931abf5f55
child 9059 04edde3eb0c6
(svn r12140) -Codechange: A bit of code style fixes(Geektoo).
src/spritecache.cpp
src/viewport.cpp
--- a/src/spritecache.cpp	Thu Feb 14 11:58:36 2008 +0000
+++ b/src/spritecache.cpp	Thu Feb 14 15:13:36 2008 +0000
@@ -284,8 +284,9 @@
 	uint32 tot_size = 0;
 	MemBlock* s;
 
-	for (s = _spritecache_ptr; s->size != 0; s = NextBlock(s))
+	for (s = _spritecache_ptr; s->size != 0; s = NextBlock(s)) {
 		if (!(s->size & S_FREE_MASK)) tot_size += s->size;
+	}
 
 	return tot_size;
 }
@@ -454,6 +455,7 @@
 
 	/* Load the sprite, if it is not loaded, yet */
 	if (p == NULL) p = ReadSprite(sc, sprite, real_sprite);
+
 	return p;
 }
 
--- a/src/viewport.cpp	Thu Feb 14 11:58:36 2008 +0000
+++ b/src/viewport.cpp	Thu Feb 14 15:13:36 2008 +0000
@@ -361,7 +361,7 @@
 	ViewPort *vp = w->viewport;
 
 	if (vp != NULL &&
-	    IsInsideMM(x, vp->left, vp->left + vp->width) &&
+			IsInsideMM(x, vp->left, vp->left + vp->width) &&
 			IsInsideMM(y, vp->top, vp->top + vp->height))
 		return vp;
 
@@ -689,6 +689,7 @@
 		top  = ps->top  = (pt.y += spr->y_offs);
 		bottom          = (pt.y +  spr->height);
 	}
+
 	if (_draw_bounding_boxes && (image != SPR_EMPTY_BOUNDING_BOX)) {
 		/* Compute maximal extents of sprite and it's bounding box */
 		left   = min(left  , RemapCoords(x + w          , y + bb_offset_y, z + bb_offset_z).x);
@@ -696,9 +697,10 @@
 		top    = min(top   , RemapCoords(x + bb_offset_x, y + bb_offset_y, z + dz         ).y);
 		bottom = max(bottom, RemapCoords(x + w          , y + h          , z + bb_offset_z).y + 1);
 	}
+
 	/* Do not add the sprite to the viewport, if it is outside */
 	if (left   >= vd->dpi.left + vd->dpi.width ||
-	    right  <= vd->dpi.left ||
+	    right  <= vd->dpi.left                 ||
 	    top    >= vd->dpi.top + vd->dpi.height ||
 	    bottom <= vd->dpi.top) {
 		return;
@@ -1592,6 +1594,7 @@
 
 	ViewportSortParentSprites(parent_list);
 	ViewportDrawParentSprites(parent_list);
+
 	if (_draw_bounding_boxes) ViewportDrawBoundingBoxes(parent_list);
 
 	if (vd.first_string != NULL) ViewportDrawStrings(&vd.dpi, vd.first_string);
@@ -1706,6 +1709,7 @@
 		}
 
 		ClampViewportToMap(vp, WP(w, vp_d).scrollpos_x, WP(w, vp_d).scrollpos_y);
+
 		SetViewportPosition(w, WP(w, vp_d).scrollpos_x, WP(w, vp_d).scrollpos_y);
 	}
 }