Commit: be09594bf962cf24b97c3b616b91d46c42f38a13
Author: Darshan Kadu
Date:   Wed Aug 9 20:22:22 2017 +0530
Branches: soc-2017-vertex_paint
https://developer.blender.org/rBbe09594bf962cf24b97c3b616b91d46c42f38a13

curve falloff works properly with alpha now

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

M       source/blender/editors/sculpt_paint/paint_vertex.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c 
b/source/blender/editors/sculpt_paint/paint_vertex.c
index bc5ac1c920b..3a499966893 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -576,8 +576,6 @@ BLI_INLINE unsigned int mcol_blend(unsigned int col1, 
unsigned int col2, int fac
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -625,8 +623,6 @@ BLI_INLINE unsigned int mcol_add(unsigned int col1, 
unsigned int col2, int fac,
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -654,8 +650,6 @@ BLI_INLINE unsigned int mcol_sub(unsigned int col1, 
unsigned int col2, int fac,
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -683,8 +677,6 @@ BLI_INLINE unsigned int mcol_mul(unsigned int col1, 
unsigned int col2, int fac,
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -711,8 +703,6 @@ BLI_INLINE unsigned int mcol_lighten(unsigned int col1, 
unsigned int col2, int f
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
        else if (fac >= 255) {
@@ -749,8 +739,6 @@ BLI_INLINE unsigned int mcol_darken(unsigned int col1, 
unsigned int col2, int fa
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
        else if (fac >= 255) {
@@ -791,8 +779,6 @@ BLI_INLINE unsigned int mcol_colordodge(unsigned int col1, 
unsigned int col2, in
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -821,8 +807,6 @@ BLI_INLINE unsigned int mcol_difference(unsigned int col1, 
unsigned int col2, in
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -851,8 +835,6 @@ BLI_INLINE unsigned int mcol_screen(unsigned int col1, 
unsigned int col2, int fa
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -881,8 +863,6 @@ BLI_INLINE unsigned int mcol_hardlight(unsigned int col1, 
unsigned int col2, int
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -920,8 +900,6 @@ BLI_INLINE unsigned int mcol_overlay(unsigned int col1, 
unsigned int col2, int f
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -961,8 +939,6 @@ BLI_INLINE unsigned int mcol_softlight(unsigned int col1, 
unsigned int col2, int
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -1002,8 +978,6 @@ BLI_INLINE unsigned int mcol_exclusion(unsigned int col1, 
unsigned int col2, int
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -1038,8 +1012,6 @@ BLI_INLINE unsigned int mcol_luminocity(unsigned int 
col1, unsigned int col2, in
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -1074,8 +1046,6 @@ BLI_INLINE unsigned int mcol_saturation(unsigned int 
col1, unsigned int col2, in
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -1112,8 +1082,6 @@ BLI_INLINE unsigned int mcol_hue(unsigned int col1, 
unsigned int col2, int fac,
        unsigned int col = 0;
 
        if (fac == 0) {
-               cp = (unsigned char *)&col1;
-               cp[3] = use_alpha ? alpha_value : cp[3];
                return col1;
        }
 
@@ -2870,7 +2838,6 @@ static void do_wpaint_brush_blur_task_cb_ex(
                                if (total_hit_loops != 0) {
                                        const float view_dot = (vd.no) ? 
dot_vf3vs3(cache->sculpt_normal_symm, vd.no) : 1.0;
                                        if (view_dot > 0.0f) {
-                                               dist = 0;
                                                const float brush_fade = 
BKE_brush_curve_strength(brush, dist, radius);
                                                const float final_alpha =
                                                        view_dot * brush_fade * 
brush_strength *
@@ -2970,7 +2937,6 @@ static void do_wpaint_brush_smear_task_cb_ex(
                                                }
                                                /* Apply weight to vertex */
                                                if (do_color) {
-                                                       dist = 0;
                                                        const float brush_fade 
= BKE_brush_curve_strength(brush, dist, radius);
                                                        const float final_alpha 
=
                                                                view_dot * 
brush_fade * brush_strength *

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to