diff options
author | Ton Roosendaal <ton@blender.org> | 2005-07-13 23:42:08 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-07-13 23:42:08 +0400 |
commit | 75ae1ae5ef0d3bb37cd3a5c70699955cb207dcde (patch) | |
tree | dddd08d35bafcd07be90d330dbd72859e9b3df45 /source | |
parent | 64af8d0ced696fd1ab3dbb452e1dda2a43843f6f (diff) |
Armature "XRay mode" now draws nicely with solid too. For it to work, I
had to add a new feature to the 3d window, to collect "after draw" objects,
which get drawn as last, after a clear of the zbuffer.
Same method can be used for nice OpenGL transparent draw, the system is
ready for it, do that later.
The huge commit is caused by cleaning up globals from struct Global. Many
variables were unused or just not needed anymore. Did that to move the ugly
G.zbuf to where it belongs, in the View3D space struct. :)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_global.h | 26 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 2 | ||||
-rw-r--r-- | source/blender/include/BSE_drawview.h | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_view3d_types.h | 20 | ||||
-rw-r--r-- | source/blender/radiosity/extern/include/radio.h | 2 | ||||
-rw-r--r-- | source/blender/radiosity/intern/source/raddisplay.c | 50 | ||||
-rw-r--r-- | source/blender/src/drawarmature.c | 19 | ||||
-rw-r--r-- | source/blender/src/drawobject.c | 49 | ||||
-rw-r--r-- | source/blender/src/drawview.c | 67 | ||||
-rw-r--r-- | source/blender/src/editobject.c | 2 | ||||
-rwxr-xr-x | source/blender/src/transform_constraints.c | 2 | ||||
-rw-r--r-- | source/blender/src/transform_manipulator.c | 8 | ||||
-rw-r--r-- | source/blender/src/view.c | 6 | ||||
-rw-r--r-- | source/creator/creator.c | 4 |
14 files changed, 128 insertions, 135 deletions
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 211280fae71..f7160eb1a13 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -91,15 +91,15 @@ typedef struct Global { short totobj, totlamp, totobjsel, totcurve, totmesh, totbone, totbonesel; int totvert, totedge, totface, totvertsel, totedgesel, totfacesel; - short machine, afbreek, moving, colact, zbuf; - short qual, background, imagewin, animspeed; + short afbreek, moving; + short qual, background; short winpos, displaymode; /* used to be in Render */ /** * The current version of Blender. */ short version; - short simulf, fields, order, rt; + short simulf, order, rt; int f; /* Editmode lists */ @@ -108,9 +108,7 @@ typedef struct Global { float textcurs[4][2]; /* Frank's variables */ - int renderd; - int real_sfra, real_efra; - int save_over; + int save_over; /* Reevan's __NLA variables */ struct Object *obpose; /* Current posable object */ @@ -130,22 +128,12 @@ typedef struct Global { struct bSoundListener* listener; /* Test thingy for Nzc */ - int magic; /* toggle use of experimental render pipe */ int compat; /* toggle compatibility mode for edge rendering */ int notonlysolid;/* T-> also edge-render transparent faces */ - int useRscale; /* bitflag for using colour scaling */ - int useGscale; /* bitflag for using colour scaling */ - int useBscale; /* bitflag for using colour scaling */ - float cscale[4]; /* sliders for colour scaling */ - int Rhisto; /* flags for making histograms */ - int Ghisto; - int Bhisto; - - /* special versions */ - short special1, special2; - + + /* confusing... G.f and G.flags */ int flags; - + } Global; /* **************** GLOBAL ********************* */ diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index b0f84d8d844..2046dcacc06 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -201,8 +201,6 @@ void initglobals(void) U.savetime= 1; - G.animspeed= 4; - G.main= MEM_callocN(sizeof(Main), "initglobals"); strcpy(G.ima, "//"); diff --git a/source/blender/include/BSE_drawview.h b/source/blender/include/BSE_drawview.h index 9ac833e9261..946018a198e 100644 --- a/source/blender/include/BSE_drawview.h +++ b/source/blender/include/BSE_drawview.h @@ -43,9 +43,12 @@ void default_gl_light(void); void init_gl_stuff(void); void circf(float x, float y, float rad); void circ(float x, float y, float rad); -void backdrawview3d(int test); void do_viewbuts(unsigned short event); + +void add_view3d_after(struct View3D *v3d, struct Base *base, int type); + +void backdrawview3d(int test); void drawview3dspace(struct ScrArea *sa, void *spacedata); void drawview3d_render(struct View3D *v3d); @@ -62,7 +65,6 @@ void end_anim_sumo(void); void inner_play_anim_loop(int init, int mode); int play_anim(int mode); - void make_axis_color(char *col, char *col2, char axis); #endif /* BSE_DRAWVIEW_H */ diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 28a30235038..da132a65e52 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -38,6 +38,7 @@ struct Object; struct Image; struct Tex; struct SpaceLink; +struct Base; /* This is needed to not let VC choke on near and far... old * proprietary MS extensions... */ @@ -48,6 +49,8 @@ struct SpaceLink; #define far clipend #endif +#include "DNA_listBase.h" + /* The near/far thing is a Win EXCEPTION. Thus, leave near/far in the * code, and patch for windows. */ @@ -59,6 +62,18 @@ typedef struct BGpic { unsigned int *rect; } BGpic; +# +# +typedef struct View3DAfter { + struct View3DAfter *next, *prev; + struct Base *base; + int type; +} View3DAfter; + +/* View3DAfter->type */ +#define V3D_XRAY 1 +#define V3D_TRANSP 2 + typedef struct View3D { struct SpaceLink *next, *prev; int spacetype; @@ -111,6 +126,11 @@ typedef struct View3D { short twtype, twmode, twflag, twpad; float twmat[4][4]; + /* afterdraw, for xray & transparent */ + struct ListBase afterdraw; + /* drawflags, denoting state */ + short zbuf, transp, xray, pad2; + } View3D; /* View3D->flag */ diff --git a/source/blender/radiosity/extern/include/radio.h b/source/blender/radiosity/extern/include/radio.h index aebfaaaccc0..81fd9fdda2e 100644 --- a/source/blender/radiosity/extern/include/radio.h +++ b/source/blender/radiosity/extern/include/radio.h @@ -154,8 +154,6 @@ extern void drawsingnodeWire(RNode *rn); extern void drawnodeSolid(RNode *rn); extern void drawnodeGour(RNode *rn); extern void drawpatch(RPatch *patch, unsigned int col); -extern void drawnode_ext(RNode *rn, unsigned int col); -extern void drawOverflowElem(void); extern void drawfaceGour(Face *face); extern void drawfaceSolid(Face *face); extern void drawfaceWire(Face *face); diff --git a/source/blender/radiosity/intern/source/raddisplay.c b/source/blender/radiosity/intern/source/raddisplay.c index 6c0fe17d8ad..79d40cbab7d 100644 --- a/source/blender/radiosity/intern/source/raddisplay.c +++ b/source/blender/radiosity/intern/source/raddisplay.c @@ -202,9 +202,8 @@ void drawnodeGour(RNode *rn) void drawpatch_ext(RPatch *patch, unsigned int col) { ScrArea *sa, *oldsa; - + View3D *v3d; glDrawBuffer(GL_FRONT); - if(G.zbuf) glDisable(GL_DEPTH_TEST); cpack(col); @@ -213,10 +212,14 @@ void drawpatch_ext(RPatch *patch, unsigned int col) sa= G.curscreen->areabase.first; while(sa) { if (sa->spacetype==SPACE_VIEW3D) { + v3d= sa->spacedata.first; + /* use mywinget() here: otherwise it draws in header */ if(sa->win != mywinget()) areawinset(sa->win); persp(PERSP_VIEW); + if(v3d->zbuf) glDisable(GL_DEPTH_TEST); drawnodeWire(patch->first); + if(v3d->zbuf) glEnable(GL_DEPTH_TEST); // pretty useless? } sa= sa->next; } @@ -225,51 +228,8 @@ void drawpatch_ext(RPatch *patch, unsigned int col) glFlush(); glDrawBuffer(GL_BACK); - if(G.zbuf) glEnable(GL_DEPTH_TEST); -} - -void drawnode_ext(RNode *rn, unsigned int col) -{ - - glDrawBuffer(GL_FRONT); - if(G.zbuf) glDisable(GL_DEPTH_TEST); - - cpack(col); - - drawnodeWire(rn); - - glDrawBuffer(GL_BACK); - if(G.zbuf) glEnable(GL_DEPTH_TEST); } -void drawOverflowElem() -{ - RNode **el, *rn; - float *fp; - int a; - - glDrawBuffer(GL_FRONT); - if(G.zbuf) glDisable(GL_DEPTH_TEST); - - cpack(0xFF9900); - - el= RG.elem; - fp= RG.formfactors; - for(a=0; a<RG.totelem; a++, el++, fp++) { - if(*fp>1.0) { - rn= *el; - glBegin(GL_LINE_LOOP); - glVertex3fv( rn->v1); - glVertex3fv( rn->v2); - glVertex3fv( rn->v3); - if(rn->type==4) glVertex3fv( rn->v4); - glEnd(); - } - } - - glDrawBuffer(GL_BACK); - if(G.zbuf) glEnable(GL_DEPTH_TEST); -} void drawfaceGour(Face *face) { diff --git a/source/blender/src/drawarmature.c b/source/blender/src/drawarmature.c index f285a40195d..3d57077abfa 100644 --- a/source/blender/src/drawarmature.c +++ b/source/blender/src/drawarmature.c @@ -427,10 +427,6 @@ static void draw_pose_channels(Object *ob, int dt) /* and we use selection indices if not done yet */ if (arm->flag & ARM_POSEMODE) index= 0; - if (arm->flag & ARM_DRAWXRAY) { - if(G.zbuf) glDisable(GL_DEPTH_TEST); - } - for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { bone= pchan->bone; if(bone && !(bone->flag & BONE_HIDDEN)) { @@ -472,9 +468,6 @@ static void draw_pose_channels(Object *ob, int dt) /* restore things */ if (dt>OB_WIRE && (arm->flag & ARM_POSEMODE)) bglPolygonOffset(0.0); - if (arm->flag & ARM_DRAWXRAY) { - if(G.zbuf) glEnable(GL_DEPTH_TEST); - } glDisable(GL_CULL_FACE); } @@ -505,10 +498,7 @@ static void set_matrix_editbone(EditBone *eBone) /* called from drawobject.c */ void draw_armature(Object *ob, int dt) { - bArmature *arm; - - if (ob==NULL || ob->data==NULL) return; // weird check... - arm= ob->data; + bArmature *arm= ob->data; /* we use color for solid lighting */ glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); @@ -534,10 +524,6 @@ void draw_armature(Object *ob, int dt) /* if wire over solid, set offset */ if (dt>OB_WIRE) bglPolygonOffset(1.0); - if (arm->flag & ARM_DRAWXRAY) { - if(G.zbuf) glDisable(GL_DEPTH_TEST); - } - for (eBone=G.edbo.first, index=0; eBone; eBone=eBone->next, index++){ glPushMatrix(); @@ -562,9 +548,6 @@ void draw_armature(Object *ob, int dt) /* restore */ if (dt>OB_WIRE) bglPolygonOffset(0.0); - if (arm->flag & ARM_DRAWXRAY) { - if(G.zbuf) glEnable(GL_DEPTH_TEST); - } arm->flag &= ~ARM_EDITMODE; } diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index d87f4826f0d..8fe7f69dd5e 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -960,12 +960,12 @@ static void drawlattice(Object *ob) calc_lattverts(); - if(G.zbuf) glDisable(GL_DEPTH_TEST); + if(G.vd->zbuf) glDisable(GL_DEPTH_TEST); tekenvertslatt(0); tekenvertslatt(1); - if(G.zbuf) glEnable(GL_DEPTH_TEST); + if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); } else lattice_modifier(ob, 'e'); @@ -1339,7 +1339,7 @@ static void draw_em_fancy_verts(EditMesh *em, DerivedMesh *cageDM) { int sel; - if(G.zbuf) glDepthMask(0); // disable write in zbuffer, zbuf select + if(G.vd->zbuf) glDepthMask(0); // disable write in zbuffer, zbuf select for (sel=0; sel<2; sel++) { char col[4], fcol[4]; @@ -1353,7 +1353,7 @@ static void draw_em_fancy_verts(EditMesh *em, DerivedMesh *cageDM) float fsize = BIF_GetThemeValuef(TH_FACEDOT_SIZE); if (pass==0) { - if(G.zbuf && !(G.vd->flag&V3D_ZBUF_SELECT)) { + if(G.vd->zbuf && !(G.vd->flag&V3D_ZBUF_SELECT)) { glDisable(GL_DEPTH_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -1388,7 +1388,7 @@ static void draw_em_fancy_verts(EditMesh *em, DerivedMesh *cageDM) } } - if(G.zbuf) glDepthMask(1); + if(G.vd->zbuf) glDepthMask(1); glPointSize(1.0); } @@ -1404,7 +1404,7 @@ static void draw_em_fancy_edges(DerivedMesh *cageDM) for (pass=0; pass<2; pass++) { /* show wires in transparant when no zbuf clipping for select */ if (pass==0) { - if (G.zbuf && (G.vd->flag & V3D_ZBUF_SELECT)==0) { + if (G.vd->zbuf && (G.vd->flag & V3D_ZBUF_SELECT)==0) { glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glDisable(GL_DEPTH_TEST); @@ -1472,10 +1472,10 @@ static void draw_em_measure_stats(Object *ob, EditMesh *em) char val[32]; /* Stores the measurement display text here */ float area, col[3]; /* area of the face, colour of the text to draw */ - if(G.zbuf && (G.vd->flag & V3D_ZBUF_SELECT)==0) + if(G.vd->zbuf && (G.vd->flag & V3D_ZBUF_SELECT)==0) glDisable(GL_DEPTH_TEST); - if(G.zbuf) bglPolygonOffset(5.0); + if(G.vd->zbuf) bglPolygonOffset(5.0); if(G.f & G_DRAW_EDGELEN) { BIF_GetThemeColor3fv(TH_TEXT, col); @@ -1616,7 +1616,7 @@ static void draw_em_measure_stats(Object *ob, EditMesh *em) } } - if(G.zbuf) { + if(G.vd->zbuf) { glEnable(GL_DEPTH_TEST); bglPolygonOffset(0.0); } @@ -2755,7 +2755,7 @@ static void drawnurb(Object *ob, Nurb *nurb, int dt) calc_Nurbverts(nurb); - if(G.zbuf) glDisable(GL_DEPTH_TEST); + if(G.vd->zbuf) glDisable(GL_DEPTH_TEST); nu= nurb; while(nu) { @@ -2770,7 +2770,7 @@ static void drawnurb(Object *ob, Nurb *nurb, int dt) nu= nu->next; } - if(G.zbuf) glEnable(GL_DEPTH_TEST); + if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); } static void tekentextcurs(void) @@ -3342,10 +3342,9 @@ static void drawSolidSelect(Object *ob) else if(ob->type==OB_ARMATURE) { if(ob!=G.obpose) { bArmature *arm= ob->data; - int oldflag= arm->flag; - arm->flag &= ~ARM_DRAWXRAY; - draw_armature(ob, OB_WIRE); // patch needed for xray option... - arm->flag= oldflag; + + if(G.vd->xray || (arm->flag & ARM_DRAWXRAY)==0) + draw_armature(ob, OB_WIRE); } } @@ -3537,7 +3536,7 @@ void draw_object(Base *base) /* maximum drawtype */ dt= MIN2(G.vd->drawtype, ob->dt); - if(G.zbuf==0 && dt>OB_WIRE) dt= OB_WIRE; + if(G.vd->zbuf==0 && dt>OB_WIRE) dt= OB_WIRE; dtx= 0; /* faceselect exception: also draw solid when dt==wire, except in editmode */ @@ -3714,7 +3713,13 @@ void draw_object(Base *base) drawlattice(ob); break; case OB_ARMATURE: - draw_armature (ob, dt); + { + bArmature *arm= ob->data; + if(G.vd->xray==0 && (arm->flag & ARM_DRAWXRAY)) + add_view3d_after(G.vd, base, V3D_XRAY); + else + draw_armature(ob, dt); + } break; default: drawaxes(1.0); @@ -3810,7 +3815,7 @@ void draw_object(Base *base) } /* object centers */ - if(G.zbuf) glDisable(GL_DEPTH_TEST); + if(G.vd->zbuf) glDisable(GL_DEPTH_TEST); if(ob->type == OB_LAMP) { if(ob->id.lib) { if(base->flag & SELECT) rect= rectllib_sel; @@ -3841,7 +3846,7 @@ void draw_object(Base *base) } draw_icon_centered(ob->obmat[3], rect, 4); } - if(G.zbuf) glEnable(GL_DEPTH_TEST); + if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); } else if((G.f & (G_VERTEXPAINT|G_FACESELECT|G_TEXTUREPAINT|G_WEIGHTPAINT))==0) { @@ -3861,7 +3866,7 @@ void draw_object_ext(Base *base) if(G.vd==NULL || base==NULL) return; if(G.vd->drawtype > OB_WIRE) { - G.zbuf= 1; + G.vd->zbuf= 1; glEnable(GL_DEPTH_TEST); } @@ -3877,8 +3882,8 @@ void draw_object_ext(Base *base) glFlush(); /* reveil frontbuffer drawing */ glDrawBuffer(GL_BACK); - if(G.zbuf) { - G.zbuf= 0; + if(G.vd->zbuf) { + G.vd->zbuf= 0; glDisable(GL_DEPTH_TEST); } curarea->win_swap= WIN_FRONT_OK; diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index c9fb043e332..a3ed1aa118b 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -425,7 +425,7 @@ static void draw_bgpic(void) zoomy= (y2-y1)/ima->ibuf->y; glEnable(GL_BLEND); - if(G.zbuf) glDisable(GL_DEPTH_TEST); + if(G.vd->zbuf) glDisable(GL_DEPTH_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -446,7 +446,7 @@ static void draw_bgpic(void) glBlendFunc(GL_ONE, GL_ZERO); glDisable(GL_BLEND); - if(G.zbuf) glEnable(GL_DEPTH_TEST); + if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); areawinset(curarea->win); // restore viewport / scissor } @@ -655,7 +655,7 @@ static void drawfloor(void) if(vd->gridlines<3) return; - if(G.zbuf && G.obedit) glDepthMask(0); // for zbuffer-select + if(G.vd->zbuf && G.obedit) glDepthMask(0); // for zbuffer-select gridlines= vd->gridlines/2; grid= gridlines*vd->grid; @@ -756,7 +756,7 @@ static void drawfloor(void) glEnd(); } - if(G.zbuf && G.obedit) glDepthMask(1); + if(G.vd->zbuf && G.obedit) glDepthMask(1); } @@ -940,13 +940,13 @@ void backdrawview3d(int test) #ifdef __APPLE__ glDrawBuffer(GL_AUX0); #endif - if(G.vd->drawtype > OB_WIRE) G.zbuf= TRUE; + if(G.vd->drawtype > OB_WIRE) G.vd->zbuf= TRUE; curarea->win_swap &= ~WIN_BACK_OK; glDisable(GL_DITHER); glClearColor(0.0, 0.0, 0.0, 0.0); - if(G.zbuf) { + if(G.vd->zbuf) { glEnable(GL_DEPTH_TEST); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } @@ -965,7 +965,7 @@ void backdrawview3d(int test) G.vd->flag &= ~V3D_NEEDBACKBUFDRAW; G.f &= ~G_BACKBUFSEL; - G.zbuf= FALSE; + G.vd->zbuf= FALSE; glDisable(GL_DEPTH_TEST); glEnable(GL_DITHER); @@ -1842,6 +1842,41 @@ static void view3d_blockhandlers(ScrArea *sa) } +/* temp storage of Objects that need to be drawn as last */ +void add_view3d_after(View3D *v3d, Base *base, int type) +{ + View3DAfter *v3da= MEM_callocN(sizeof(View3DAfter), "View 3d after"); + + BLI_addtail(&v3d->afterdraw, v3da); + v3da->base= base; + v3da->type= type; +} + +/* clears zbuffer and draws it over */ +static void view3d_draw_xray(View3D *v3d) +{ + View3DAfter *v3da, *next; + int doit= 0; + + for(v3da= G.vd->afterdraw.first; v3da; v3da= v3da->next) + if(v3da->type==V3D_XRAY) doit= 1; + + if(doit) { + if(v3d->zbuf) glClear(GL_DEPTH_BUFFER_BIT); + v3d->xray= TRUE; + + for(v3da= G.vd->afterdraw.first; v3da; v3da= next) { + next= v3da->next; + if(v3da->type==V3D_XRAY) { + draw_object(v3da->base); + BLI_remlink(&G.vd->afterdraw, v3da); + MEM_freeN(v3da); + } + } + v3d->xray= FALSE; + } +} + void drawview3dspace(ScrArea *sa, void *spacedata) { View3D *v3d= spacedata; @@ -1856,7 +1891,7 @@ void drawview3dspace(ScrArea *sa, void *spacedata) Mat4Invert(v3d->viewinv, v3d->viewmat); if(v3d->drawtype > OB_WIRE) { - G.zbuf= TRUE; + G.vd->zbuf= TRUE; glEnable(GL_DEPTH_TEST); if(G.f & G_SIMULATION) { glClearColor(0.0, 0.0, 0.0, 0.0); @@ -2037,10 +2072,13 @@ void drawview3dspace(ScrArea *sa, void *spacedata) if(G.scene->radio) RAD_drawall(v3d->drawtype>=OB_SOLID); + /* XRAY afterdraw stuff */ + view3d_draw_xray(G.vd); + BIF_draw_manipulator(sa); - if(G.zbuf) { - G.zbuf= FALSE; + if(G.vd->zbuf) { + G.vd->zbuf= FALSE; glDisable(GL_DEPTH_TEST); } @@ -2113,7 +2151,7 @@ void drawview3d_render(struct View3D *v3d) Mat4Invert(v3d->viewinv, v3d->viewmat); if(v3d->drawtype > OB_WIRE) { - G.zbuf= TRUE; + G.vd->zbuf= TRUE; glEnable(GL_DEPTH_TEST); } @@ -2226,8 +2264,11 @@ void drawview3d_render(struct View3D *v3d) if(G.scene->radio) RAD_drawall(G.vd->drawtype>=OB_SOLID); - if(G.zbuf) { - G.zbuf= FALSE; + /* XRAY afterdraw stuff */ + view3d_draw_xray(G.vd); + + if(G.vd->zbuf) { + G.vd->zbuf= FALSE; glDisable(GL_DEPTH_TEST); } diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index f01b88a2a78..75a64a40d68 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -1788,7 +1788,7 @@ void docentre(int centremode) allqueue(REDRAWBUTSEDIT, 0); } - base->object->recalc |= OB_RECALC_DATA; + base->object->recalc |= OB_RECALC_OB|OB_RECALC_DATA; } } base= base->next; diff --git a/source/blender/src/transform_constraints.c b/source/blender/src/transform_constraints.c index b6ef7a8bf21..b8d7e4bbbcf 100755 --- a/source/blender/src/transform_constraints.c +++ b/source/blender/src/transform_constraints.c @@ -692,7 +692,7 @@ void BIF_drawConstraint(void) glVertex3fv(vec); glEnd(); setlinestyle(0); - if(G.zbuf) glEnable(GL_DEPTH_TEST); // warning for global! + if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); } if (tc->mode & CON_AXIS0) { diff --git a/source/blender/src/transform_manipulator.c b/source/blender/src/transform_manipulator.c index ecabe7e4add..c6f68ac331c 100644 --- a/source/blender/src/transform_manipulator.c +++ b/source/blender/src/transform_manipulator.c @@ -955,7 +955,7 @@ static void draw_manipulator_rotate(float mat[][4], int moving, int drawflags, i /* restore */ myloadmatrix(G.vd->viewmat); gluDeleteQuadric(qobj); - if(G.zbuf) glEnable(GL_DEPTH_TEST); // shouldn't be global, tsk! + if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); } @@ -1041,7 +1041,7 @@ static void draw_manipulator_scale(float mat[][4], int moving, int drawflags, in /* restore */ myloadmatrix(G.vd->viewmat); - if(G.zbuf) glEnable(GL_DEPTH_TEST); // shouldn't be global, tsk! + if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); glFrontFace(GL_CCW); } @@ -1140,7 +1140,7 @@ static void draw_manipulator_translate(float mat[][4], int moving, int drawflags gluDeleteQuadric(qobj); myloadmatrix(G.vd->viewmat); - if(G.zbuf) glEnable(GL_DEPTH_TEST); // shouldn't be global, tsk! + if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); } @@ -1240,7 +1240,7 @@ static void draw_manipulator_rotate_cyl(float mat[][4], int moving, int drawflag gluDeleteQuadric(qobj); myloadmatrix(G.vd->viewmat); - if(G.zbuf) glEnable(GL_DEPTH_TEST); // shouldn't be global, tsk! + if(G.vd->zbuf) glEnable(GL_DEPTH_TEST); } diff --git a/source/blender/src/view.c b/source/blender/src/view.c index c15f6211b48..ff7438dc840 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -886,7 +886,7 @@ short view3d_opengl_select(unsigned int *buffer, unsigned int bufsize, short x1 Mat4MulMat4(G.vd->persmat, G.vd->viewmat, curarea->winmat); if(G.vd->drawtype > OB_WIRE) { - G.zbuf= TRUE; + G.vd->zbuf= TRUE; glEnable(GL_DEPTH_TEST); } @@ -903,6 +903,7 @@ short view3d_opengl_select(unsigned int *buffer, unsigned int bufsize, short x1 draw_object(BASACT); } else { + G.vd->xray= TRUE; // otherwise it postpones drawing base= G.scene->base.first; while(base) { if(base->lay & G.vd->lay) { @@ -913,6 +914,7 @@ short view3d_opengl_select(unsigned int *buffer, unsigned int bufsize, short x1 } base= base->next; } + G.vd->xray= FALSE; // restore } glPopName(); /* see above (pushname) */ hits= glRenderMode(GL_RENDER); @@ -923,7 +925,7 @@ short view3d_opengl_select(unsigned int *buffer, unsigned int bufsize, short x1 Mat4MulMat4(G.vd->persmat, G.vd->viewmat, curarea->winmat); if(G.vd->drawtype > OB_WIRE) { - G.zbuf= 0; + G.vd->zbuf= 0; glDisable(GL_DEPTH_TEST); } persp(PERSP_WIN); diff --git a/source/creator/creator.c b/source/creator/creator.c index 1c8cab55cb5..a4b932611ff 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -527,8 +527,6 @@ int main(int argc, char **argv) case 'f': a++; if (G.scene && a < argc) { - G.real_sfra = (G.scene->r.sfra); - G.real_efra = (G.scene->r.efra); (G.scene->r.sfra) = atoi(argv[a]); (G.scene->r.efra) = (G.scene->r.sfra); RE_animrender(NULL); @@ -536,8 +534,6 @@ int main(int argc, char **argv) break; case 'a': if (G.scene) { - G.real_sfra = (G.scene->r.sfra); - G.real_efra = (G.scene->r.efra); RE_animrender(NULL); } break; |