From b786d0d47c2ed4d4f7dc1dcb6110830311593cb5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 17 Mar 2012 23:37:14 +0000 Subject: better not to use rgb_float_to_uchar() from last commit (comment as to why) --- source/blender/blenkernel/intern/DerivedMesh.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 7d5a6118100..c00218f8145 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -924,8 +924,12 @@ static void weightpaint_color(unsigned char r_col[4], ColorBand *coba, const flo weight_to_rgb(colf, input); } - rgb_float_to_uchar(r_col, colf); - r_col[3] = 255; /* really redundant */ + /* don't use rgb_float_to_uchar() here because + * the resulting float doesn't need 0-1 clamp check */ + r_col[0] = (unsigned char)(colf[0] * 255.0f); + r_col[1] = (unsigned char)(colf[1] * 255.0f); + r_col[2] = (unsigned char)(colf[2] * 255.0f); + r_col[3] = 255; } -- cgit v1.2.3