diff options
-rw-r--r-- | source/blender/editors/include/ED_space_api.h | 4 | ||||
-rw-r--r-- | source/blender/editors/space_api/spacetypes.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 13 |
3 files changed, 8 insertions, 19 deletions
diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h index 20b1e2b5499..08d2894ddf7 100644 --- a/source/blender/editors/include/ED_space_api.h +++ b/source/blender/editors/include/ED_space_api.h @@ -61,8 +61,8 @@ void ED_file_exit(void); #define REGION_DRAW_POST 0 void *ED_region_draw_cb_activate(struct ARegionType *, - void (*draw)(const struct bContext *, struct ARegion *), - int type); + void (*draw)(const struct bContext *, struct ARegion *, void *), + void *custumdata, int type); void ED_region_draw_cb_draw(const struct bContext *, struct ARegion *, int); void ED_region_draw_cb_exit(struct ARegionType *, void *); diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 8ed9bb10fd5..a07a1d0ecb3 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -132,20 +132,22 @@ void ED_spacetypes_keymap(wmWindowManager *wm) typedef struct RegionDrawCB { struct RegionDrawCB *next, *prev; - void (*draw)(const struct bContext *, struct ARegion *); + void (*draw)(const struct bContext *, struct ARegion *, void *); + void *customdata; int type; } RegionDrawCB; void *ED_region_draw_cb_activate(ARegionType *art, - void (*draw)(const struct bContext *, struct ARegion *), - int type) + void (*draw)(const struct bContext *, struct ARegion *, void *), + void *customdata, int type) { RegionDrawCB *rdc= MEM_callocN(sizeof(RegionDrawCB), "RegionDrawCB"); BLI_addtail(&art->drawcalls, rdc); rdc->draw= draw; + rdc->customdata= customdata; rdc->type= type; return rdc; @@ -170,7 +172,7 @@ void ED_region_draw_cb_draw(const bContext *C, ARegion *ar, int type) for(rdc= ar->type->drawcalls.first; rdc; rdc= rdc->next) { if(rdc->type==type) - rdc->draw(C, ar); + rdc->draw(C, ar, rdc->customdata); } } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 90bc976f015..b2907cde8e7 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -97,7 +97,6 @@ typedef struct ViewOpsData { int origx, origy, oldx, oldy; int origkey; - void *vh; // XXX temp } ViewOpsData; #define TRACKBALLSIZE (1.1) @@ -364,10 +363,6 @@ static int viewrotate_modal(bContext *C, wmOperator *op, wmEvent *event) default: if(event->type==vod->origkey && event->val==0) { - if(vod->vh) { - ED_region_draw_cb_exit(CTX_wm_region(C)->type, vod->vh); - ED_region_tag_redraw(CTX_wm_region(C)); - } MEM_freeN(vod); op->customdata= NULL; @@ -378,12 +373,6 @@ static int viewrotate_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static void vh_draw(const bContext *C, ARegion *ar) -{ - glColor3ub(100, 200, 100); - glRectf(-0.2, -0.2, 0.2, 0.2); -} - static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event) { ViewOpsData *vod; @@ -392,8 +381,6 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event) viewops_data(C, op, event); vod= op->customdata; - vod->vh= ED_region_draw_cb_activate(CTX_wm_region(C)->type, vh_draw, REGION_DRAW_POST); - /* switch from camera view when: */ if(vod->v3d->persp != V3D_PERSP) { |