Remove stroke parameter from PaintStroke's StrokeGetLocation callback.
authorNicholas Bishop <nicholasbishop@gmail.com>
Thu, 19 Jan 2012 03:13:01 +0000 (03:13 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Thu, 19 Jan 2012 03:13:01 +0000 (03:13 +0000)
Only affected sculpt.

source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_intern.h
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_intern.h

index ee39dbdaff9a00f87bb9df2d1257ec9bca6e13bb..e979738b15787d2469586703bf4c93e6ccd07c43 100644 (file)
@@ -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),
index 4ca05e1fbd7ee6a3732d3b00edf9a1757d5d0103..73dc1e236f682ed6bfbdd661832f4eef3361bd97 100644 (file)
@@ -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);
index 5e54f51320c06d82526c750a14509444600920aa..cd8262f06bdc9302e0794e58a59d736f85b877f1 100644 (file)
@@ -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);
 
index b7ee026a2faae68050f9844567122c68de06821a..ce84e43955b642a243f20483446d486800ace15f 100644 (file)
@@ -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,
index 42205a8da0400939fea8898a4814537834d37ecb..275d1d5235559c59aac28801a85bf5c1ff10105b 100644 (file)
@@ -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 */