GPencil: Fix compiler warning

The fill flag was wrong and it was checking the color, not a flag.
This commit is contained in:
Antonioya
2019-03-16 20:05:15 +01:00
parent 2d3fbadfe3
commit ad390f514b

View File

@@ -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;