diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-01-19 07:13:01 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-01-19 07:13:01 +0400 |
commit | 2953542c6e03b07880a8665930564762be666744 (patch) | |
tree | 0ef92d90e398c41427278c8c7984dfe9c9d2d87c /source/blender | |
parent | abf7b4d84a2d6840734a60a02979ed67c60d35d6 (diff) |
Remove stroke parameter from PaintStroke's StrokeGetLocation callback.
Only affected sculpt.
Diffstat (limited to 'source/blender')
5 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index ee39dbdaff9..e979738b157 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -342,7 +342,7 @@ static int sculpt_get_brush_geometry(bContext* C, ViewContext *vc, window[1] = y + vc->ar->winrct.ymin; if(vc->obact->sculpt && vc->obact->sculpt->pbvh && - sculpt_stroke_get_location(C, NULL, location, window)) { + sculpt_stroke_get_location(C, location, window)) { *pixel_radius = project_brush_radius(vc, brush_unprojected_radius(scene, brush), diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index 4ca05e1fbd7..73dc1e236f6 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -50,7 +50,7 @@ struct wmOperator; struct wmOperatorType; /* paint_stroke.c */ -typedef int (*StrokeGetLocation)(struct bContext *C, struct PaintStroke *stroke, float location[3], float mouse[2]); +typedef int (*StrokeGetLocation)(struct bContext *C, float location[3], float mouse[2]); typedef int (*StrokeTestStart)(struct bContext *C, struct wmOperator *op, struct wmEvent *event); typedef void (*StrokeUpdateStep)(struct bContext *C, struct PaintStroke *stroke, struct PointerRNA *itemptr); typedef void (*StrokeDone)(struct bContext *C, struct PaintStroke *stroke); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 5e54f51320c..cd8262f06bd 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -163,7 +163,7 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *ev /* TODO: can remove the if statement once all modes have this */ if(stroke->get_location) - stroke->get_location(C, stroke, location, mouse); + stroke->get_location(C, location, mouse); else zero_v3(location); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index b7ee026a2fa..ce84e43955b 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3105,7 +3105,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, halfway[0] = (float)dx * 0.5f + cache->initial_mouse[0]; halfway[1] = (float)dy * 0.5f + cache->initial_mouse[1]; - if (sculpt_stroke_get_location(C, stroke, out, halfway)) { + if (sculpt_stroke_get_location(C, out, halfway)) { copy_v3_v3(sd->anchored_location, out); copy_v2_v2(sd->anchored_initial_mouse, halfway); copy_v2_v2(cache->tex_mouse, halfway); @@ -3207,8 +3207,7 @@ static void sculpt_raycast_cb(PBVHNode *node, void *data_v, float* tmin) (This allows us to ignore the GL depth buffer) Returns 0 if the ray doesn't hit the mesh, non-zero otherwise */ -int sculpt_stroke_get_location(bContext *C, struct PaintStroke *UNUSED(stroke), - float out[3], float mouse[2]) +int sculpt_stroke_get_location(bContext *C, float out[3], float mouse[2]) { ViewContext vc; Object *ob; @@ -3220,12 +3219,13 @@ int sculpt_stroke_get_location(bContext *C, struct PaintStroke *UNUSED(stroke), SculptRaycastData srd; view3d_set_viewcontext(C, &vc); - sculpt_stroke_modifiers_check(C, ob); ob = vc.obact; ss = ob->sculpt; cache = ss->cache; + sculpt_stroke_modifiers_check(C, ob); + mval[0] = mouse[0] - vc.ar->winrct.xmin; mval[1] = mouse[1] - vc.ar->winrct.ymin; @@ -3377,14 +3377,14 @@ static void sculpt_flush_update(bContext *C) /* Returns whether the mouse/stylus is over the mesh (1) or over the background (0) */ -static int over_mesh(bContext *C, struct wmOperator *op, float x, float y) +static int over_mesh(bContext *C, struct wmOperator *UNUSED(op), float x, float y) { float mouse[2], co[3]; mouse[0] = x; mouse[1] = y; - return sculpt_stroke_get_location(C, op->customdata, co, mouse); + return sculpt_stroke_get_location(C, co, mouse); } static int sculpt_stroke_test_start(bContext *C, struct wmOperator *op, diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index 42205a8da04..275d1d52355 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -73,7 +73,7 @@ void sculpt_stroke_free(struct SculptStroke *); void sculpt_stroke_add_point(struct SculptStroke *, const short x, const short y); void sculpt_stroke_apply(struct Sculpt *sd, struct SculptStroke *); void sculpt_stroke_apply_all(struct Sculpt *sd, struct SculptStroke *); -int sculpt_stroke_get_location(bContext *C, struct PaintStroke *stroke, float out[3], float mouse[2]); +int sculpt_stroke_get_location(bContext *C, float out[3], float mouse[2]); /* Undo */ |