diff options
author | Ton Roosendaal <ton@blender.org> | 2004-11-03 01:51:09 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-11-03 01:51:09 +0300 |
commit | 15f17707cafc50ce4579f7d997b7d34aa94fc0a3 (patch) | |
tree | e3a10b2be97629f10fe8da2561934fbc3cd396d0 /source | |
parent | fb27561c494b04dc981936c2e49cc2d6d69c64d9 (diff) |
Fix (thanks goran!) for stupid || and && mixup... causing dither to underflow
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/render/intern/source/rendercore.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 418a33ab00f..d2687116302 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -2861,9 +2861,9 @@ void shadepixel_short(float x, float y, int vlaknr, int mask, unsigned short *sh if(R.r.dither_intensity!=0.0) { short dither_value = (short)((BLI_frand() -.5)*R.r.dither_intensity*256.0); /* no dither for color 0 or 255, is OK. intensity is <= 2.0 */ - if(shortcol[0]>255 || shortcol[0] < 65280) shortcol[0]+= dither_value; - if(shortcol[1]>255 || shortcol[1] < 65280) shortcol[1]+= dither_value; - if(shortcol[2]>255 || shortcol[2] < 65280) shortcol[2]+= dither_value; + if(shortcol[0]>255 && shortcol[0] < 65280) shortcol[0]+= dither_value; + if(shortcol[1]>255 && shortcol[1] < 65280) shortcol[1]+= dither_value; + if(shortcol[2]>255 && shortcol[2] < 65280) shortcol[2]+= dither_value; } } |