diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-12 02:42:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-12 02:42:12 +0300 |
commit | fcc88a6bf04c7f88c71ead1e2e26d2f421cdbf83 (patch) | |
tree | c2f6484f3019dfcfbc94701a6f885638e7115584 /source/blender | |
parent | bbc557109309876c3b07018755757e3e3c2a583e (diff) |
Cleanup: use generic macro
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/gpencil/annotate_draw.c | 11 | ||||
-rw-r--r-- | source/blender/editors/gpencil/drawgpencil.c | 10 |
2 files changed, 4 insertions, 17 deletions
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; |