diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-09-18 16:56:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-09-18 16:56:19 +0300 |
commit | 533ec46efbc533383f80052f8c5057db5ec1348b (patch) | |
tree | b8bd76142fa5a1e2f2a8bb7ca0fea93c437fb32f /source/blender/makesrna/intern/rna_mesh.c | |
parent | ad80bfdab9c82695df240c8b5a5d19a2b5b84254 (diff) | |
parent | d0344d7b7d619e62bc852c4d00df52cfbfdda544 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/makesrna/intern/rna_mesh.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index e94b724043f..524e9935760 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -323,7 +323,7 @@ static float rna_MeshVertex_bevel_weight_get(PointerRNA *ptr) static void rna_MeshVertex_bevel_weight_set(PointerRNA *ptr, float value) { MVert *mvert = (MVert *)ptr->data; - mvert->bweight = (char)(CLAMPIS(value * 255.0f, 0, 255)); + mvert->bweight = round_fl_to_uchar_clamp(value * 255.0f); } static float rna_MEdge_bevel_weight_get(PointerRNA *ptr) @@ -335,7 +335,7 @@ static float rna_MEdge_bevel_weight_get(PointerRNA *ptr) static void rna_MEdge_bevel_weight_set(PointerRNA *ptr, float value) { MEdge *medge = (MEdge *)ptr->data; - medge->bweight = (char)(CLAMPIS(value * 255.0f, 0, 255)); + medge->bweight = round_fl_to_uchar_clamp(value * 255.0f); } static float rna_MEdge_crease_get(PointerRNA *ptr) @@ -347,7 +347,7 @@ static float rna_MEdge_crease_get(PointerRNA *ptr) static void rna_MEdge_crease_set(PointerRNA *ptr, float value) { MEdge *medge = (MEdge *)ptr->data; - medge->crease = (char)(CLAMPIS(value * 255.0f, 0, 255)); + medge->crease = round_fl_to_uchar_clamp(value * 255.0f); } static void rna_MeshLoop_normal_get(PointerRNA *ptr, float *values) @@ -605,9 +605,9 @@ static void rna_MeshColor_color1_set(PointerRNA *ptr, const float *values) { MCol *mcol = (MCol *)ptr->data; - (&mcol[0].r)[2] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255)); - (&mcol[0].r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255)); - (&mcol[0].r)[0] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255)); + (&mcol[0].r)[2] = round_fl_to_uchar_clamp(values[0] * 255.0f); + (&mcol[0].r)[1] = round_fl_to_uchar_clamp(values[1] * 255.0f); + (&mcol[0].r)[0] = round_fl_to_uchar_clamp(values[2] * 255.0f); } static void rna_MeshColor_color2_get(PointerRNA *ptr, float *values) @@ -623,9 +623,9 @@ static void rna_MeshColor_color2_set(PointerRNA *ptr, const float *values) { MCol *mcol = (MCol *)ptr->data; - (&mcol[1].r)[2] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255)); - (&mcol[1].r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255)); - (&mcol[1].r)[0] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255)); + (&mcol[1].r)[2] = round_fl_to_uchar_clamp(values[0] * 255.0f); + (&mcol[1].r)[1] = round_fl_to_uchar_clamp(values[1] * 255.0f); + (&mcol[1].r)[0] = round_fl_to_uchar_clamp(values[2] * 255.0f); } static void rna_MeshColor_color3_get(PointerRNA *ptr, float *values) @@ -641,9 +641,9 @@ static void rna_MeshColor_color3_set(PointerRNA *ptr, const float *values) { MCol *mcol = (MCol *)ptr->data; - (&mcol[2].r)[2] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255)); - (&mcol[2].r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255)); - (&mcol[2].r)[0] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255)); + (&mcol[2].r)[2] = round_fl_to_uchar_clamp(values[0] * 255.0f); + (&mcol[2].r)[1] = round_fl_to_uchar_clamp(values[1] * 255.0f); + (&mcol[2].r)[0] = round_fl_to_uchar_clamp(values[2] * 255.0f); } static void rna_MeshColor_color4_get(PointerRNA *ptr, float *values) @@ -659,9 +659,9 @@ static void rna_MeshColor_color4_set(PointerRNA *ptr, const float *values) { MCol *mcol = (MCol *)ptr->data; - (&mcol[3].r)[2] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255)); - (&mcol[3].r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255)); - (&mcol[3].r)[0] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255)); + (&mcol[3].r)[2] = round_fl_to_uchar_clamp(values[0] * 255.0f); + (&mcol[3].r)[1] = round_fl_to_uchar_clamp(values[1] * 255.0f); + (&mcol[3].r)[0] = round_fl_to_uchar_clamp(values[2] * 255.0f); } static void rna_MeshLoopColor_color_get(PointerRNA *ptr, float *values) @@ -677,9 +677,9 @@ static void rna_MeshLoopColor_color_set(PointerRNA *ptr, const float *values) { MLoopCol *mcol = (MLoopCol *)ptr->data; - (&mcol->r)[0] = (char)(CLAMPIS(values[0] * 255.0f, 0, 255)); - (&mcol->r)[1] = (char)(CLAMPIS(values[1] * 255.0f, 0, 255)); - (&mcol->r)[2] = (char)(CLAMPIS(values[2] * 255.0f, 0, 255)); + (&mcol->r)[0] = round_fl_to_uchar_clamp(values[0] * 255.0f); + (&mcol->r)[1] = round_fl_to_uchar_clamp(values[1] * 255.0f); + (&mcol->r)[2] = round_fl_to_uchar_clamp(values[2] * 255.0f); } static int rna_Mesh_texspace_editable(PointerRNA *ptr, const char **UNUSED(r_info)) |