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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-03-18 03:37:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-18 03:37:14 +0400
commitb786d0d47c2ed4d4f7dc1dcb6110830311593cb5 (patch)
tree57bf0515d094b4d095cbcf93079ecb23b5143d22 /source
parentb0c0626cb0791c8819c9ba66d56ff8314527ee98 (diff)
better not to use rgb_float_to_uchar() from last commit (comment as to why)
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c8
1 files 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;
}