diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-18 03:26:25 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-18 03:26:25 +0400 |
commit | b0c0626cb0791c8819c9ba66d56ff8314527ee98 (patch) | |
tree | 1d2cb2b368c791adf238a4c1f5644c64364cdac5 /source | |
parent | 560d8ad12cbef8573bbc48da4e56917ccfc75031 (diff) |
fix for weightpaint color with recent loopcolor abgr --> rgba conversion.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index c36660a3ab8..7d5a6118100 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -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 */ } |