[Bf-blender-cvs] [e2fef7c4bdb] greasepencil-object: GPencil: Cleanup warnings
Antonio Vazquez
noreply at git.blender.org
Sat Nov 23 11:24:07 CET 2019
Commit: e2fef7c4bdb8c636aecf6125030d498ebb1765e7
Author: Antonio Vazquez
Date: Sat Nov 23 11:23:24 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBe2fef7c4bdb8c636aecf6125030d498ebb1765e7
GPencil: Cleanup warnings
===================================================================
M source/blender/editors/gpencil/gpencil_fill.c
M source/blender/editors/gpencil/gpencil_paint.c
M source/blender/editors/gpencil/gpencil_utils.c
M source/blender/editors/gpencil/gpencil_vertex_ops.c
M source/blender/editors/gpencil/gpencil_vertex_paint.c
M source/blender/editors/gpencil/gpencil_weight_paint.c
M source/blender/editors/include/ED_gpencil.h
M source/blender/editors/object/object_add.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 8de12332faf..beeae085ae5 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -1159,7 +1159,7 @@ static void gpencil_stroke_from_buffer(tGPDfill *tgpf)
/* ----------------------- */
/* Drawing */
/* Helper: Draw status message while the user is running the operator */
-static void gpencil_fill_status_indicators(bContext *C, tGPDfill *UNUSED(tgpf))
+static void gpencil_fill_status_indicators(bContext *C)
{
const char *status_str = TIP_("Fill: ESC/RMB cancel, LMB Fill, Shift Draw on Back");
ED_workspace_status_text(C, status_str);
@@ -1408,7 +1408,7 @@ static int gpencil_fill_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSE
WM_cursor_modal_set(CTX_wm_window(C), WM_CURSOR_PAINT_BRUSH);
- gpencil_fill_status_indicators(C, tgpf);
+ gpencil_fill_status_indicators(C);
DEG_id_tag_update(&tgpf->gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
WM_event_add_notifier(C, NC_GPENCIL | NA_EDITED, NULL);
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 64af4c88fef..023cc32227d 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1952,7 +1952,7 @@ static bool gp_session_initdata(bContext *C, wmOperator *op, tGPsdata *p)
local_view_bits = v3d->local_view_uuid;
}
/* create new default object */
- obact = ED_gpencil_add_object(C, p->scene, cur, local_view_bits);
+ obact = ED_gpencil_add_object(C, cur, local_view_bits);
}
/* assign object after all checks to be sure we have one active */
p->ob = obact;
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 6d04a1fe9c2..33c55ebe2b9 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -1314,10 +1314,7 @@ void ED_gpencil_reset_layers_parent(Depsgraph *depsgraph, Object *obact, bGPdata
/* GP Object Stuff */
/* Helper function to create new OB_GPENCIL Object */
-Object *ED_gpencil_add_object(bContext *C,
- Scene *UNUSED(scene),
- const float loc[3],
- ushort local_view_bits)
+Object *ED_gpencil_add_object(bContext *C, const float loc[3], ushort local_view_bits)
{
float rot[3] = {0.0f};
diff --git a/source/blender/editors/gpencil/gpencil_vertex_ops.c b/source/blender/editors/gpencil/gpencil_vertex_ops.c
index f930e01c969..ab48ca49cd2 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_ops.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_ops.c
@@ -138,8 +138,8 @@ static int gp_vertexpaint_brightness_contrast_exec(bContext *C, wmOperator *op)
changed = true;
if (mode != GP_PAINT_VERTEX_STROKE) {
if (gps->mix_color_fill[3] > 0.0f) {
- for (int i = 0; i < 3; i++) {
- gps->mix_color_fill[i] = gain * gps->mix_color_fill[i] + offset;
+ for (int i2 = 0; i2 < 3; i2++) {
+ gps->mix_color_fill[i2] = gain * gps->mix_color_fill[i2] + offset;
}
}
}
@@ -149,8 +149,8 @@ static int gp_vertexpaint_brightness_contrast_exec(bContext *C, wmOperator *op)
if (mode != GP_PAINT_VERTEX_FILL) {
for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
if ((pt->flag & GP_SPOINT_SELECT) && (pt->mix_color[3] > 0.0f)) {
- for (int i = 0; i < 3; i++) {
- pt->mix_color[i] = gain * pt->mix_color[i] + offset;
+ for (int i2 = 0; i2 < 3; i2++) {
+ pt->mix_color[i2] = gain * pt->mix_color[i2] + offset;
}
}
}
@@ -306,8 +306,8 @@ static int gp_vertexpaint_invert_exec(bContext *C, wmOperator *op)
changed = true;
if (mode != GP_PAINT_VERTEX_STROKE) {
if (gps->mix_color_fill[3] > 0.0f) {
- for (int i = 0; i < 3; i++) {
- gps->mix_color_fill[i] = 1.0f - gps->mix_color_fill[i];
+ for (int i2 = 0; i2 < 3; i2++) {
+ gps->mix_color_fill[i2] = 1.0f - gps->mix_color_fill[i2];
}
}
}
@@ -317,8 +317,8 @@ static int gp_vertexpaint_invert_exec(bContext *C, wmOperator *op)
if (mode != GP_PAINT_VERTEX_FILL) {
for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
if ((pt->flag & GP_SPOINT_SELECT) && (pt->mix_color[3] > 0.0f)) {
- for (int i = 0; i < 3; i++) {
- pt->mix_color[i] = 1.0f - pt->mix_color[i];
+ for (int i2 = 0; i2 < 3; i2++) {
+ pt->mix_color[i2] = 1.0f - pt->mix_color[i2];
}
}
}
@@ -375,8 +375,8 @@ static int gp_vertexpaint_levels_exec(bContext *C, wmOperator *op)
changed = true;
if (mode != GP_PAINT_VERTEX_STROKE) {
if (gps->mix_color_fill[3] > 0.0f) {
- for (int i = 0; i < 3; i++) {
- gps->mix_color_fill[i] = gain * (gps->mix_color_fill[i] + offset);
+ for (int i2 = 0; i2 < 3; i2++) {
+ gps->mix_color_fill[i2] = gain * (gps->mix_color_fill[i2] + offset);
}
}
}
@@ -386,8 +386,8 @@ static int gp_vertexpaint_levels_exec(bContext *C, wmOperator *op)
if (mode != GP_PAINT_VERTEX_FILL) {
for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
if ((pt->flag & GP_SPOINT_SELECT) && (pt->mix_color[3] > 0.0f)) {
- for (int i = 0; i < 3; i++) {
- pt->mix_color[i] = gain * (pt->mix_color[i] + offset);
+ for (int i2 = 0; i < 3; i2++) {
+ pt->mix_color[i2] = gain * (pt->mix_color[i2] + offset);
}
}
}
@@ -597,7 +597,7 @@ static uint get_material_type(MaterialGPencilStyle *gp_style,
bool use_fill,
char *name)
{
- uint r_i = -1;
+ uint r_i = 0;
if ((use_stroke) && (use_fill)) {
switch (gp_style->mode) {
case GP_STYLE_MODE_LINE: {
diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index 3180c297be1..9c9e2231865 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -36,8 +36,6 @@
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_gpencil.h"
-#include "BKE_gpencil_modifier.h"
-#include "BKE_material.h"
#include "BKE_report.h"
#include "WM_api.h"
@@ -468,11 +466,7 @@ static bool brush_tint_apply(tGP_BrushVertexpaintData *gso,
}
/* Replace Brush (Don't use pressure or invert). */
-static bool brush_replace_apply(tGP_BrushVertexpaintData *gso,
- bGPDstroke *gps,
- int pt_index,
- const int radius,
- const int co[2])
+static bool brush_replace_apply(tGP_BrushVertexpaintData *gso, bGPDstroke *gps, int pt_index)
{
Brush *brush = gso->brush;
bGPDspoint *pt = &gps->points[pt_index];
@@ -620,7 +614,6 @@ static bool brush_average_apply(tGP_BrushVertexpaintData *gso,
static bool brush_smear_apply(tGP_BrushVertexpaintData *gso,
bGPDstroke *gps,
int pt_index,
- const int radius,
tGP_Selected *selected)
{
Brush *brush = gso->brush;
@@ -698,7 +691,7 @@ static bool brush_smear_apply(tGP_BrushVertexpaintData *gso,
/* ************************************************ */
/* Header Info */
-static void gp_vertexpaint_brush_header_set(bContext *C, tGP_BrushVertexpaintData *UNUSED(gso))
+static void gp_vertexpaint_brush_header_set(bContext *C)
{
ED_workspace_status_text(C,
TIP_("GPencil Vertex Paint: LMB to paint | RMB/Escape to Exit"
@@ -765,7 +758,7 @@ static bool gp_vertexpaint_brush_init(bContext *C, wmOperator *op)
gp_point_conversion_init(C, &gso->gsc);
/* Update header. */
- gp_vertexpaint_brush_header_set(C, gso);
+ gp_vertexpaint_brush_header_set(C);
/* Setup cursor drawing. */
ED_gpencil_toggle_brush_cursor(C, true, NULL);
@@ -1036,12 +1029,12 @@ static bool gp_vertexpaint_brush_do_frame(bContext *C,
break;
}
case GPVERTEX_TOOL_SMEAR: {
- brush_smear_apply(gso, selected->gps, selected->pt_index, radius, selected);
+ brush_smear_apply(gso, selected->gps, selected->pt_index, selected);
changed |= true;
break;
}
case GPVERTEX_TOOL_REPLACE: {
- brush_replace_apply(gso, selected->gps, selected->pt_index, radius, selected->pc);
+ brush_replace_apply(gso, selected->gps, selected->pt_index);
changed |= true;
break;
}
diff --git a/source/blender/editors/gpencil/gpencil_weight_paint.c b/source/blender/editors/gpencil/gpencil_weight_paint.c
index 16e084e0b44..1ca73f075a2 100644
--- a/source/blender/editors/gpencil/gpencil_weight_paint.c
+++ b/source/blender/editors/gpencil/gpencil_weight_paint.c
@@ -37,9 +37,7 @@
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_gpencil.h"
-#include "BKE_gpencil_modifier.h"
#include "BKE_main.h"
-#include "BKE_material.h"
#include "DNA_meshdata_types.h"
#include "BKE_object_deform.h"
#include "BKE_report.h"
@@ -64,7 +62,6 @@
/* ************************************************ */
/* General Brush Editing Context */
#define GP_SELECT_BUFFER_CHUNK 256
-#define GP_GRID_PIXEL_SIZE 10.0f
/* Temp Flags while Painting. */
typedef enum eGPDweight_brush_Flag {
@@ -309,7 +306,7 @@ static bool brush_draw_apply(tGP_BrushWeightpaintData *gso,
/* ************************************************ */
/* Header Info */
-static void gp_weightpaint_brush_header_set(bContext *C, tGP_BrushWeightpaintData *UNUSED(gso))
+static void gp_weightpaint_brush_header_set(bContext *C)
{
ED_workspace_status_text(C,
TIP_(
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list