[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47240] branches/soc-2011-tomato/intern/ raskter/raskter.c: Mask out of bounds fix for mask rasterizer

Peter Larabell xgl.asyliax at gmail.com
Wed May 30 20:39:42 CEST 2012


Revision: 47240
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47240
Author:   xglasyliax
Date:     2012-05-30 18:39:42 +0000 (Wed, 30 May 2012)
Log Message:
-----------
Mask out of bounds fix for mask rasterizer

Modified Paths:
--------------
    branches/soc-2011-tomato/intern/raskter/raskter.c

Modified: branches/soc-2011-tomato/intern/raskter/raskter.c
===================================================================
--- branches/soc-2011-tomato/intern/raskter/raskter.c	2012-05-30 18:21:54 UTC (rev 47239)
+++ branches/soc-2011-tomato/intern/raskter/raskter.c	2012-05-30 18:39:42 UTC (rev 47240)
@@ -232,7 +232,7 @@
 	 * TODO: This clips Y to the frame buffer, which should be done in the preprocessor, but for now is done here.
 	 *       Will get changed once DEM code gets in.
 	 */
-	for (y_curr = MAX2(ctx->all_edges->ybeg, 0); (ctx->all_edges || ctx->possible_edges) && (y_curr < ctx->rb.sizey); y_curr++) {
+	for (y_curr = ctx->all_edges->ybeg; (ctx->all_edges || ctx->possible_edges); y_curr++) {
 
 		/*
 		 * Link any edges that start on the current scan line into the list of
@@ -305,12 +305,14 @@
 			e_curr = e_curr->e_next;
 			mpxl = spxl + MIN2(e_curr->x, ctx->rb.sizex) - 1;
 
-			/* draw the pixels. */
-			for (; cpxl <= mpxl; cpxl++){
-				if(*cpxl < 0.5f){
-					*cpxl = 1.0f;
-				}else{
-					*cpxl = 0.0f;
+			if((y_curr >= 0) && (y_curr < ctx->rb.sizey)){
+				/* draw the pixels. */
+				for (; cpxl <= mpxl; cpxl++){
+					if(*cpxl < 0.5f){
+						*cpxl = 1.0f;
+					}else{
+						*cpxl = 0.0f;
+					}
 				}
 			}
 		}




More information about the Bf-blender-cvs mailing list