From cabeb39005ae98ea3ca14b7ff678e249ef78d57b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 19 Jun 2014 17:35:23 +1000 Subject: [PATCH] Code cleanup: remove unused callback for depth drawing --- .../editors/space_view3d/view3d_draw.c | 22 ++++++++----------- .../editors/space_view3d/view3d_edit.c | 8 +++---- .../editors/space_view3d/view3d_intern.h | 4 ++-- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index ace22406b7e..8b2b8afbcad 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2236,7 +2236,7 @@ float view3d_depth_near(ViewDepths *d) return far == far_real ? FLT_MAX : far; } -void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d) +void ED_view3d_draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d) { short zbuf = v3d->zbuf; RegionView3D *rv3d = ar->regiondata; @@ -2263,7 +2263,7 @@ void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d) } -void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (*func)(void *), bool alphaoverride) +void ED_view3d_draw_depth(Scene *scene, ARegion *ar, View3D *v3d, bool alphaoverride) { RegionView3D *rv3d = ar->regiondata; Base *base; @@ -2304,11 +2304,9 @@ void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (*func)(void *), boo Scene *sce_iter; for (SETLOOPER(scene->set, sce_iter, base)) { if (v3d->lay & base->lay) { - if (func == NULL || func(base)) { - draw_object(scene, ar, v3d, base, 0); - if (base->object->transflag & OB_DUPLI) { - draw_dupli_objects_color(scene, ar, v3d, base, dflag_depth, TH_UNDEFINED); - } + draw_object(scene, ar, v3d, base, 0); + if (base->object->transflag & OB_DUPLI) { + draw_dupli_objects_color(scene, ar, v3d, base, dflag_depth, TH_UNDEFINED); } } } @@ -2316,13 +2314,11 @@ void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (*func)(void *), boo for (base = scene->base.first; base; base = base->next) { if (v3d->lay & base->lay) { - if (func == NULL || func(base)) { - /* dupli drawing */ - if (base->object->transflag & OB_DUPLI) { - draw_dupli_objects_color(scene, ar, v3d, base, dflag_depth, TH_UNDEFINED); - } - draw_object(scene, ar, v3d, base, dflag_depth); + /* dupli drawing */ + if (base->object->transflag & OB_DUPLI) { + draw_dupli_objects_color(scene, ar, v3d, base, dflag_depth, TH_UNDEFINED); } + draw_object(scene, ar, v3d, base, dflag_depth); } } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 6099ef49149..98a0d548096 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -3276,7 +3276,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) /* Get Z Depths, needed for perspective, nice for ortho */ bgl_get_mats(&mats); - draw_depth(scene, ar, v3d, NULL, true); + ED_view3d_draw_depth(scene, ar, v3d, true); { /* avoid allocating the whole depth buffer */ @@ -4511,7 +4511,7 @@ bool ED_view3d_autodist(Scene *scene, ARegion *ar, View3D *v3d, /* Get Z Depths, needed for perspective, nice for ortho */ bgl_get_mats(&mats); - draw_depth(scene, ar, v3d, NULL, alphaoverride); + ED_view3d_draw_depth(scene, ar, v3d, alphaoverride); depth_close = view_autodist_depth_margin(ar, mval, 4); @@ -4543,10 +4543,10 @@ void ED_view3d_autodist_init(Scene *scene, ARegion *ar, View3D *v3d, int mode) /* Get Z Depths, needed for perspective, nice for ortho */ switch (mode) { case 0: - draw_depth(scene, ar, v3d, NULL, true); + ED_view3d_draw_depth(scene, ar, v3d, true); break; case 1: - draw_depth_gpencil(scene, ar, v3d); + ED_view3d_draw_depth_gpencil(scene, ar, v3d); break; } } diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index e19276cf4b4..169bc494e1b 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -177,8 +177,8 @@ void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d, /* view3d_draw.c */ void view3d_main_area_draw(const struct bContext *C, struct ARegion *ar); -void draw_depth(Scene *scene, struct ARegion *ar, View3D *v3d, int (*func)(void *), bool alphaoverride); -void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d); +void ED_view3d_draw_depth(Scene *scene, struct ARegion *ar, View3D *v3d, bool alphaoverride); +void ED_view3d_draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d); void ED_view3d_after_add(ListBase *lb, Base *base, const short dflag); void circf(float x, float y, float rad);