diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-10 18:24:18 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-10 18:24:18 +0400 |
commit | 545dc90a7f660709abdde90078b84f4ff5479f3c (patch) | |
tree | 903991d23791fba949a998fdbe5aced778d0b467 /source/blender/blenlib | |
parent | 84c6daedd7f4f99aacac5e8da1c37ac91ab048f9 (diff) |
Fix regressions in the color management / dither patch.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 45049dd6207..6d9188c1848 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -108,7 +108,7 @@ #define FTOCHAR(val) ((val)<=0.0f)? 0 : (((val)>(1.0f-0.5f/255.0f))? 255 : (char)((255.0f*(val))+0.5f)) #define FTOUSHORT(val) ((val >= 1.0f-0.5f/65535)? 65535: (val <= 0.0f)? 0: (unsigned short)(val*65535.0f + 0.5f)) -#define USHORTTOUCHAR(val) ((unsigned char)(((val)+0x80)>>8)) +#define USHORTTOUCHAR(val) ((unsigned char)(((val) >= 65535-128)? 255: ((val)+128)>>8)) #define F3TOCHAR3(v2, v1) { \ (v1)[0]= FTOCHAR((v2[0])); \ (v1)[1]= FTOCHAR((v2[1])); \ |