diff options
author | Ton Roosendaal <ton@blender.org> | 2008-12-19 17:14:43 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2008-12-19 17:14:43 +0300 |
commit | 62a03ea1b6ef84ac80e40ab092393214c6032b88 (patch) | |
tree | b77ebd05c5cceb6eb6d79db65b73f22780fcdd4a /source/blender/editors | |
parent | 63195b01794e42243b1bcac01de43eccaa89fade (diff) |
2.5
All of the view3d drawing code is now 'Context' free.
The idea is:
- ED_region_do_draw() sets and freezes drawing context
- regiontype draw() callback then can pass on other relevant
context stuff as function args.
Also cleaned up the WM opengl wrappers, to mimic opengl state;
no reason to give window pointer anymore.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/ED_screen.h | 5 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d.c | 14 | ||||
-rw-r--r-- | source/blender/editors/screen/area.c | 14 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawmesh.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 77 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 79 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_intern.h | 13 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 27 |
12 files changed, 119 insertions, 126 deletions
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 7b4dd41e4a8..6eafc07bcda 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -37,6 +37,7 @@ struct wmWindowManager; struct wmWindow; struct wmNotifier; struct wmEvent; +struct bContext; struct SpaceType; struct AreagionType; struct uiBlock; @@ -45,7 +46,7 @@ struct uiBlock; void ED_region_do_listen(ARegion *ar, struct wmNotifier *note); void ED_region_do_draw(struct bContext *C, struct ARegion *ar); void ED_region_exit(struct bContext *C, struct ARegion *ar); -void ED_region_pixelspace(const struct bContext *C, struct ARegion *ar); +void ED_region_pixelspace(struct ARegion *ar); void ED_region_init(struct bContext *C, struct ARegion *ar); void ED_region_tag_redraw(struct ARegion *ar); @@ -53,7 +54,7 @@ void ED_region_tag_redraw(struct ARegion *ar); void ED_spacetypes_init(void); void ED_spacetypes_keymap(struct wmWindowManager *wm); struct ARegionType *ED_regiontype_from_id(struct SpaceType *st, int regionid); -int ED_area_header_standardbuttons(const bContext *C, struct uiBlock *block, int yco); +int ED_area_header_standardbuttons(const struct bContext *C, struct uiBlock *block, int yco); void ED_area_overdraw(struct bContext *C); void ED_area_overdraw_flush(struct bContext *C); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index c60bf374e6d..d5b49fa801d 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -693,7 +693,7 @@ uiMenuBlockHandle *ui_menu_block_create(bContext *C, ARegion *butregion, uiBut * ED_region_init(C, ar); /* get winmat now that we actually have the subwindow */ - wm_subwindow_set(window, ar->swinid); + wmSubWindowSet(window, ar->swinid); wm_subwindow_getmatrix(window, ar->swinid, block->winmat); /* notify change and redraw */ diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index e0e60f67fcb..0d479478f9b 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -637,7 +637,6 @@ static void view2d_map_cur_using_mask(View2D *v2d, rctf *curmasked) /* Set view matrices to use 'cur' rect as viewing frame for View2D drawing */ void UI_view2d_view_ortho(const bContext *C, View2D *v2d) { - wmWindow *window= CTX_wm_window(C); rctf curmasked; float xofs, yofs; @@ -651,10 +650,10 @@ void UI_view2d_view_ortho(const bContext *C, View2D *v2d) view2d_map_cur_using_mask(v2d, &curmasked); /* set matrix on all appropriate axes */ - wmOrtho2(window, curmasked.xmin-xofs, curmasked.xmax-xofs, curmasked.ymin-yofs, curmasked.ymax-yofs); + wmOrtho2(curmasked.xmin-xofs, curmasked.xmax-xofs, curmasked.ymin-yofs, curmasked.ymax-yofs); /* XXX is this necessary? */ - wmLoadIdentity(window); + wmLoadIdentity(); } /* Set view matrices to only use one axis of 'cur' only @@ -662,7 +661,6 @@ void UI_view2d_view_ortho(const bContext *C, View2D *v2d) */ void UI_view2d_view_orthoSpecial(const bContext *C, View2D *v2d, short xaxis) { - wmWindow *window= CTX_wm_window(C); ARegion *ar= CTX_wm_region(C); rctf curmasked; float xofs, yofs; @@ -678,19 +676,19 @@ void UI_view2d_view_orthoSpecial(const bContext *C, View2D *v2d, short xaxis) /* only set matrix with 'cur' coordinates on relevant axes */ if (xaxis) - wmOrtho2(window, curmasked.xmin-xofs, curmasked.xmax-xofs, -yofs, ar->winy-yofs); + wmOrtho2(curmasked.xmin-xofs, curmasked.xmax-xofs, -yofs, ar->winy-yofs); else - wmOrtho2(window, -xofs, ar->winx-xofs, curmasked.ymin-yofs, curmasked.ymax-yofs); + wmOrtho2(-xofs, ar->winx-xofs, curmasked.ymin-yofs, curmasked.ymax-yofs); /* XXX is this necessary? */ - wmLoadIdentity(window); + wmLoadIdentity(); } /* Restore view matrices after drawing */ void UI_view2d_view_restore(const bContext *C) { - ED_region_pixelspace(C, CTX_wm_region(C)); + ED_region_pixelspace(CTX_wm_region(C)); } /* *********************************************************************** */ diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index cec34155610..3f7ca19c1f0 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -92,14 +92,13 @@ static void region_draw_emboss(ARegion *ar) glDisable( GL_BLEND ); } -void ED_region_pixelspace(const bContext *C, ARegion *ar) +void ED_region_pixelspace(ARegion *ar) { - wmWindow *win= CTX_wm_window(C); int width= ar->winrct.xmax-ar->winrct.xmin+1; int height= ar->winrct.ymax-ar->winrct.ymin+1; - wmOrtho2(win, -0.375, (float)width-0.375, -0.375, (float)height-0.375); - wmLoadIdentity(win); + wmOrtho2(-0.375, (float)width-0.375, -0.375, (float)height-0.375); + wmLoadIdentity(); } void ED_region_do_listen(ARegion *ar, wmNotifier *note) @@ -149,7 +148,7 @@ void ED_area_overdraw(bContext *C) ScrArea *sa; /* Draw AZones, in screenspace */ - wm_subwindow_set(win, screen->mainwin); + wmSubWindowSet(win, screen->mainwin); glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); @@ -176,7 +175,8 @@ void ED_region_do_draw(bContext *C, ARegion *ar) ScrArea *sa= CTX_wm_area(C); ARegionType *at= ar->type; - wm_subwindow_set(win, ar->swinid); + /* note; this sets state, so we can use wmOrtho and friends */ + wmSubWindowSet(win, ar->swinid); if(ar->swinid && at->draw) { UI_SetTheme(sa); @@ -201,7 +201,7 @@ void ED_region_do_draw(bContext *C, ARegion *ar) region_draw_emboss(ar); /* XXX test: add convention to end regions always in pixel space, for drawing of borders/gestures etc */ - ED_region_pixelspace(C, ar); + ED_region_pixelspace(ar); ar->do_draw= 0; } diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 6f1b0558851..cef98a7e901 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -934,7 +934,7 @@ void ED_screen_draw(wmWindow *win) int dir = -1; int dira = -1; - wm_subwindow_set(win, win->screen->mainwin); + wmSubWindowSet(win, win->screen->mainwin); for(sa= win->screen->areabase.first; sa; sa= sa->next) { if (sa->flag & AREA_FLAG_DRAWJOINFROM) sa1 = sa; diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 01740d2b3b4..a0a76bb6d15 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -51,7 +51,6 @@ #include "DNA_userdef_types.h" #include "BKE_bmfont.h" -#include "BKE_context.h" #include "BKE_displist.h" #include "BKE_DerivedMesh.h" #include "BKE_effect.h" diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index f5a2cd9df00..4c621c6ec63 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -73,7 +73,6 @@ #include "BLI_rand.h" #include "BKE_anim.h" //for the where_on_path function -#include "BKE_context.h" #include "BKE_curve.h" #include "BKE_constraint.h" // for the get_constraint_target function #include "BKE_DerivedMesh.h" @@ -662,7 +661,7 @@ static void spotvolume(float *lvec, float *vvec, float inp) return; } -static void drawlamp(const bContext *C, Scene *scene, View3D *v3d, Object *ob) +static void drawlamp(Scene *scene, View3D *v3d, Object *ob) { Lamp *la; float vec[3], lvec[3], vvec[3], circrad, x,y,z; @@ -677,7 +676,7 @@ static void drawlamp(const bContext *C, Scene *scene, View3D *v3d, Object *ob) /* we first draw only the screen aligned & fixed scale stuff */ glPushMatrix(); - wmLoadMatrix(CTX_wm_window(C), v3d->viewmat); + wmLoadMatrix(v3d->viewmat); /* lets calculate the scale: */ pixsize= v3d->persmat[0][3]*ob->obmat[3][0]+ v3d->persmat[1][3]*ob->obmat[3][1]+ v3d->persmat[2][3]*ob->obmat[3][2]+ v3d->persmat[3][3]; @@ -888,7 +887,7 @@ static void drawlamp(const bContext *C, Scene *scene, View3D *v3d, Object *ob) } /* and back to viewspace */ - wmLoadMatrix(CTX_wm_window(C), v3d->viewmat); + wmLoadMatrix(v3d->viewmat); VECCOPY(vec, ob->obmat[3]); setlinestyle(0); @@ -954,7 +953,7 @@ static void draw_focus_cross(float dist, float size) } /* flag similar to draw_object() */ -static void drawcamera(const bContext *C, Scene *scene, View3D *v3d, Object *ob, int flag) +static void drawcamera(Scene *scene, View3D *v3d, Object *ob, int flag) { /* a standing up pyramid with (0,0,0) as top */ Camera *cam; @@ -1039,13 +1038,13 @@ static void drawcamera(const bContext *C, Scene *scene, View3D *v3d, Object *ob, if(flag==0) { if(cam->flag & (CAM_SHOWLIMITS+CAM_SHOWMIST)) { - wmLoadMatrix(CTX_wm_window(C), v3d->viewmat); + wmLoadMatrix(v3d->viewmat); Mat4CpyMat4(vec, ob->obmat); Mat4Ortho(vec); - wmMultMatrix(CTX_wm_window(C), vec); + wmMultMatrix(vec); MTC_Mat4SwapMat4(v3d->persmat, tmat); - wmGetSingleMatrix(CTX_wm_window(C), v3d->persmat); + wmGetSingleMatrix(v3d->persmat); if(cam->flag & CAM_SHOWLIMITS) { draw_limit_line(cam->clipsta, cam->clipend, 0x77FFFF); @@ -2827,7 +2826,7 @@ static int drawDispList(Scene *scene, View3D *v3d, Base *base, int dt) /* 5. start filling the arrays */ /* 6. draw the arrays */ /* 7. clean up */ -static void draw_new_particle_system(const bContext *C, View3D *v3d, Base *base, ParticleSystem *psys, int dt) +static void draw_new_particle_system(View3D *v3d, Base *base, ParticleSystem *psys, int dt) { Object *ob=base->object; ParticleSystemModifierData *psmd; @@ -2915,12 +2914,12 @@ static void draw_new_particle_system(const bContext *C, View3D *v3d, Base *base, timestep= psys_get_timestep(part); - wmLoadMatrix(CTX_wm_window(C), v3d->viewmat); + wmLoadMatrix(v3d->viewmat); if( (base->flag & OB_FROMDUPLI) && (ob->flag & OB_FROMGROUP) ) { float mat[4][4]; Mat4MulMat4(mat, psys->imat, ob->obmat); - wmMultMatrix(CTX_wm_window(C), mat); + wmMultMatrix(mat); } totpart=psys->totpart; @@ -3498,11 +3497,11 @@ static void draw_new_particle_system(const bContext *C, View3D *v3d, Base *base, psys->lattice=0; } - wmLoadMatrix(CTX_wm_window(C), v3d->viewmat); - wmMultMatrix(CTX_wm_window(C), ob->obmat); // bring back local matrix for dtx + wmLoadMatrix(v3d->viewmat); + wmMultMatrix(ob->obmat); // bring back local matrix for dtx } -static void draw_particle_edit(const bContext *C, Scene *scene, View3D *v3d, Object *ob, ParticleSystem *psys, int dt) +static void draw_particle_edit(Scene *scene, View3D *v3d, Object *ob, ParticleSystem *psys, int dt) { ParticleEdit *edit = psys->edit; ParticleData *pa; @@ -3534,7 +3533,7 @@ static void draw_particle_edit(const bContext *C, Scene *scene, View3D *v3d, Obj if((v3d->flag & V3D_ZBUF_SELECT)==0) glDisable(GL_DEPTH_TEST); - wmLoadMatrix(CTX_wm_window(C), v3d->viewmat); + wmLoadMatrix(v3d->viewmat); /* get selection theme colors */ UI_GetThemeColor3ubv(TH_VERTEX_SELECT, sel); @@ -3684,7 +3683,7 @@ static void draw_particle_edit(const bContext *C, Scene *scene, View3D *v3d, Obj glEnable(GL_DEPTH_TEST); glLineWidth(1.0f); - wmMultMatrix(CTX_wm_window(C), ob->obmat); // bring back local matrix for dtx + wmMultMatrix(ob->obmat); // bring back local matrix for dtx glPointSize(1.0); } @@ -4164,7 +4163,7 @@ static void drawcone(float *vec, float radius, float height, float tmat[][4]) glEnd(); } /* return 1 if nothing was drawn */ -static int drawmball(const bContext *C, Scene *scene, View3D *v3d, Base *base, int dt) +static int drawmball(Scene *scene, View3D *v3d, Base *base, int dt) { Object *ob= base->object; MetaBall *mb; @@ -4194,7 +4193,7 @@ static int drawmball(const bContext *C, Scene *scene, View3D *v3d, Base *base, i } else UI_ThemeColor(TH_WIRE); - wmGetMatrix(CTX_wm_window(C), tmat); + wmGetMatrix(tmat); Mat4Invert(imat, tmat); Normalize(imat[0]); Normalize(imat[1]); @@ -4230,7 +4229,7 @@ static int drawmball(const bContext *C, Scene *scene, View3D *v3d, Base *base, i return 0; } -static void draw_forcefield(const bContext *C, Scene *scene, Object *ob) +static void draw_forcefield(Scene *scene, Object *ob) { PartDeflect *pd= ob->pd; float imat[4][4], tmat[4][4]; @@ -4252,7 +4251,7 @@ static void draw_forcefield(const bContext *C, Scene *scene, Object *ob) else size = 1.0; /* calculus here, is reused in PFIELD_FORCE */ - wmGetMatrix(CTX_wm_window(C), tmat); + wmGetMatrix(tmat); Mat4Invert(imat, tmat); // Normalize(imat[0]); // we don't do this because field doesnt scale either... apart from wind! // Normalize(imat[1]); @@ -4687,7 +4686,7 @@ void drawRBpivot(bRigidBodyJointConstraint *data) } /* flag can be DRAW_PICKING and/or DRAW_CONSTCOLOR, DRAW_SCENESET */ -void draw_object(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) +void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) { static int warning_recursive= 0; Object *ob; @@ -4756,7 +4755,7 @@ void draw_object(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, Base base->flag= 0; where_is_object_time(ob, (scene->r.cfra)); - draw_object(C, scene, ar, v3d, base, 0); + draw_object(scene, ar, v3d, base, 0); } ce= ce->next; } @@ -4770,7 +4769,7 @@ void draw_object(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, Base base->flag= SELECT; where_is_object_time(ob, (scene->r.cfra)); - draw_object(C, scene, ar, v3d, base, 0); + draw_object(scene, ar, v3d, base, 0); } ce= ce->next; } @@ -4798,7 +4797,7 @@ void draw_object(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, Base /* patch? children objects with a timeoffs change the parents. How to solve! */ /* if( ((int)ob->ctime) != F_(scene->r.cfra)) where_is_object(ob); */ - wmMultMatrix(CTX_wm_window(C), ob->obmat); + wmMultMatrix(ob->obmat); /* which wire color */ if((flag & DRAW_CONSTCOLOR) == 0) { @@ -5015,21 +5014,21 @@ void draw_object(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, Base break; case OB_MBALL: if(ob==G.obedit) - drawmball(C, scene, v3d, base, dt); + drawmball(scene, v3d, base, dt); else if(dt==OB_BOUNDBOX) draw_bounding_volume(ob); else - empty_object= drawmball(C, scene, v3d, base, dt); + empty_object= drawmball(scene, v3d, base, dt); break; case OB_EMPTY: drawaxes(ob->empty_drawsize, flag, ob->empty_drawtype); break; case OB_LAMP: - drawlamp(C, scene, v3d, ob); - if(dtx || (base->flag & SELECT)) wmMultMatrix(CTX_wm_window(C), ob->obmat); + drawlamp(scene, v3d, ob); + if(dtx || (base->flag & SELECT)) wmMultMatrix(ob->obmat); break; case OB_CAMERA: - drawcamera(C, scene, v3d, ob, flag); + drawcamera(scene, v3d, ob, flag); break; case OB_LATTICE: drawlattice(v3d, ob); @@ -5042,7 +5041,7 @@ void draw_object(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, Base default: drawaxes(1.0, flag, OB_ARROWS); } - if(ob->pd && ob->pd->forcefield) draw_forcefield(C, scene, ob); + if(ob->pd && ob->pd->forcefield) draw_forcefield(scene, ob); /* code for new particle system */ if( (warning_recursive==0) && @@ -5055,12 +5054,12 @@ void draw_object(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, Base glDepthMask(GL_FALSE); for(psys=ob->particlesystem.first; psys; psys=psys->next) - draw_new_particle_system(C, v3d, base, psys, dt); + draw_new_particle_system(v3d, base, psys, dt); if(G.f & G_PARTICLEEDIT && ob==OBACT) { psys= NULL; // XXX PE_get_current(ob); if(psys && !G.obedit && psys_in_edit_mode(psys)) - draw_particle_edit(C, scene, v3d, ob, psys, dt); + draw_particle_edit(scene, v3d, ob, psys, dt); } glDepthMask(GL_TRUE); if(col) cpack(col); @@ -5108,7 +5107,7 @@ void draw_object(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, Base float tmat[4][4], imat[4][4], vec[3]; vec[0]= vec[1]= vec[2]= 0.0; - wmGetMatrix(CTX_wm_window(C), tmat); + wmGetMatrix(tmat); Mat4Invert(imat, tmat); setlinestyle(2); @@ -5117,7 +5116,7 @@ void draw_object(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, Base } } - wmLoadMatrix(CTX_wm_window(C), v3d->viewmat); + wmLoadMatrix(v3d->viewmat); if(zbufoff) glDisable(GL_DEPTH_TEST); @@ -5215,7 +5214,7 @@ void draw_object(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, Base free_old_images(); } -void draw_object_ext(const bContext *C, ARegion *ar, View3D *v3d, Scene *scene, Base *base) +void draw_object_ext(ARegion *ar, View3D *v3d, Scene *scene, Base *base) { if(v3d==NULL || base==NULL) return; @@ -5233,7 +5232,7 @@ void draw_object_ext(const bContext *C, ARegion *ar, View3D *v3d, Scene *scene, if(v3d->flag & V3D_CLIPPING) view3d_set_clipping(v3d); - draw_object(C, scene, ar, v3d, base, 0); + draw_object(scene, ar, v3d, base, 0); if(v3d->flag & V3D_CLIPPING) view3d_clr_clipping(); @@ -5362,10 +5361,10 @@ static void bbs_mesh_solid(Object *ob) dm->release(dm); } -void draw_object_backbufsel(const bContext *C, Scene *scene, View3D *v3d, Object *ob) +void draw_object_backbufsel(Scene *scene, View3D *v3d, Object *ob) { - wmMultMatrix(CTX_wm_window(C), ob->obmat); + wmMultMatrix(ob->obmat); glClearDepth(1.0); glClear(GL_DEPTH_BUFFER_BIT); glEnable(GL_DEPTH_TEST); @@ -5403,7 +5402,7 @@ void draw_object_backbufsel(const bContext *C, Scene *scene, View3D *v3d, Object break; } - wmLoadMatrix(CTX_wm_window(C), v3d->viewmat); + wmLoadMatrix(v3d->viewmat); } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 218c55edd53..b279e888bea 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -192,7 +192,7 @@ static void view3d_main_area_draw(const bContext *C, ARegion *ar) ScrArea *sa= CTX_wm_area(C); View3D *v3d= sa->spacedata.first; /* XXX get from region */ - drawview3dspace(C, ar, v3d); + drawview3dspace(CTX_data_scene(C), ar, v3d); } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index d03681d6a59..a4134aac449 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -50,7 +50,6 @@ #include "BLI_rand.h" #include "BKE_anim.h" -#include "BKE_context.h" #include "BKE_image.h" #include "BKE_ipo.h" #include "BKE_key.h" @@ -1170,7 +1169,7 @@ void add_view3d_after(View3D *v3d, Base *base, int type, int flag) } /* clears zbuffer and draws it over */ -static void view3d_draw_xray(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, int clear) +static void view3d_draw_xray(Scene *scene, ARegion *ar, View3D *v3d, int clear) { View3DAfter *v3da, *next; int doit= 0; @@ -1185,7 +1184,7 @@ static void view3d_draw_xray(const bContext *C, Scene *scene, ARegion *ar, View3 for(v3da= v3d->afterdraw.first; v3da; v3da= next) { next= v3da->next; if(v3da->type==V3D_XRAY) { - draw_object(C, scene, ar, v3d, v3da->base, v3da->flag); + draw_object(scene, ar, v3d, v3da->base, v3da->flag); BLI_remlink(&v3d->afterdraw, v3da); MEM_freeN(v3da); } @@ -1195,7 +1194,7 @@ static void view3d_draw_xray(const bContext *C, Scene *scene, ARegion *ar, View3 } /* disables write in zbuffer and draws it over */ -static void view3d_draw_transp(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d) +static void view3d_draw_transp(Scene *scene, ARegion *ar, View3D *v3d) { View3DAfter *v3da, *next; @@ -1205,7 +1204,7 @@ static void view3d_draw_transp(const bContext *C, Scene *scene, ARegion *ar, Vie for(v3da= v3d->afterdraw.first; v3da; v3da= next) { next= v3da->next; if(v3da->type==V3D_TRANSP) { - draw_object(C, scene, ar, v3d, v3da->base, v3da->flag); + draw_object(scene, ar, v3d, v3da->base, v3da->flag); BLI_remlink(&v3d->afterdraw, v3da); MEM_freeN(v3da); } @@ -1223,7 +1222,7 @@ static void view3d_draw_transp(const bContext *C, Scene *scene, ARegion *ar, Vie draw_dupli_objects_color was added because when drawing set dupli's we need to force the color */ -static void draw_dupli_objects_color(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, Base *base, int color) +static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int color) { ListBase *lb; DupliObject *dob; @@ -1276,7 +1275,7 @@ static void draw_dupli_objects_color(const bContext *C, Scene *scene, ARegion *a displist= glGenLists(1); glNewList(displist, GL_COMPILE); - draw_object(C, scene, ar, v3d, &tbase, DRAW_CONSTCOLOR); + draw_object(scene, ar, v3d, &tbase, DRAW_CONSTCOLOR); glEndList(); use_displist= 1; @@ -1284,14 +1283,14 @@ static void draw_dupli_objects_color(const bContext *C, Scene *scene, ARegion *a } } if(use_displist) { - wmMultMatrix(CTX_wm_window(C), dob->mat); + wmMultMatrix(dob->mat); if(boundbox_clip(v3d, dob->mat, bb)) glCallList(displist); - wmLoadMatrix(CTX_wm_window(C), v3d->viewmat); + wmLoadMatrix(v3d->viewmat); } else { Mat4CpyMat4(dob->ob->obmat, dob->mat); - draw_object(C, scene, ar, v3d, &tbase, DRAW_CONSTCOLOR); + draw_object(scene, ar, v3d, &tbase, DRAW_CONSTCOLOR); } tbase.object->dt= dt; @@ -1308,7 +1307,7 @@ static void draw_dupli_objects_color(const bContext *C, Scene *scene, ARegion *a glDeleteLists(displist, 1); } -static void draw_dupli_objects(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, Base *base) +static void draw_dupli_objects(Scene *scene, ARegion *ar, View3D *v3d, Base *base) { /* define the color here so draw_dupli_objects_color can be called * from the set loop */ @@ -1318,7 +1317,7 @@ static void draw_dupli_objects(const bContext *C, Scene *scene, ARegion *ar, Vie if(base->object->dup_group && base->object->dup_group->id.us<1) color= TH_REDALERT; - draw_dupli_objects_color(C, scene, ar, v3d, base, color); + draw_dupli_objects_color(scene, ar, v3d, base, color); } @@ -1351,7 +1350,7 @@ void view3d_update_depths(ARegion *ar, View3D *v3d) } /* Enable sculpting in wireframe mode by drawing sculpt object only to the depth buffer */ -static void draw_sculpt_depths(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d) +static void draw_sculpt_depths(Scene *scene, ARegion *ar, View3D *v3d) { Object *ob = OBACT; @@ -1370,7 +1369,7 @@ static void draw_sculpt_depths(const bContext *C, Scene *scene, ARegion *ar, Vie glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); glEnable(GL_DEPTH_TEST); - draw_object(C, scene, ar, v3d, BASACT, 0); + draw_object(scene, ar, v3d, BASACT, 0); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); if(!depth_on) glDisable(GL_DEPTH_TEST); @@ -1381,7 +1380,7 @@ static void draw_sculpt_depths(const bContext *C, Scene *scene, ARegion *ar, Vie } } -void draw_depth(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, int (* func)(void *)) +void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (* func)(void *)) { Base *base; Scene *sce; @@ -1397,7 +1396,7 @@ void draw_depth(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, int ( U.glalphaclip = 0.5; /* not that nice but means we wont zoom into billboards */ v3d->flag &= ~V3D_SELECT_OUTLINE; - setwinmatrixview3d(CTX_wm_window(C), v3d, ar->winx, ar->winy, NULL); /* 0= no pick rect */ + setwinmatrixview3d(v3d, ar->winx, ar->winy, NULL); /* 0= no pick rect */ setviewmatrixview3d(v3d); /* note: calls where_is_object for camera... */ Mat4MulMat4(v3d->persmat, v3d->viewmat, v3d->winmat); @@ -1406,7 +1405,7 @@ void draw_depth(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, int ( glClear(GL_DEPTH_BUFFER_BIT); - wmLoadMatrix(CTX_wm_window(C), v3d->viewmat); + wmLoadMatrix(v3d->viewmat); // persp(PERSP_STORE); // store correct view for persp(PERSP_VIEW) calls if(v3d->flag & V3D_CLIPPING) { @@ -1421,9 +1420,9 @@ void draw_depth(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, int ( for(SETLOOPER(scene->set, base)) { if(v3d->lay & base->lay) { if (func == NULL || func(base)) { - draw_object(C, scene, ar, v3d, base, 0); + draw_object(scene, ar, v3d, base, 0); if(base->object->transflag & OB_DUPLI) { - draw_dupli_objects_color(C, scene, ar, v3d, base, TH_WIRE); + draw_dupli_objects_color(scene, ar, v3d, base, TH_WIRE); } } } @@ -1435,9 +1434,9 @@ void draw_depth(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, int ( if (func == NULL || func(base)) { /* dupli drawing */ if(base->object->transflag & OB_DUPLI) { - draw_dupli_objects(C, scene, ar, v3d, base); + draw_dupli_objects(scene, ar, v3d, base); } - draw_object(C, scene, ar, v3d, base, 0); + draw_object(scene, ar, v3d, base, 0); } } } @@ -1452,7 +1451,7 @@ void draw_depth(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, int ( for(v3da= v3d->afterdraw.first; v3da; v3da= next) { next= v3da->next; if(v3da->type==V3D_XRAY) { - draw_object(C, scene, ar, v3d, v3da->base, 0); + draw_object(scene, ar, v3d, v3da->base, 0); num++; } /* dont remove this time */ @@ -1468,7 +1467,7 @@ void draw_depth(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, int ( v3d->xray= FALSE; v3d->transp= TRUE; } - draw_object(C, scene, ar, v3d, v3da->base, 0); /* Draw Xray or Transp objects normally */ + draw_object(scene, ar, v3d, v3da->base, 0); /* Draw Xray or Transp objects normally */ BLI_remlink(&v3d->afterdraw, v3da); MEM_freeN(v3da); } @@ -1561,11 +1560,11 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d) } -void drawview3dspace(const bContext *C, ARegion *ar, View3D *v3d) +void drawview3dspace(Scene *scene, ARegion *ar, View3D *v3d) { + Scene *sce; Base *base; Object *ob; - Scene *scene= CTX_data_scene(C), *sce; char retopo= 0, sculptparticle= 0; Object *obact = OBACT; @@ -1587,7 +1586,7 @@ void drawview3dspace(const bContext *C, ARegion *ar, View3D *v3d) if(draw_glsl_material(scene, NULL, v3d, v3d->drawtype)) gpu_update_lamps_shadows(scene, v3d); - setwinmatrixview3d(CTX_wm_window(C), v3d, ar->winx, ar->winy, NULL); /* 0= no pick rect */ + setwinmatrixview3d(v3d, ar->winx, ar->winy, NULL); /* 0= no pick rect */ setviewmatrixview3d(v3d); /* note: calls where_is_object for camera... */ Mat4MulMat4(v3d->persmat, v3d->viewmat, v3d->winmat); @@ -1625,7 +1624,7 @@ void drawview3dspace(const bContext *C, ARegion *ar, View3D *v3d) glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); } - wmLoadMatrix(CTX_wm_window(C), v3d->viewmat); + wmLoadMatrix(v3d->viewmat); if(v3d->flag & V3D_CLIPPING) view3d_draw_clipping(v3d); @@ -1652,13 +1651,13 @@ void drawview3dspace(const bContext *C, ARegion *ar, View3D *v3d) } } else { - ED_region_pixelspace(C, ar); + ED_region_pixelspace(ar); drawgrid(ar, v3d); /* XXX make function? replaces persp(1) */ glMatrixMode(GL_PROJECTION); - wmLoadMatrix(CTX_wm_window(C), v3d->winmat); + wmLoadMatrix(v3d->winmat); glMatrixMode(GL_MODELVIEW); - wmLoadMatrix(CTX_wm_window(C), v3d->viewmat); + wmLoadMatrix(v3d->viewmat); if(v3d->flag & V3D_DISPBGPIC) { draw_bgpic(scene, ar, v3d); @@ -1675,10 +1674,10 @@ void drawview3dspace(const bContext *C, ARegion *ar, View3D *v3d) if(v3d->lay & base->lay) { UI_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f); - draw_object(C, scene, ar, v3d, base, DRAW_CONSTCOLOR|DRAW_SCENESET); + draw_object(scene, ar, v3d, base, DRAW_CONSTCOLOR|DRAW_SCENESET); if(base->object->transflag & OB_DUPLI) { - draw_dupli_objects_color(C, scene, ar, v3d, base, TH_WIRE); + draw_dupli_objects_color(scene, ar, v3d, base, TH_WIRE); } } } @@ -1692,11 +1691,11 @@ void drawview3dspace(const bContext *C, ARegion *ar, View3D *v3d) /* dupli drawing */ if(base->object->transflag & OB_DUPLI) { - draw_dupli_objects(C, scene, ar, v3d, base); + draw_dupli_objects(scene, ar, v3d, base); } if((base->flag & SELECT)==0) { if(base->object!=G.obedit) - draw_object(C, scene, ar, v3d, base, 0); + draw_object(scene, ar, v3d, base, 0); } } } @@ -1710,13 +1709,13 @@ void drawview3dspace(const bContext *C, ARegion *ar, View3D *v3d) for(base= scene->base.first; base; base= base->next) { if(v3d->lay & base->lay) { if (base->object==G.obedit || ( base->flag & SELECT) ) - draw_object(C, scene, ar, v3d, base, 0); + draw_object(scene, ar, v3d, base, 0); } } if(!retopo && sculptparticle && !(obact && (obact->dtx & OB_DRAWXRAY))) { if(G.f & G_SCULPTMODE) - draw_sculpt_depths(C, scene, ar, v3d); + draw_sculpt_depths(scene, ar, v3d); view3d_update_depths(ar, v3d); } @@ -1732,12 +1731,12 @@ void drawview3dspace(const bContext *C, ARegion *ar, View3D *v3d) // if(scene->radio) RAD_drawall(v3d->drawtype>=OB_SOLID); /* Transp and X-ray afterdraw stuff */ - view3d_draw_transp(C, scene, ar, v3d); - view3d_draw_xray(C, scene, ar, v3d, 1); // clears zbuffer if it is used! + view3d_draw_transp(scene, ar, v3d); + view3d_draw_xray(scene, ar, v3d, 1); // clears zbuffer if it is used! if(!retopo && sculptparticle && (obact && (OBACT->dtx & OB_DRAWXRAY))) { if(G.f & G_SCULPTMODE) - draw_sculpt_depths(C, scene, ar, v3d); + draw_sculpt_depths(scene, ar, v3d); view3d_update_depths(ar, v3d); } @@ -1755,7 +1754,7 @@ void drawview3dspace(const bContext *C, ARegion *ar, View3D *v3d) // if (v3d->flag2 & V3D_DISPGP) // draw_gpencil_3dview(ar, 1); - ED_region_pixelspace(C, ar); + ED_region_pixelspace(ar); /* Draw Sculpt Mode brush XXX (removed) */ diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 77c3476c8cf..aa2f58ba4a2 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -49,7 +49,6 @@ #include "BLI_rand.h" #include "BKE_action.h" -#include "BKE_context.h" #include "BKE_object.h" #include "BKE_global.h" #include "BKE_scene.h" @@ -335,7 +334,7 @@ void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int mode) } /* Zooms in on a border drawn by the user */ -static int view_autodist(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, short *mval, float mouse_worldloc[3] ) //, float *autodist ) +static int view_autodist(Scene *scene, ARegion *ar, View3D *v3d, short *mval, float mouse_worldloc[3] ) //, float *autodist ) { rcti rect; /* ZBuffer depth vars */ @@ -357,7 +356,7 @@ static int view_autodist(const bContext *C, Scene *scene, ARegion *ar, View3D *v /* Get Z Depths, needed for perspective, nice for ortho */ bgl_get_mats(&mats); - draw_depth(C, scene, ar, v3d, NULL); + draw_depth(scene, ar, v3d, NULL); /* force updating */ if (v3d->depths) { @@ -453,7 +452,7 @@ static void view_zoom_mouseloc(ARegion *ar, View3D *v3d, float dfac, short *mous #define COS45 0.70710678118654746 #define SIN45 COS45 -void viewmove(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, int mode) +void viewmove(Scene *scene, ARegion *ar, View3D *v3d, int mode) { static float lastofs[3] = {0,0,0}; Object *ob = OBACT; @@ -524,7 +523,7 @@ void viewmove(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, int mod VecMulf(obofs, -1.0f); } else if (U.uiflag & USER_ORBIT_ZBUF) { - if ((use_sel= view_autodist(C, scene, ar, v3d, mval, obofs))) { + if ((use_sel= view_autodist(scene, ar, v3d, mval, obofs))) { if (v3d->persp==V3D_PERSP) { float my_origin[3]; /* original v3d->ofs */ float my_pivot[3]; /* view */ diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 331b5553869..6c0a978f088 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -30,7 +30,6 @@ /* internal exports only */ -struct wmWindow; struct BoundBox; struct Object; struct DerivedMesh; @@ -55,18 +54,18 @@ typedef struct ViewDepths { #define IS_CLIPPED 12000 /* view3d_header.c */ -void view3d_header_buttons(const bContext *C, ARegion *ar); +void view3d_header_buttons(const struct bContext *C, ARegion *ar); /* drawobject.c */ -void draw_object(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag); +void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag); int draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, int dt); /* drawmesh.c */ void draw_mesh_textured(Scene *scene, View3D *v3d, Object *ob, struct DerivedMesh *dm, int faceselect); /* view3d_draw.c */ -void drawview3dspace(const bContext *C, ARegion *ar, View3D *v3d); -void draw_depth(const bContext *C, Scene *scene, ARegion *ar, View3D *v3d, int (* func)(void *)); +void drawview3dspace(Scene *scene, ARegion *ar, View3D *v3d); +void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (* func)(void *)); int view3d_test_clipping(View3D *v3d, float *vec); void view3d_clr_clipping(void); void view3d_set_clipping(View3D *v3d); @@ -103,7 +102,7 @@ int get_view3d_viewplane(View3D *v3d, int winxi, int winyi, rctf *viewplane, flo void view_settings_from_ob(Object *ob, float *ofs, float *quat, float *dist, float *lens); void obmat_to_viewmat(View3D *v3d, Object *ob, short smooth); -short view3d_opengl_select(bContext *C, Scene *scene, ARegion *ar, View3D *v3d, unsigned int *buffer, unsigned int bufsize, rcti *input); +short view3d_opengl_select(Scene *scene, ARegion *ar, View3D *v3d, unsigned int *buffer, unsigned int bufsize, rcti *input); void initlocalview(Scene *scene, ARegion *ar, View3D *v3d); void restore_localviewdata(View3D *vd); void endlocalview(Scene *scene, ScrArea *sa); @@ -116,7 +115,7 @@ void view3d_align_axis_to_vector(View3D *v3d, int axisidx, float vec[3]); void smooth_view(View3D *v3d, float *ofs, float *quat, float *dist, float *lens); void smooth_view_to_camera(View3D *v3d); -void setwinmatrixview3d(struct wmWindow *win, View3D *v3d, int winx, int winy, rctf *rect); /* rect: for picking */ +void setwinmatrixview3d(View3D *v3d, int winx, int winy, rctf *rect); /* rect: for picking */ void setviewmatrixview3d(View3D *v3d); #endif /* ED_VIEW3D_INTERN_H */ diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index a7d8360157d..f7a1206c164 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -51,7 +51,6 @@ #include "BKE_anim.h" #include "BKE_action.h" -#include "BKE_context.h" #include "BKE_object.h" #include "BKE_global.h" #include "BKE_main.h" @@ -536,7 +535,7 @@ int get_view3d_viewplane(View3D *v3d, int winxi, int winyi, rctf *viewplane, flo /* important to not set windows active in here, can be renderwin for example */ -void setwinmatrixview3d(wmWindow *win, View3D *v3d, int winx, int winy, rctf *rect) /* rect: for picking */ +void setwinmatrixview3d(View3D *v3d, int winx, int winy, rctf *rect) /* rect: for picking */ { rctf viewplane; float clipsta, clipend, x1, y1, x2, y2; @@ -559,18 +558,18 @@ void setwinmatrixview3d(wmWindow *win, View3D *v3d, int winx, int winy, rctf *re rect->ymax/= (float)winy; rect->ymax= y1+rect->ymax*(y2-y1); - if(orth) wmOrtho(win, rect->xmin, rect->xmax, rect->ymin, rect->ymax, -clipend, clipend); - else wmFrustum(win, rect->xmin, rect->xmax, rect->ymin, rect->ymax, clipsta, clipend); + if(orth) wmOrtho(rect->xmin, rect->xmax, rect->ymin, rect->ymax, -clipend, clipend); + else wmFrustum(rect->xmin, rect->xmax, rect->ymin, rect->ymax, clipsta, clipend); } else { - if(orth) wmOrtho(win, x1, x2, y1, y2, clipsta, clipend); - else wmFrustum(win, x1, x2, y1, y2, clipsta, clipend); + if(orth) wmOrtho(x1, x2, y1, y2, clipsta, clipend); + else wmFrustum(x1, x2, y1, y2, clipsta, clipend); } /* not sure what this was for? (ton) */ glMatrixMode(GL_PROJECTION); - wmGetMatrix(win, v3d->winmat); + wmGetMatrix(v3d->winmat); glMatrixMode(GL_MODELVIEW); } @@ -751,7 +750,7 @@ void setcameratoview3d(View3D *v3d) * This is an error, "Too many objects in select buffer" * and no action should be taken (can crash blender) if this happens */ -short view3d_opengl_select(bContext *C, Scene *scene, ARegion *ar, View3D *v3d, unsigned int *buffer, unsigned int bufsize, rcti *input) +short view3d_opengl_select(Scene *scene, ARegion *ar, View3D *v3d, unsigned int *buffer, unsigned int bufsize, rcti *input) { rctf rect; short code, hits; @@ -773,7 +772,7 @@ short view3d_opengl_select(bContext *C, Scene *scene, ARegion *ar, View3D *v3d, } /* get rid of overlay button matrix XXX ?*/ - setwinmatrixview3d(CTX_wm_window(C), v3d, ar->winx, ar->winy, &rect); + setwinmatrixview3d(v3d, ar->winx, ar->winy, &rect); Mat4MulMat4(v3d->persmat, v3d->viewmat, v3d->winmat); if(v3d->drawtype > OB_WIRE) { @@ -791,10 +790,10 @@ short view3d_opengl_select(bContext *C, Scene *scene, ARegion *ar, View3D *v3d, code= 1; if(G.obedit && G.obedit->type==OB_MBALL) { - draw_object(C, scene, ar, v3d, BASACT, DRAW_PICKING|DRAW_CONSTCOLOR); + draw_object(scene, ar, v3d, BASACT, DRAW_PICKING|DRAW_CONSTCOLOR); } else if ((G.obedit && G.obedit->type==OB_ARMATURE)) { - draw_object(C, scene, ar, v3d, BASACT, DRAW_PICKING|DRAW_CONSTCOLOR); + draw_object(scene, ar, v3d, BASACT, DRAW_PICKING|DRAW_CONSTCOLOR); } else { Base *base; @@ -808,7 +807,7 @@ short view3d_opengl_select(bContext *C, Scene *scene, ARegion *ar, View3D *v3d, else { base->selcol= code; glLoadName(code); - draw_object(C, scene, ar, v3d, base, DRAW_PICKING|DRAW_CONSTCOLOR); + draw_object(scene, ar, v3d, base, DRAW_PICKING|DRAW_CONSTCOLOR); /* we draw group-duplicators for selection too */ if((base->object->transflag & OB_DUPLI) && base->object->dup_group) { @@ -823,7 +822,7 @@ short view3d_opengl_select(bContext *C, Scene *scene, ARegion *ar, View3D *v3d, tbase.object= dob->ob; Mat4CpyMat4(dob->ob->obmat, dob->mat); - draw_object(C, scene, ar, v3d, &tbase, DRAW_PICKING|DRAW_CONSTCOLOR); + draw_object(scene, ar, v3d, &tbase, DRAW_PICKING|DRAW_CONSTCOLOR); Mat4CpyMat4(dob->ob->obmat, dob->omat); } @@ -840,7 +839,7 @@ short view3d_opengl_select(bContext *C, Scene *scene, ARegion *ar, View3D *v3d, hits= glRenderMode(GL_RENDER); G.f &= ~G_PICKSEL; - setwinmatrixview3d(CTX_wm_window(C), v3d, ar->winx, ar->winy, NULL); + setwinmatrixview3d(v3d, ar->winx, ar->winy, NULL); Mat4MulMat4(v3d->persmat, v3d->viewmat, v3d->winmat); if(v3d->drawtype > OB_WIRE) { |