[Bf-blender-cvs] [fcc88a6bf04] blender2.8: Cleanup: use generic macro

Campbell Barton noreply at git.blender.org
Fri Oct 12 01:44:18 CEST 2018


Commit: fcc88a6bf04c7f88c71ead1e2e26d2f421cdbf83
Author: Campbell Barton
Date:   Fri Oct 12 10:42:12 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBfcc88a6bf04c7f88c71ead1e2e26d2f421cdbf83

Cleanup: use generic macro

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

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

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

diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c
index 686fe18b160..dae89d2cfd5 100644
--- a/source/blender/editors/gpencil/annotate_draw.c
+++ b/source/blender/editors/gpencil/annotate_draw.c
@@ -751,23 +751,16 @@ static void gp_draw_data_layers(
 		 * NOTE: If the setting doesn't apply, it *must* be cleared,
 		 *       as dflag's carry over from the previous layer
 		 */
-#define GP_DRAWFLAG_APPLY(condition, draw_flag_value)     { \
-			if (condition) dflag |= (draw_flag_value);      \
-			else           dflag &= ~(draw_flag_value);     \
-		} (void)0
 
 		/* xray... */
-		GP_DRAWFLAG_APPLY((gpl->flag & GP_LAYER_NO_XRAY), GP_DRAWDATA_NO_XRAY);
-
-#undef GP_DRAWFLAG_APPLY
-
+		SET_FLAG_FROM_TEST(dflag, gpl->flag & GP_LAYER_NO_XRAY, GP_DRAWDATA_NO_XRAY);
 
 		/* draw the strokes already in active frame */
 		gp_draw_strokes(gpd, gpl, gpf, offsx, offsy, winx, winy, dflag, debug, lthick, ink);
 
 		/* Draw verts of selected strokes
 		 *  - when doing OpenGL renders, we don't want to be showing these, as that ends up flickering
-		 * 	- locked layers can't be edited, so there's no point showing these verts
+		 *  - locked layers can't be edited, so there's no point showing these verts
 		 *    as they will have no bearings on what gets edited
 		 *  - only show when in editmode, since operators shouldn't work otherwise
 		 *    (NOTE: doing it this way means that the toggling editmode shows visible change immediately)
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index bb25a9189eb..d64c3faae1b 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -1536,18 +1536,12 @@ static void gp_draw_data_layers(RegionView3D *rv3d,
 		 * NOTE: If the setting doesn't apply, it *must* be cleared,
 		 *       as dflag's carry over from the previous layer
 		 */
-#define GP_DRAWFLAG_APPLY(condition, draw_flag_value)     { \
-			if (condition) dflag |= (draw_flag_value);      \
-			else           dflag &= ~(draw_flag_value);     \
-		} (void)0
 
 		/* xray... */
-		GP_DRAWFLAG_APPLY((gpl->flag & GP_LAYER_NO_XRAY), GP_DRAWDATA_NO_XRAY);
+		SET_FLAG_FROM_TEST(dflag, gpl->flag & GP_LAYER_NO_XRAY, GP_DRAWDATA_NO_XRAY);
 
 		/* volumetric strokes... */
-		GP_DRAWFLAG_APPLY((gpl->flag & GP_LAYER_VOLUMETRIC), GP_DRAWDATA_VOLUMETRIC);
-
-#undef GP_DRAWFLAG_APPLY
+		SET_FLAG_FROM_TEST(dflag, gpl->flag & GP_LAYER_VOLUMETRIC, GP_DRAWDATA_VOLUMETRIC);
 
 		tgpw.gpl = gpl;
 		tgpw.gpf = gpf;



More information about the Bf-blender-cvs mailing list