Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-03-04 03:31:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-03-04 03:31:51 +0300
commit38ed95fe8d6f4c47c0c5f09ffecc987d75150dcc (patch)
tree8884ecd983657941c1375d61fdeb74dd4dabe43a /source/blender/editors
parent89b10b8d423a0ee851d9299af279ab93660f15f4 (diff)
Cleanup: replace CLAMP macros with functions
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c3
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c5
-rw-r--r--source/blender/editors/space_sequencer/sequencer_scopes.c4
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c3
4 files changed, 4 insertions, 11 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)
diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c
index c55d77800ff..4d492d74e82 100644
--- a/source/blender/editors/space_sequencer/sequencer_scopes.c
+++ b/source/blender/editors/space_sequencer/sequencer_scopes.c
@@ -743,9 +743,7 @@ static ImBuf *make_vectorscope_view_from_ibuf_float(ImBuf *ibuf)
memcpy(rgb, src1, 3 * sizeof(float));
- CLAMP(rgb[0], 0.0f, 1.0f);
- CLAMP(rgb[1], 0.0f, 1.0f);
- CLAMP(rgb[2], 0.0f, 1.0f);
+ clamp_v3(rgb, 0.0f, 1.0f);
rgb_to_yuv_normalized(rgb, yuv);
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index eb568acc0dd..fb48b1377f1 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -1497,8 +1497,7 @@ static void uv_map_clip_correct_multi(const Scene *scene,
BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
- CLAMP(luv->uv[0], 0.0f, 1.0f);
- CLAMP(luv->uv[1], 0.0f, 1.0f);
+ clamp_v2(luv->uv, 0.0f, 1.0f);
}
}
}