diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-07 19:02:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-07 19:02:48 +0300 |
commit | b49184b608df297195c5f0e81da4d8d9ddfb9213 (patch) | |
tree | c2624887be563319a7138516d2fcc6100acdb2c6 /source/blender/makesrna/intern | |
parent | f62b826533422e5de3b08601e5511c233deda529 (diff) | |
parent | f74d85ffc8232a859b1419f5dc25b244ae04375f (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_image.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 40028eec4c8..0b2efe27059 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -970,7 +970,7 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr fprintf(f, ";\n"); } else if (rna_color_quantize(prop, dp)) { - fprintf(f, " data->%s[i] = FTOCHAR(values[i]);\n", dp->dnaname); + fprintf(f, " data->%s[i] = unit_float_to_uchar_clamp(values[i]);\n", dp->dnaname); } else { if (dp->dnatype) diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 8ff46d4d17a..27c3cee422c 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -679,7 +679,7 @@ static void rna_ImagePreview_pixels_float_set(PointerRNA *ptr, const float *valu } for (i = 0; i < len; i++) { - data[i] = FTOCHAR(values[i]); + data[i] = unit_float_to_uchar_clamp(values[i]); } prv_img->flag[size] |= PRV_USER_EDITED; } diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 4ed035c4e86..c554ab8e0fd 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -396,7 +396,7 @@ static void rna_Image_pixels_set(PointerRNA *ptr, const float *values) } else { for (i = 0; i < size; i++) - ((unsigned char *)ibuf->rect)[i] = FTOCHAR(values[i]); + ((unsigned char *)ibuf->rect)[i] = unit_float_to_uchar_clamp(values[i]); } ibuf->userflags |= IB_BITMAPDIRTY | IB_DISPLAY_BUFFER_INVALID | IB_MIPMAP_INVALID; |