better not to use rgb_float_to_uchar() from last commit (comment as to why)
authorCampbell Barton <ideasman42@gmail.com>
Sat, 17 Mar 2012 23:37:14 +0000 (23:37 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 17 Mar 2012 23:37:14 +0000 (23:37 +0000)
source/blender/blenkernel/intern/DerivedMesh.c

index 7d5a61181003871145c7a7568793344371c8f8da..c00218f8145b822598be2e00a22c824ff8f9a2e3 100644 (file)
@@ -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;
 }