Cleanup: use generic macro

This commit is contained in:
Campbell Barton 2018-10-12 10:42:12 +11:00
parent bbc5571093
commit fcc88a6bf0
Notes: blender-bot 2023-02-14 05:12:54 +01:00
Referenced by issue #57173, Animated Boolean breaks textures
2 changed files with 4 additions and 17 deletions

View File

@ -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)

View File

@ -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;