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:
authorCampbell Barton <ideasman42@gmail.com>2012-01-19 14:04:51 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-19 14:04:51 +0400
commita87c5eb52cd4951b138f518bf12d498bc5e5eb8a (patch)
tree7b023285cb2ff41924d9e390f3d6a25715284d14 /source/blender/render/intern
parent47514a0d7129ba49cd9ad039a886c52909ea565d (diff)
use color conversions functions in more places.
also add rgba_float_to_uchar, rgba_uchar_to_float
Diffstat (limited to 'source/blender/render/intern')
-rw-r--r--source/blender/render/intern/source/rendercore.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index c5d580b2e9f..773af96671a 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -2170,10 +2170,9 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
if (ELEM(bs->type, RE_BAKE_ALL, RE_BAKE_TEXTURE) && (R.r.color_mgt_flag & R_COLOR_MANAGEMENT)) {
linearrgb_to_srgb_uchar3(col, shr.combined);
- } else {
- col[0]= FTOCHAR(shr.combined[0]);
- col[1]= FTOCHAR(shr.combined[1]);
- col[2]= FTOCHAR(shr.combined[2]);
+ }
+ else {
+ rgb_float_to_uchar(col, shr.combined);
}
if (ELEM(bs->type, RE_BAKE_ALL, RE_BAKE_TEXTURE)) {
@@ -2205,9 +2204,7 @@ static void bake_displacement(void *handle, ShadeInput *UNUSED(shi), float dist,
col[3]= 1.0f;
} else {
char *col= (char *)(bs->rect + bs->rectx*y + x);
- col[0]= FTOCHAR(disp);
- col[1]= FTOCHAR(disp);
- col[2]= FTOCHAR(disp);
+ col[0] = col[1] = col[2] = FTOCHAR(disp);
col[3]= 255;
}
if (bs->rect_mask) {