Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/DerivedMesh.c')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c14
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 */
}