[Bf-blender-cvs] [e534fc8a878] greasepencil-object: Silence tons of warnings
Dalai Felinto
noreply at git.blender.org
Tue Jun 13 12:58:04 CEST 2017
Commit: e534fc8a878dfd11d20c96087edca443115077fe
Author: Dalai Felinto
Date: Tue Jun 13 12:57:56 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBe534fc8a878dfd11d20c96087edca443115077fe
Silence tons of warnings
===================================================================
M source/blender/blenkernel/BKE_gpencil.h
M source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M source/blender/draw/engines/gpencil/gpencil_engine.c
M source/blender/draw/engines/gpencil/gpencil_engine.h
M source/blender/draw/engines/gpencil/gpencil_geom.c
M source/blender/draw/intern/draw_cache_impl.h
M source/blender/editors/gpencil/gpencil_paint.c
M source/blender/editors/include/ED_gpencil.h
===================================================================
diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index 6a568d97095..1d9feb2d85a 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -54,7 +54,7 @@ void BKE_gpencil_free(struct bGPdata *gpd, bool free_all);
void BKE_gpencil_batch_cache_dirty(struct bGPdata *gpd, int mode);
void BKE_gpencil_batch_cache_free(struct bGPdata *gpd);
-void BKE_gpencil_batch_cache_alldirty();
+void BKE_gpencil_batch_cache_alldirty(void);
void BKE_gpencil_stroke_sync_selection(struct bGPDstroke *gps);
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 882031a94bf..14ef2fde794 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -41,6 +41,7 @@
#include "IMB_imbuf_types.h"
+#include "draw_cache_impl.h"
#include "gpencil_engine.h"
#define PIX_PERSPECTIVE 1
@@ -460,7 +461,6 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, GPENCIL_e_data *e_dat
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
const DRWContextState *draw_ctx = DRW_context_state_get();
RegionView3D *rv3d = draw_ctx->rv3d;
- Scene *scene = draw_ctx->scene;
DRWShadingGroup *fillgrp;
DRWShadingGroup *strokegrp;
@@ -516,9 +516,6 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, GPENCIL_e_data *e_dat
/* draw stroke in drawing buffer */
static void gpencil_draw_buffer_strokes(GpencilBatchCache *cache, void *vedata, ToolSettings *ts, bGPdata *gpd)
{
- const DRWContextState *draw_ctx = DRW_context_state_get();
- Scene *scene = draw_ctx->scene;
-
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
bGPDbrush *brush = BKE_gpencil_brush_getactive(ts);
@@ -660,7 +657,7 @@ void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, void *vedata, Scene
cache->is_dirty = false;
}
-void DRW_gpencil_batch_cache_dirty(bGPdata *gpd, int mode)
+void DRW_gpencil_batch_cache_dirty(bGPdata *gpd, int UNUSED(mode))
{
GpencilBatchCache *cache = gpd->batch_cache;
if (cache == NULL) {
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index b606227207a..883029d72da 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -48,8 +48,6 @@ static void GPENCIL_engine_init(void *vedata)
{
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
- const DRWContextState *draw_ctx = DRW_context_state_get();
-
/* normal fill shader */
if (!e_data.gpencil_fill_sh) {
e_data.gpencil_fill_sh = DRW_shader_create(datatoc_gpencil_fill_vert_glsl, NULL,
@@ -98,9 +96,6 @@ static void GPENCIL_cache_init(void *vedata)
GPENCIL_PassList *psl = ((GPENCIL_Data *)vedata)->psl;
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
- const DRWContextState *draw_ctx = DRW_context_state_get();
- PaletteColor *palcolor = CTX_data_active_palettecolor(draw_ctx->evil_C);
-
if (!stl->g_data) {
/* Alloc transient pointers */
stl->g_data = MEM_mallocN(sizeof(g_data), "g_data");
@@ -179,7 +174,6 @@ static void GPENCIL_cache_finish(void *vedata)
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
const DRWContextState *draw_ctx = DRW_context_state_get();
Scene *scene = draw_ctx->scene;
- RegionView3D *rv3d = draw_ctx->rv3d;
ToolSettings *ts = scene->toolsettings;
/* Draw all pending objects sorted by object location zdepth.For GP objects, the order of drawing
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index 09b56ddbe53..c150a48f778 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -28,6 +28,8 @@
#include "GPU_batch.h"
+struct tGPspoint;
+
/* TODO: these could be system parameter in userprefs screen */
#define GPENCIL_CACHE_BLOCK_SIZE 8
#define GPENCIL_MAX_SHGROUPS 65536
diff --git a/source/blender/draw/engines/gpencil/gpencil_geom.c b/source/blender/draw/engines/gpencil/gpencil_geom.c
index 0c90d6f9569..60a65d0b4f7 100644
--- a/source/blender/draw/engines/gpencil/gpencil_geom.c
+++ b/source/blender/draw/engines/gpencil/gpencil_geom.c
@@ -50,7 +50,7 @@
#include "gpencil_engine.h"
/* set stroke point to vbo */
-static void gpencil_set_stroke_point(RegionView3D *rv3d, VertexBuffer *vbo, float matrix[4][4], const bGPDspoint *pt, int idx,
+static void gpencil_set_stroke_point(VertexBuffer *vbo, float matrix[4][4], const bGPDspoint *pt, int idx,
unsigned int pos_id, unsigned int color_id,
unsigned int thickness_id, short thickness,
const float ink[4])
@@ -100,9 +100,6 @@ Batch *DRW_gpencil_get_point_geom(bGPDspoint *pt, short thickness, const float i
/* create batch geometry data for stroke shader */
Batch *DRW_gpencil_get_stroke_geom(bGPDframe *gpf, bGPDstroke *gps, short thickness, const float ink[4])
{
- const DRWContextState *draw_ctx = DRW_context_state_get();
- RegionView3D *rv3d = draw_ctx->rv3d;
-
bGPDspoint *points = gps->points;
int totpoints = gps->totpoints;
/* if cyclic needs more vertex */
@@ -125,27 +122,27 @@ Batch *DRW_gpencil_get_stroke_geom(bGPDframe *gpf, bGPDstroke *gps, short thickn
for (int i = 0; i < totpoints; i++, pt++) {
/* first point for adjacency (not drawn) */
if (i == 0) {
- gpencil_set_stroke_point(rv3d, vbo, gpf->viewmatrix, &points[1], idx, pos_id, color_id, thickness_id, thickness, ink);
+ gpencil_set_stroke_point(vbo, gpf->viewmatrix, &points[1], idx, pos_id, color_id, thickness_id, thickness, ink);
++idx;
}
/* set point */
- gpencil_set_stroke_point(rv3d, vbo, gpf->viewmatrix, pt, idx, pos_id, color_id, thickness_id, thickness, ink);
+ gpencil_set_stroke_point(vbo, gpf->viewmatrix, pt, idx, pos_id, color_id, thickness_id, thickness, ink);
++idx;
}
if (gps->flag & GP_STROKE_CYCLIC && totpoints > 2) {
/* draw line to first point to complete the cycle */
- gpencil_set_stroke_point(rv3d, vbo, gpf->viewmatrix, &points[0], idx, pos_id, color_id, thickness_id, thickness, ink);
+ gpencil_set_stroke_point(vbo, gpf->viewmatrix, &points[0], idx, pos_id, color_id, thickness_id, thickness, ink);
++idx;
/* now add adjacency points using 2nd & 3rd point to get smooth transition */
- gpencil_set_stroke_point(rv3d, vbo, gpf->viewmatrix, &points[1], idx, pos_id, color_id, thickness_id, thickness, ink);
+ gpencil_set_stroke_point(vbo, gpf->viewmatrix, &points[1], idx, pos_id, color_id, thickness_id, thickness, ink);
++idx;
- gpencil_set_stroke_point(rv3d, vbo, gpf->viewmatrix, &points[2], idx, pos_id, color_id, thickness_id, thickness, ink);
+ gpencil_set_stroke_point(vbo, gpf->viewmatrix, &points[2], idx, pos_id, color_id, thickness_id, thickness, ink);
++idx;
}
/* last adjacency point (not drawn) */
else {
- gpencil_set_stroke_point(rv3d, vbo, gpf->viewmatrix, &points[totpoints - 2], idx, pos_id, color_id, thickness_id, thickness, ink);
+ gpencil_set_stroke_point(vbo, gpf->viewmatrix, &points[totpoints - 2], idx, pos_id, color_id, thickness_id, thickness, ink);
}
return Batch_create(PRIM_LINE_STRIP_ADJACENCY, vbo, NULL);
@@ -270,16 +267,16 @@ Batch *DRW_gpencil_get_buffer_stroke_geom(bGPdata *gpd, float matrix[4][4], shor
/* first point for adjacency (not drawn) */
if (i == 0) {
- gpencil_set_stroke_point(rv3d, vbo, matrix, &pt, idx, pos_id, color_id, thickness_id, thickness, gpd->scolor);
+ gpencil_set_stroke_point(vbo, matrix, &pt, idx, pos_id, color_id, thickness_id, thickness, gpd->scolor);
++idx;
}
/* set point */
- gpencil_set_stroke_point(rv3d, vbo, matrix, &pt, idx, pos_id, color_id, thickness_id, thickness, gpd->scolor);
+ gpencil_set_stroke_point(vbo, matrix, &pt, idx, pos_id, color_id, thickness_id, thickness, gpd->scolor);
++idx;
}
/* last adjacency point (not drawn) */
- gpencil_set_stroke_point(rv3d, vbo, matrix, &pt, idx, pos_id, color_id, thickness_id, thickness, gpd->scolor);
+ gpencil_set_stroke_point(vbo, matrix, &pt, idx, pos_id, color_id, thickness_id, thickness, gpd->scolor);
return Batch_create(PRIM_LINE_STRIP_ADJACENCY, vbo, NULL);
}
diff --git a/source/blender/draw/intern/draw_cache_impl.h b/source/blender/draw/intern/draw_cache_impl.h
index 361dd92bc4f..8dbeaf6dfea 100644
--- a/source/blender/draw/intern/draw_cache_impl.h
+++ b/source/blender/draw/intern/draw_cache_impl.h
@@ -26,6 +26,7 @@
#ifndef __DRAW_CACHE_IMPL_H__
#define __DRAW_CACHE_IMPL_H__
+struct bGPdata;
struct Batch;
struct ListBase;
struct CurveCache;
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 7ad5f90920e..8342e3740ee 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -252,7 +252,6 @@ static void gp_get_3d_reference(tGPsdata *p, float vec[3])
{
View3D *v3d = p->sa->spacedata.first;
ToolSettings *ts = p->scene->toolsettings;
- const float *fp = ED_view3d_cursor3d_get(p->scene, v3d);
Object *ob = NULL;
if (p->ownerPtr.type == &RNA_Object) {
ob = (Object *)p->ownerPtr.data;
diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h
index 86def7907fa..9d910c4539d 100644
--- a/source/blender/editors/include/ED_gpencil.h
+++ b/source/blender/editors/include/ED_gpencil.h
@@ -41,6 +41,7 @@ struct bGPDframe;
struct bGPDstroke;
struct bGPDpalette;
struct bGPDpalettecolor;
+struct bGPDspoint;
struct ID;
struct KeyframeEditData;
struct ListBase;
@@ -50,6 +51,7 @@ struct PaletteColor;
struct PointerRNA;
struct RegionView3D;
struct ScrArea;
+struct ToolSettings;
struct View3D;
struct wmKeyConfig;
struct wmWindowManager;
More information about the Bf-blender-cvs
mailing list