From 15f17707cafc50ce4579f7d997b7d34aa94fc0a3 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 2 Nov 2004 22:51:09 +0000 Subject: [PATCH] Fix (thanks goran!) for stupid || and && mixup... causing dither to underflow --- source/blender/render/intern/source/rendercore.c | 6 +++--- 1 file 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; } }