fix for weightpaint color with recent loopcolor abgr --> rgba conversion.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 17 Mar 2012 23:26:25 +0000 (23:26 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 17 Mar 2012 23:26:25 +0000 (23:26 +0000)
source/blender/blenkernel/intern/DerivedMesh.c

index c36660a3ab838e205d6a60944f4fe63267ceb6ec..7d5a61181003871145c7a7568793344371c8f8da 100644 (file)
@@ -917,13 +917,15 @@ static void weightpaint_color(unsigned char r_col[4], ColorBand *coba, const flo
 {
        float colf[4];
 
-       if(coba) do_colorband(coba, input, colf);
-       else     weight_to_rgb(colf, input);
+       if(coba) {
+               do_colorband(coba, input, colf);
+       }
+       else {
+               weight_to_rgb(colf, input);
+       }
 
-       r_col[3] = (unsigned char)(colf[0] * 255.0f);
-       r_col[2] = (unsigned char)(colf[1] * 255.0f);
-       r_col[1] = (unsigned char)(colf[2] * 255.0f);
-       r_col[0] = 255;
+       rgb_float_to_uchar(r_col, colf);
+       r_col[3] = 255; /* really redundant */
 }