[Bf-blender-cvs] [f55c56e] soc-2013-paint: Fix masking - it was different from trunk after a recent change

Antony Riakiotakis noreply at git.blender.org
Thu Apr 24 03:43:46 CEST 2014


Commit: f55c56e6b9932563357b8fbec2c1b234a917ba07
Author: Antony Riakiotakis
Date:   Thu Apr 24 01:43:38 2014 +0300
https://developer.blender.org/rBf55c56e6b9932563357b8fbec2c1b234a917ba07

Fix masking - it was different from trunk after a recent change

===================================================================

M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/imbuf/intern/rectop.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index b96072b..6a2e9c1 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -4135,7 +4135,7 @@ static void *do_projectpaint_thread(void *ph_v)
 							if (brush->flag & BRUSH_ACCUMULATE)
 								mask = min_ff(mask_accum + max_mask, 65535.0f);
 							else
-								mask = mask_accum + (max_mask - mask_accum) * falloff;
+								mask = mask_accum + (max_mask - mask_accum * falloff);
 
 							mask_short = (unsigned short)mask;
 
diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c
index 2ab4369..0eb1d72 100644
--- a/source/blender/imbuf/intern/rectop.c
+++ b/source/blender/imbuf/intern/rectop.c
@@ -553,7 +553,7 @@ void IMB_rectblend(ImBuf *dbuf, ImBuf *obuf, ImBuf *sbuf, unsigned short *dmask,
 								if (accumulate)
 									mask = min_ff(*dmr + mask_lim, 65535.0);
 								else
-									mask = *dmr + (((mask_lim - *dmr) * (*cmr)) / 65535.0f);
+									mask = *dmr + (((mask_lim - *dmr  * (*cmr) / 65535.0f)));
 
 								if (mask > *dmr) {
 									unsigned char mask_src[4];
@@ -635,7 +635,7 @@ void IMB_rectblend(ImBuf *dbuf, ImBuf *obuf, ImBuf *sbuf, unsigned short *dmask,
 								if (accumulate)
 									mask = min_ff(*dmr + mask_lim, 65535.0);
 								else
-									mask = *dmr + (((mask_lim - *dmr) * (*cmr)) / 65535.0f);
+									mask = *dmr + (((mask_lim - *dmr  * (*cmr) / 65535.0f)));
 
 								if (mask > *dmr) {
 									float mask_srf[4];
@@ -660,7 +660,6 @@ void IMB_rectblend(ImBuf *dbuf, ImBuf *obuf, ImBuf *sbuf, unsigned short *dmask,
 							if (srf[3] && mask) {
 								float mask_srf[4];
 
-								*dmr = mask;
 								mul_v4_v4fl(mask_srf, srf, mask * (1.0f / 65535.0f));
 
 								func_float(drf, orf, mask_srf);




More information about the Bf-blender-cvs mailing list