Commit: ad390f514bfa33abadfd09e8fd673a0cfee68b39
Author: Antonioya
Date:   Sat Mar 16 20:05:15 2019 +0100
Branches: master
https://developer.blender.org/rBad390f514bfa33abadfd09e8fd673a0cfee68b39

GPencil: Fix compiler warning

The fill flag was wrong and it was checking the color, not a flag.

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

M       source/blender/editors/gpencil/gpencil_add_stroke.c

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

diff --git a/source/blender/editors/gpencil/gpencil_add_stroke.c 
b/source/blender/editors/gpencil/gpencil_add_stroke.c
index d8db3cda98d..8b261bf798b 100644
--- a/source/blender/editors/gpencil/gpencil_add_stroke.c
+++ b/source/blender/editors/gpencil/gpencil_add_stroke.c
@@ -48,7 +48,8 @@ typedef struct ColorTemplate {
 } ColorTemplate;
 
 /* Add color an ensure duplications (matched by name) */
-static int gp_stroke_material(Main *bmain, Object *ob, const ColorTemplate 
*pct)
+static int gp_stroke_material(
+       Main *bmain, Object *ob, const ColorTemplate *pct, const bool fill)
 {
        short *totcol = give_totcolp(ob);
        Material *ma = NULL;
@@ -68,7 +69,7 @@ static int gp_stroke_material(Main *bmain, Object *ob, const 
ColorTemplate *pct)
        copy_v4_v4(ma->gp_style->stroke_rgba, pct->line);
        copy_v4_v4(ma->gp_style->fill_rgba, pct->fill);
 
-       if (pct->fill) {
+       if (fill) {
                ma->gp_style->flag |= GP_STYLE_FILL_SHOW;
        }
 
@@ -221,12 +222,12 @@ void ED_gpencil_create_stroke(bContext *C, Object *ob, 
float mat[4][4])
        bGPDstroke *gps;
 
        /* create colors */
-       int color_black = gp_stroke_material(bmain, ob, 
&gp_stroke_material_black);
-       gp_stroke_material(bmain, ob, &gp_stroke_material_white);
-       gp_stroke_material(bmain, ob, &gp_stroke_material_red);
-       gp_stroke_material(bmain, ob, &gp_stroke_material_green);
-       gp_stroke_material(bmain, ob, &gp_stroke_material_blue);
-       gp_stroke_material(bmain, ob, &gp_stroke_material_grey);
+       int color_black = gp_stroke_material(bmain, ob, 
&gp_stroke_material_black, false);
+       gp_stroke_material(bmain, ob, &gp_stroke_material_white, false);
+       gp_stroke_material(bmain, ob, &gp_stroke_material_red, false);
+       gp_stroke_material(bmain, ob, &gp_stroke_material_green, false);
+       gp_stroke_material(bmain, ob, &gp_stroke_material_blue, false);
+       gp_stroke_material(bmain, ob, &gp_stroke_material_grey, true);
 
        /* set first color as active and in brushes */
        ob->actcol = color_black + 1;

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

Reply via email to