Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c81
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h2
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c8
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c8
-rw-r--r--source/blender/editors/sculpt_paint/paint_undo.c5
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c14
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c12
8 files changed, 71 insertions, 63 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 6e921b57d9d..71754c3589a 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -383,7 +383,7 @@ static void *image_undo_push_tile(Image *ima, ImBuf *ibuf, ImBuf **tmpibuf, int
return tile->rect;
if (*tmpibuf==NULL)
- *tmpibuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, IB_rectfloat|IB_rect, 0);
+ *tmpibuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, IB_rectfloat|IB_rect);
tile= MEM_callocN(sizeof(UndoImageTile), "UndoImageTile");
strcpy(tile->idname, ima->id.name);
@@ -410,7 +410,7 @@ static void image_undo_restore(bContext *C, ListBase *lb)
UndoImageTile *tile;
tmpibuf= IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32,
- IB_rectfloat|IB_rect, 0);
+ IB_rectfloat|IB_rect);
for(tile=lb->first; tile; tile=tile->next) {
/* find image based on name, pointer becomes invalid with global undo */
@@ -473,8 +473,6 @@ static int project_bucket_offset_safe(const ProjPaintState *ps, const float proj
}
}
-#define SIDE_OF_LINE(pa, pb, pp) ((pa[0]-pp[0])*(pb[1]-pp[1]))-((pb[0]-pp[0])*(pa[1]-pp[1]))
-
/* still use 2D X,Y space but this works for verts transformed by a perspective matrix, using their 4th component as a weight */
static void barycentric_weights_v2_persp(float v1[4], float v2[4], float v3[4], float co[2], float w[3])
{
@@ -1689,7 +1687,7 @@ static float Vec2Lenf_nosqrt_other(const float *v1, const float v2_1, const floa
/* note, use a squared value so we can use Vec2Lenf_nosqrt
* be sure that you have done a bounds check first or this may fail */
/* only give bucket_bounds as an arg because we need it elsewhere */
-static int project_bucket_isect_circle(const int bucket_x, const int bucket_y, const float cent[2], const float radius_squared, rctf *bucket_bounds)
+static int project_bucket_isect_circle(const float cent[2], const float radius_squared, rctf *bucket_bounds)
{
/* Would normally to a simple intersection test, however we know the bounds of these 2 already intersect
@@ -1852,7 +1850,7 @@ static void project_bucket_clip_face(
{
int inside_bucket_flag = 0;
int inside_face_flag = 0;
- const int flip = ((SIDE_OF_LINE(v1coSS, v2coSS, v3coSS) > 0.0f) != (SIDE_OF_LINE(uv1co, uv2co, uv3co) > 0.0f));
+ const int flip = ((line_point_side_v2(v1coSS, v2coSS, v3coSS) > 0.0f) != (line_point_side_v2(uv1co, uv2co, uv3co) > 0.0f));
float bucket_bounds_ss[4][2];
@@ -2134,15 +2132,15 @@ if __name__ == '__main__':
/* checks if pt is inside a convex 2D polyline, the polyline must be ordered rotating clockwise
- * otherwise it would have to test for mixed (SIDE_OF_LINE > 0.0f) cases */
+ * otherwise it would have to test for mixed (line_point_side_v2 > 0.0f) cases */
int IsectPoly2Df(const float pt[2], float uv[][2], const int tot)
{
int i;
- if (SIDE_OF_LINE(uv[tot-1], uv[0], pt) < 0.0f)
+ if (line_point_side_v2(uv[tot-1], uv[0], pt) < 0.0f)
return 0;
for (i=1; i<tot; i++) {
- if (SIDE_OF_LINE(uv[i-1], uv[i], pt) < 0.0f)
+ if (line_point_side_v2(uv[i-1], uv[i], pt) < 0.0f)
return 0;
}
@@ -2152,10 +2150,10 @@ int IsectPoly2Df(const float pt[2], float uv[][2], const int tot)
static int IsectPoly2Df_twoside(const float pt[2], float uv[][2], const int tot)
{
int i;
- int side = (SIDE_OF_LINE(uv[tot-1], uv[0], pt) > 0.0f);
+ int side = (line_point_side_v2(uv[tot-1], uv[0], pt) > 0.0f);
for (i=1; i<tot; i++) {
- if ((SIDE_OF_LINE(uv[i-1], uv[i], pt) > 0.0f) != side)
+ if ((line_point_side_v2(uv[i-1], uv[i], pt) > 0.0f) != side)
return 0;
}
@@ -2652,7 +2650,7 @@ static void project_bucket_init(const ProjPaintState *ps, const int thread_index
* calculated when it might not be needed later, (at the moment at least)
* obviously it shouldn't have bugs though */
-static int project_bucket_face_isect(ProjPaintState *ps, float min[2], float max[2], int bucket_x, int bucket_y, int bucket_index, const MFace *mf)
+static int project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucket_y, const MFace *mf)
{
/* TODO - replace this with a tricker method that uses sideofline for all screenCoords's edges against the closest bucket corner */
rctf bucket_bounds;
@@ -2712,11 +2710,11 @@ static int project_bucket_face_isect(ProjPaintState *ps, float min[2], float max
/* Add faces to the bucket but dont initialize its pixels
* TODO - when painting occluded, sort the faces on their min-Z and only add faces that faces that are not occluded */
-static void project_paint_delayed_face_init(ProjPaintState *ps, const MFace *mf, const MTFace *tf, const int face_index)
+static void project_paint_delayed_face_init(ProjPaintState *ps, const MFace *mf, const int face_index)
{
float min[2], max[2], *vCoSS;
int bucketMin[2], bucketMax[2]; /* for ps->bucketRect indexing */
- int fidx, bucket_x, bucket_y, bucket_index;
+ int fidx, bucket_x, bucket_y;
int has_x_isect = -1, has_isect = 0; /* for early loop exit */
MemArena *arena = ps->arena_mt[0]; /* just use the first thread arena since threading has not started yet */
@@ -2733,10 +2731,8 @@ static void project_paint_delayed_face_init(ProjPaintState *ps, const MFace *mf,
for (bucket_y = bucketMin[1]; bucket_y < bucketMax[1]; bucket_y++) {
has_x_isect = 0;
for (bucket_x = bucketMin[0]; bucket_x < bucketMax[0]; bucket_x++) {
-
- bucket_index = bucket_x + (bucket_y * ps->buckets_x);
-
- if (project_bucket_face_isect(ps, min, max, bucket_x, bucket_y, bucket_index, mf)) {
+ if (project_bucket_face_isect(ps, bucket_x, bucket_y, mf)) {
+ int bucket_index= bucket_x + (bucket_y * ps->buckets_x);
BLI_linklist_prepend_arena(
&ps->bucketFaces[ bucket_index ],
SET_INT_IN_POINTER(face_index), /* cast to a pointer to shut up the compiler */
@@ -3194,7 +3190,7 @@ static void project_paint_begin(ProjPaintState *ps)
}
}
else {
- if (SIDE_OF_LINE(v1coSS, v2coSS, v3coSS) < 0.0f) {
+ if (line_point_side_v2(v1coSS, v2coSS, v3coSS) < 0.0f) {
continue;
}
@@ -3217,7 +3213,7 @@ static void project_paint_begin(ProjPaintState *ps)
if (image_index != -1) {
/* Initialize the faces screen pixels */
/* Add this to a list to initialize later */
- project_paint_delayed_face_init(ps, mf, tf, face_index);
+ project_paint_delayed_face_init(ps, mf, face_index);
}
}
}
@@ -3500,7 +3496,7 @@ static int project_bucket_iter_next(ProjPaintState *ps, int *bucket_index, rctf
project_bucket_bounds(ps, ps->context_bucket_x, ps->context_bucket_y, bucket_bounds);
if ( (ps->source != PROJ_SRC_VIEW) ||
- project_bucket_isect_circle(ps->context_bucket_x, ps->context_bucket_y, mval, (float)(diameter*diameter), bucket_bounds)
+ project_bucket_isect_circle(mval, (float)(diameter*diameter), bucket_bounds)
) {
*bucket_index = ps->context_bucket_x + (ps->context_bucket_y * ps->buckets_x);
ps->context_bucket_x++;
@@ -3569,7 +3565,7 @@ static void blend_color_mix_accum(unsigned char *cp, const unsigned char *cp1, c
cp[3]= alpha > 255 ? 255 : alpha;
}
-static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask)
+static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask)
{
if (ps->is_airbrush==0 && mask < 1.0f) {
projPixel->newColor.uint = IMB_blend_color(projPixel->newColor.uint, ((ProjPixelClone*)projPixel)->clonepx.uint, (int)(alpha*255), ps->blend);
@@ -3580,7 +3576,7 @@ static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, floa
}
}
-static void do_projectpaint_clone_f(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask)
+static void do_projectpaint_clone_f(ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask)
{
if (ps->is_airbrush==0 && mask < 1.0f) {
IMB_blend_color_float(projPixel->newColor.f, projPixel->newColor.f, ((ProjPixelClone *)projPixel)->clonepx.f, alpha, ps->blend);
@@ -3597,7 +3593,7 @@ static void do_projectpaint_clone_f(ProjPaintState *ps, ProjPixel *projPixel, fl
* accumulation of color greater then 'projPixel->mask' however in the case of smear its not
* really that important to be correct as it is with clone and painting
*/
-static void do_projectpaint_smear(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask, MemArena *smearArena, LinkNode **smearPixels, float co[2])
+static void do_projectpaint_smear(ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask, MemArena *smearArena, LinkNode **smearPixels, float co[2])
{
unsigned char rgba_ub[4];
@@ -3608,7 +3604,7 @@ static void do_projectpaint_smear(ProjPaintState *ps, ProjPixel *projPixel, floa
BLI_linklist_prepend_arena(smearPixels, (void *)projPixel, smearArena);
}
-static void do_projectpaint_smear_f(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask, MemArena *smearArena, LinkNode **smearPixels_f, float co[2])
+static void do_projectpaint_smear_f(ProjPaintState *ps, ProjPixel *projPixel, float alpha, float mask, MemArena *smearArena, LinkNode **smearPixels_f, float co[2])
{
unsigned char rgba_ub[4];
unsigned char rgba_smear[4];
@@ -3757,6 +3753,7 @@ static void *do_projectpaint_thread(void *ph_v)
if (falloff > 0.0f) {
if (ps->is_texbrush) {
+ /* note, for clone and smear, we only use the alpha, could be a special function */
brush_sample_tex(ps->brush, projPixel->projCoSS, rgba, thread_index);
alpha = rgba[3];
} else {
@@ -3808,20 +3805,20 @@ static void *do_projectpaint_thread(void *ph_v)
case PAINT_TOOL_CLONE:
if (is_floatbuf) {
if (((ProjPixelClone *)projPixel)->clonepx.f[3]) {
- do_projectpaint_clone_f(ps, projPixel, rgba, alpha, mask);
+ do_projectpaint_clone_f(ps, projPixel, alpha, mask); /* rgba isnt used for cloning, only alpha */
}
}
else {
if (((ProjPixelClone*)projPixel)->clonepx.ch[3]) {
- do_projectpaint_clone(ps, projPixel, rgba, alpha, mask);
+ do_projectpaint_clone(ps, projPixel, alpha, mask); /* rgba isnt used for cloning, only alpha */
}
}
break;
case PAINT_TOOL_SMEAR:
sub_v2_v2v2(co, projPixel->projCoSS, pos_ofs);
- if (is_floatbuf) do_projectpaint_smear_f(ps, projPixel, rgba, alpha, mask, smearArena, &smearPixels_f, co);
- else do_projectpaint_smear(ps, projPixel, rgba, alpha, mask, smearArena, &smearPixels, co);
+ if (is_floatbuf) do_projectpaint_smear_f(ps, projPixel, alpha, mask, smearArena, &smearPixels_f, co);
+ else do_projectpaint_smear(ps, projPixel, alpha, mask, smearArena, &smearPixels, co);
break;
default:
if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, rgba, alpha, mask);
@@ -3861,7 +3858,7 @@ static void *do_projectpaint_thread(void *ph_v)
return NULL;
}
-static int project_paint_op(void *state, ImBuf *ibufb, float *lastpos, float *pos)
+static int project_paint_op(void *state, ImBuf *UNUSED(ibufb), float *lastpos, float *pos)
{
/* First unpack args from the struct */
ProjPaintState *ps = (ProjPaintState *)state;
@@ -3928,7 +3925,7 @@ static int project_paint_op(void *state, ImBuf *ibufb, float *lastpos, float *po
}
-static int project_paint_sub_stroke(ProjPaintState *ps, BrushPainter *painter, int *prevmval_i, int *mval_i, double time, float pressure)
+static int project_paint_sub_stroke(ProjPaintState *ps, BrushPainter *painter, int *UNUSED(prevmval_i), int *mval_i, double time, float pressure)
{
/* Use mouse coords as floats for projection painting */
@@ -4194,7 +4191,7 @@ static ImBuf *imapaint_lift_clone(ImBuf *ibuf, ImBuf *ibufb, int *pos)
/* note: allocImbuf returns zero'd memory, so regions outside image will
have zero alpha, and hence not be blended onto the image */
int w=ibufb->x, h=ibufb->y, destx=0, desty=0, srcx=pos[0], srcy=pos[1];
- ImBuf *clonebuf= IMB_allocImBuf(w, h, ibufb->depth, ibufb->flags, 0);
+ ImBuf *clonebuf= IMB_allocImBuf(w, h, ibufb->depth, ibufb->flags);
IMB_rectclip(clonebuf, ibuf, &destx, &desty, &srcx, &srcy, &w, &h);
IMB_rectblend(clonebuf, ibuf, destx, desty, srcx, srcy, w, h,
@@ -4387,7 +4384,7 @@ static int imapaint_paint_stroke(ViewContext *vc, ImagePaintState *s, BrushPaint
ibuf= BKE_image_get_ibuf(newimage, s->sima? &s->sima->iuser: NULL);
if(ibuf && ibuf->rect)
- imapaint_pick_uv(s->scene, s->ob, s->me, newfaceindex, mval, newuv);
+ imapaint_pick_uv(s->scene, s->ob, newfaceindex, mval, newuv);
else {
newimage = NULL;
newuv[0] = newuv[1] = 0.0f;
@@ -4398,8 +4395,8 @@ static int imapaint_paint_stroke(ViewContext *vc, ImagePaintState *s, BrushPaint
/* see if stroke is broken, and if so finish painting in old position */
if (s->image) {
- imapaint_pick_uv(s->scene, s->ob, s->me, s->faceindex, mval, fwuv);
- imapaint_pick_uv(s->scene, s->ob, s->me, newfaceindex, prevmval, bkuv);
+ imapaint_pick_uv(s->scene, s->ob, s->faceindex, mval, fwuv);
+ imapaint_pick_uv(s->scene, s->ob, newfaceindex, prevmval, bkuv);
if (newimage == s->image)
breakstroke= texpaint_break_stroke(s->uv, fwuv, bkuv, newuv);
@@ -4410,7 +4407,7 @@ static int imapaint_paint_stroke(ViewContext *vc, ImagePaintState *s, BrushPaint
fwuv[0]= fwuv[1]= 0.0f;
if (breakstroke) {
- imapaint_pick_uv(s->scene, s->ob, s->me, s->faceindex, mval, fwuv);
+ imapaint_pick_uv(s->scene, s->ob, s->faceindex, mval, fwuv);
redraw |= imapaint_paint_sub_stroke(s, painter, s->image, texpaint,
fwuv, time, 1, pressure);
imapaint_clear_partial_redraw();
@@ -4923,7 +4920,7 @@ static int get_imapaint_zoom(bContext *C, float *zoomx, float *zoomy)
/************************ cursor drawing *******************************/
-static void brush_drawcursor(bContext *C, int x, int y, void *customdata)
+static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata))
{
Brush *brush= image_paint_brush(C);
Paint *paint= paint_get_active(CTX_data_scene(C));
@@ -4989,10 +4986,10 @@ static int paint_radial_control_exec(bContext *C, wmOperator *op)
Brush *brush = paint_brush(&CTX_data_scene(C)->toolsettings->imapaint.paint);
float zoom;
int ret;
- char str[256];
+ char str[64];
get_imapaint_zoom(C, &zoom, &zoom);
ret = brush_radial_control_exec(op, brush, 1.0f / zoom);
- WM_radial_control_string(op, str, 256);
+ WM_radial_control_string(op, str, sizeof(str));
WM_event_add_notifier(C, NC_BRUSH|NA_EDITED, brush);
@@ -5087,7 +5084,7 @@ static int grab_clone_modal(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_RUNNING_MODAL;
}
-static int grab_clone_cancel(bContext *C, wmOperator *op)
+static int grab_clone_cancel(bContext *UNUSED(C), wmOperator *op)
{
MEM_freeN(op->customdata);
return OPERATOR_CANCELLED;
@@ -5336,8 +5333,8 @@ static int texture_paint_radial_control_exec(bContext *C, wmOperator *op)
{
Brush *brush = paint_brush(&CTX_data_scene(C)->toolsettings->imapaint.paint);
int ret = brush_radial_control_exec(op, brush, 1);
- char str[256];
- WM_radial_control_string(op, str, 256);
+ char str[64];
+ WM_radial_control_string(op, str, sizeof(str));
WM_event_add_notifier(C, NC_BRUSH|NA_EDITED, brush);
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index 6c1e933f9e8..68599dfcda2 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -164,7 +164,7 @@ void PAINT_OT_image_from_view(struct wmOperatorType *ot);
/* paint_utils.c */
int imapaint_pick_face(struct ViewContext *vc, struct Mesh *me, int *mval, unsigned int *index);
-void imapaint_pick_uv(struct Scene *scene, struct Object *ob, struct Mesh *mesh, unsigned int faceindex, int *xy, float *uv);
+void imapaint_pick_uv(struct Scene *scene, struct Object *ob, unsigned int faceindex, int *xy, float *uv);
void paint_sample_color(struct Scene *scene, struct ARegion *ar, int x, int y);
void BRUSH_OT_curve_preset(struct wmOperatorType *ot);
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 39bae3c1153..b190398037d 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -43,7 +43,7 @@
//#include <stdio.h>
/* Brush operators */
-static int brush_add_exec(bContext *C, wmOperator *op)
+static int brush_add_exec(bContext *C, wmOperator *UNUSED(op))
{
/*int type = RNA_enum_get(op->ptr, "type");*/
Paint *paint = paint_get_active(CTX_data_scene(C));
@@ -130,7 +130,7 @@ void BRUSH_OT_scale_size(wmOperatorType *ot)
RNA_def_float(ot->srna, "scalar", 1, 0, 2, "Scalar", "Factor to scale brush size by", 0, 2);
}
-static int vertex_color_set_exec(bContext *C, wmOperator *op)
+static int vertex_color_set_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
Object *obact = CTX_data_active_object(C);
@@ -155,7 +155,7 @@ void PAINT_OT_vertex_color_set(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
-static int brush_reset_exec(bContext *C, wmOperator *op)
+static int brush_reset_exec(bContext *C, wmOperator *UNUSED(op))
{
Paint *paint = paint_get_active(CTX_data_scene(C));
struct Brush *brush = paint_brush(paint);
@@ -309,7 +309,7 @@ static void ed_keymap_paint_brush_switch(wmKeyMap *keymap, const char *path)
RNA_int_set(kmi->ptr, "value", 19);
}
-static void ed_keymap_paint_brush_size(wmKeyMap *keymap, const char *path)
+static void ed_keymap_paint_brush_size(wmKeyMap *keymap, const char *UNUSED(path))
{
wmKeyMapItem *kmi;
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 576d4b64b05..50d1286042b 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -291,7 +291,7 @@ static void make_snap(Snapshot* snap, Brush* brush, ViewContext* vc)
snap->winy = vc->ar->winy;
}
-int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
+static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
{
static GLuint overlay_texture = 0;
static int init = 0;
@@ -306,8 +306,12 @@ int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
int j;
int refresh;
+#ifndef _OPENMP
+ (void)sd; /* quied unused warning */
+#endif
+
if (br->mtex.brush_map_mode == MTEX_MAP_MODE_TILED && !br->mtex.tex) return 0;
-
+
refresh =
!overlay_texture ||
(br->mtex.tex &&
diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c
index 6dc406005f9..72f42aa1d3c 100644
--- a/source/blender/editors/sculpt_paint/paint_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_undo.c
@@ -36,6 +36,7 @@
#include "BKE_mesh.h"
#include "BLI_string.h"
+#include "BKE_utildefines.h"
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_global.h"
@@ -69,13 +70,13 @@ static UndoStack MeshUndoStack = {UNDO_PAINT_MESH, {NULL, NULL}, NULL};
/* Generic */
-static void undo_restore(bContext *C, UndoStack *stack, UndoElem *uel)
+static void undo_restore(bContext *C, UndoStack *UNUSED(stack), UndoElem *uel)
{
if(uel && uel->restore)
uel->restore(C, &uel->elems);
}
-static void undo_elem_free(UndoStack *stack, UndoElem *uel)
+static void undo_elem_free(UndoStack *UNUSED(stack), UndoElem *uel)
{
if(uel && uel->free) {
uel->free(&uel->elems);
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index d8bef04f82a..42c56424df4 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -103,7 +103,7 @@ static void imapaint_tri_weights(Object *ob, float *v1, float *v2, float *v3, fl
}
/* compute uv coordinates of mouse in face */
-void imapaint_pick_uv(Scene *scene, Object *ob, Mesh *mesh, unsigned int faceindex, int *xy, float *uv)
+void imapaint_pick_uv(Scene *scene, Object *ob, unsigned int faceindex, int *xy, float *uv)
{
DerivedMesh *dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
int *index = dm->getFaceDataArray(dm, CD_ORIGINDEX);
@@ -248,7 +248,7 @@ void BRUSH_OT_curve_preset(wmOperatorType *ot)
/* face-select ops */
-static int paint_select_linked_exec(bContext *C, wmOperator *op)
+static int paint_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
{
select_linked_tfaces(C, CTX_data_active_object(C), NULL, 2);
ED_region_tag_redraw(CTX_wm_region(C));
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 426cd09dcde..b12767d46ad 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -578,7 +578,7 @@ static void wpaint_blend(VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float
/* else */
/* sets wp->weight to the closest weight value to vertex */
/* note: we cant sample frontbuf, weight colors are interpolated too unpredictable */
-void sample_wpaint(Scene *scene, ARegion *ar, View3D *v3d, int mode)
+void sample_wpaint(Scene *scene, ARegion *ar, View3D *UNUSED(v3d), int mode)
{
ViewContext vc;
ToolSettings *ts= scene->toolsettings;
@@ -787,7 +787,7 @@ static void do_weight_paint_vertex(VPaint *wp, Object *ob, int index,
/* *************** set wpaint operator ****************** */
-static int set_wpaint(bContext *C, wmOperator *op) /* toggle */
+static int set_wpaint(bContext *C, wmOperator *UNUSED(op)) /* toggle */
{
Object *ob= CTX_data_active_object(C);
Scene *scene= CTX_data_scene(C);
@@ -982,7 +982,7 @@ struct WPaintData {
char *vgroup_validmap; /*stores if vgroups tie to deforming bones or not*/
};
-static char *wpaint_make_validmap(Mesh *me, Object *ob)
+static char *wpaint_make_validmap(Object *ob)
{
bDeformGroup *dg;
ModifierData *md;
@@ -1040,7 +1040,7 @@ static char *wpaint_make_validmap(Mesh *me, Object *ob)
return validmap;
}
-static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *event)
+static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
{
Scene *scene= CTX_data_scene(C);
struct PaintStroke *stroke = op->customdata;
@@ -1070,7 +1070,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *event)
vgroups affect deform bones*/
wpd->auto_normalize = ts->auto_normalize;
if (wpd->auto_normalize)
- wpd->vgroup_validmap = wpaint_make_validmap(me, ob);
+ wpd->vgroup_validmap = wpaint_make_validmap(ob);
// if(qual & LR_CTRLKEY) {
// sample_wpaint(scene, ar, v3d, 0);
@@ -1389,7 +1389,7 @@ void PAINT_OT_weight_paint(wmOperatorType *ot)
RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
}
-static int weight_paint_set_exec(bContext *C, wmOperator *op)
+static int weight_paint_set_exec(bContext *C, wmOperator *UNUSED(op))
{
struct Scene *scene= CTX_data_scene(C);
Object *obact = CTX_data_active_object(C);
@@ -1502,7 +1502,7 @@ static int weight_from_bones_exec(bContext *C, wmOperator *op)
Mesh *me= ob->data;
int type= RNA_enum_get(op->ptr, "type");
- create_vgroups_from_armature(scene, ob, armob, type, (me->editflag & ME_EDIT_MIRROR_X));
+ create_vgroups_from_armature(op->reports, scene, ob, armob, type, (me->editflag & ME_EDIT_MIRROR_X));
DAG_id_flush_update(&me->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, me);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index ed2251cea38..7ddb42fa51a 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -370,7 +370,7 @@ static float get_texcache_pixel_bilinear(const SculptSession *ss, float u, float
#endif
-static float tex_strength(SculptSession *ss, Brush *br, float *co,
+static float tex_strength(SculptSession *ss, Brush *UNUSED(br), float *co,
float mask, float dist)
{
return paint_stroke_combined_strength(ss->cache->stroke, dist, co, mask);
@@ -408,6 +408,8 @@ static void calc_area_normal(Sculpt *sd, Object *ob, float an[3], PBVHNode **nod
float out_flip[3] = {0.0f, 0.0f, 0.0f};
+ (void)sd; /* unused w/o openmp */
+
zero_v3(an);
#pragma omp parallel for schedule(guided) if (sd->paint.flags & PAINT_USE_OPENMP)
@@ -1229,6 +1231,8 @@ static void calc_flatten_center(Sculpt *sd, Object *ob, PBVHNode **nodes, int to
float count = 0;
+ (void)sd; /* unused w/o openmp */
+
zero_v3(fc);
#pragma omp parallel for schedule(guided) if (sd->paint.flags & PAINT_USE_OPENMP)
@@ -1284,6 +1288,8 @@ static void calc_area_normal_and_flatten_center(Sculpt *sd, Object *ob, PBVHNode
// fc
float count = 0;
+ (void)sd; /* unused w/o openmp */
+
// an
zero_v3(an);
@@ -2384,7 +2390,7 @@ static void sculpt_update_cache_invariants(bContext* C, Sculpt *sd, SculptSessio
cache->vertex_rotation= 0;
}
-static void sculpt_update_brush_delta(Sculpt *sd, Object *ob, Brush *brush)
+static void sculpt_update_brush_delta(Object *ob, Brush *brush)
{
SculptSession *ss = ob->paint->sculpt;
StrokeCache *cache = ss->cache;
@@ -2463,7 +2469,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, SculptSession
/* Truly temporary data that isn't stored in properties */
- sculpt_update_brush_delta(sd, ob, brush);
+ sculpt_update_brush_delta(ob, brush);
if(brush->sculpt_tool == SCULPT_TOOL_ROTATE) {
float mouse[2], initial_mouse[2];