[Bf-blender-cvs] [c72d319b47] blender2.8: Immediate Mode: remove commented out code from drawgpencil.c

Dalai Felinto noreply at git.blender.org
Wed Mar 15 13:58:59 CET 2017


Commit: c72d319b47452433e1983bd307f83cf4e160a41b
Author: Dalai Felinto
Date:   Wed Mar 15 11:15:51 2017 +0100
Branches: blender2.8
https://developer.blender.org/rBc72d319b47452433e1983bd307f83cf4e160a41b

Immediate Mode: remove commented out code from drawgpencil.c

Some of this was "tagged" for removal by Dec 2016.

===================================================================

M	source/blender/editors/gpencil/drawgpencil.c

===================================================================

diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 69436031e1..f701a54782 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -580,38 +580,6 @@ static void gp_draw_stroke_fill(
 		immEnd();
 		immUnbindProgram();
 	}
-
-#if 0 /* convert to modern GL only if needed */
-	else {
-		/* As an initial implementation, we use the OpenGL filled polygon drawing
-		* here since it's the easiest option to implement for this case. It does
-		* come with limitations (notably for concave shapes), though it shouldn't
-		* be much of an issue in most cases.
-		*
-		* We keep this legacy implementation around despite now having the high quality
-		* fills, as this is necessary for keeping everything working nicely for files
-		* created using old versions of Blender which may have depended on the artifacts
-		* the old fills created.
-		*/
-		bGPDspoint *pt = gps->points;
-
-		glBegin(GL_POLYGON);
-		for (int i = 0; i < gps->totpoints; i++, pt++) {
-			if (gps->flag & GP_STROKE_3DSPACE) {
-				mul_v3_m4v3(fpt, diff_mat, &pt->x);
-				glVertex3fv(fpt);
-			}
-			else {
-				float co[2];
-				mul_v3_m4v3(fpt, diff_mat, &pt->x);
-				gp_calc_2d_stroke_fxy(fpt, gps->flag, offsx, offsy, winx, winy, co);
-				glVertex2fv(co);
-			}
-		}
-
-		glEnd();
-	}
-#endif
 }
 
 /* ----- Existing Strokes Drawing (3D and Point) ------ */
@@ -739,29 +707,13 @@ static void gp_draw_stroke_3d(const bGPDspoint *points, int totpoints, short thi
 
 	immEnd();
 	immUnbindProgram();
-
-#if 0 /* convert to modern GL only if needed */
-	/* draw debug points of curve on top? */
-	/* XXX: for now, we represent "selected" strokes in the same way as debug, which isn't used anymore */
-	if (debug) {
-		glPointSize((float)(thickness + 2));
-
-		glBegin(GL_POINTS);
-		const bGPDspoint *pt = points;
-		for (int i = 0; i < totpoints; i++, pt++) {
-			mul_v3_m4v3(fpt, diff_mat, &pt->x);
-			glVertex3fv(fpt);
-		}
-		glEnd();
-	}
-#endif
 }
 
 /* ----- Fancy 2D-Stroke Drawing ------ */
 
 /* draw a given stroke in 2d */
 static void gp_draw_stroke_2d(const bGPDspoint *points, int totpoints, short thickness_s, short dflag, short sflag,
-                              bool debug, int offsx, int offsy, int winx, int winy, const float diff_mat[4][4], const float ink[4])
+                              bool UNUSED(debug), int offsx, int offsy, int winx, int winy, const float diff_mat[4][4], const float ink[4])
 {
 	/* otherwise thickness is twice that of the 3D view */
 	float thickness = (float)thickness_s * 0.5f;
@@ -935,26 +887,6 @@ static void gp_draw_stroke_2d(const bGPDspoint *points, int totpoints, short thi
 		immEnd();
 		immUnbindProgram();
 	}
-
-#if 0 /* convert to modern GL only if needed */
-	/* draw debug points of curve on top? (original stroke points) */
-	if (debug) {
-		glPointSize((float)(thickness_s + 2));
-
-		glBegin(GL_POINTS);
-		const bGPDspoint *pt = points;
-		for (int i = 0; i < totpoints && pt; i++, pt++) {
-			float fpt[3];
-			float co[2];
-			mul_v3_m4v3(fpt, diff_mat, &pt->x);
-			gp_calc_2d_stroke_fxy(fpt, sflag, offsx, offsy, winx, winy, co);
-			glVertex2fv(co);
-		}
-		glEnd();
-	}
-#else
-	UNUSED_VARS(debug);
-#endif
 }
 
 /* ----- Strokes Drawing ------ */
@@ -1037,10 +969,6 @@ static void gp_draw_strokes(
 				/* first arg is normally rv3d->dist, but this isn't
 				 * available here and seems to work quite well without */
 				bglPolygonOffset(1.0f, 1.0f);
-#if 0
-				glEnable(GL_POLYGON_OFFSET_LINE);
-				glPolygonOffset(-1.0f, -1.0f);
-#endif
 			}
 
 			/* 3D Fill */
@@ -1103,10 +1031,6 @@ static void gp_draw_strokes(
 				glDisable(GL_DEPTH_TEST);
 
 				bglPolygonOffset(0.0, 0.0);
-#if 0
-				glDisable(GL_POLYGON_OFFSET_LINE);
-				glPolygonOffset(0, 0);
-#endif
 			}
 		}
 		else {
@@ -1194,10 +1118,6 @@ static void gp_draw_strokes_edit(
 			/* first arg is normally rv3d->dist, but this isn't
 			 * available here and seems to work quite well without */
 			bglPolygonOffset(1.0f, 1.0f);
-#if 0
-			glEnable(GL_POLYGON_OFFSET_LINE); /* do we want LINE or POINT here? (merwin) */
-			glPolygonOffset(-1.0f, -1.0f);
-#endif
 		}
 	}
 
@@ -1599,11 +1519,6 @@ static void gp_draw_data(
         const bGPDbrush *brush, float alpha, bGPdata *gpd,
         int offsx, int offsy, int winx, int winy, int cfra, int dflag)
 {
-#if 0 /* disable to see if really needed. re-enable or delete by Dec 2016 */
-	/* reset line drawing style (in case previous user didn't reset) */
-	setlinestyle(0);
-#endif
-
 	/* turn on smooth lines (i.e. anti-aliasing) */
 	glEnable(GL_LINE_SMOOTH);
 
@@ -1622,11 +1537,6 @@ static void gp_draw_data(
 	/* turn off alpha blending, then smooth lines */
 	glDisable(GL_BLEND); // alpha blending
 	glDisable(GL_LINE_SMOOTH); // smooth lines
-
-#if 0 /* disable to see if really needed. re-enable or delete by Dec 2016 */
-	/* restore initial gl conditions */
-	glColor4f(0, 0, 0, 1);
-#endif
 }
 
 /* if we have strokes for scenes (3d view)/clips (movie clip editor)




More information about the Bf-blender-cvs mailing list