diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-03-04 03:31:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-03-04 03:31:51 +0300 |
commit | 38ed95fe8d6f4c47c0c5f09ffecc987d75150dcc (patch) | |
tree | 8884ecd983657941c1375d61fdeb74dd4dabe43a /source/blender/editors/sculpt_paint | |
parent | 89b10b8d423a0ee851d9299af279ab93660f15f4 (diff) |
Cleanup: replace CLAMP macros with functions
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_ops.c | 3 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_utils.c | 5 |
2 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index e58183bfc0f..5d73eb4a6a2 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -682,8 +682,7 @@ static void stencil_control_calculate(StencilControlData *scd, const int mval[2] if (scd->constrain_mode != STENCIL_CONSTRAINT_X) { mdiff[1] = factor * scd->init_sdim[1]; } - CLAMP(mdiff[0], 5.0f, 10000.0f); - CLAMP(mdiff[1], 5.0f, 10000.0f); + clamp_v2(mdiff, 5.0f, 10000.0f); copy_v2_v2(scd->dim_target, mdiff); break; } diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 37cc543872e..19d890eeac3 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -202,10 +202,7 @@ void paint_get_tex_pixel_col(const MTex *mtex, linearrgb_to_srgb_v3_v3(rgba, rgba); - CLAMP(rgba[0], 0.0f, 1.0f); - CLAMP(rgba[1], 0.0f, 1.0f); - CLAMP(rgba[2], 0.0f, 1.0f); - CLAMP(rgba[3], 0.0f, 1.0f); + clamp_v4(rgba, 0.0f, 1.0f); } void paint_stroke_operator_properties(wmOperatorType *ot) |