diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2008-05-12 16:24:52 +0400 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2008-05-12 16:24:52 +0400 |
commit | db3712a2d82d5fe67daf3fbc79dde957282ffd6f (patch) | |
tree | 176fcf8247b385791fa26e09e3b52407a1d5c4bf /source/blender/src/drawobject.c | |
parent | a68c03e409e01285bee622b12313117012e486a8 (diff) | |
parent | 2c9e8e75939553f03b01f34c185f5875473bad40 (diff) |
svn merge -r 14721:14810 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/blender/src/drawobject.c')
-rw-r--r-- | source/blender/src/drawobject.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 84289be0928..17b51249ac2 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -2265,14 +2265,18 @@ static void draw_mesh_fancy(Base *base, int dt, int flag) Mesh *me = ob->data; Material *ma= give_current_material(ob, 1); int hasHaloMat = (ma && (ma->mode&MA_HALO)); - int draw_wire = ob->dtx&OB_DRAWWIRE; + int draw_wire = 0; int totvert, totedge, totface; DispList *dl; DerivedMesh *dm= mesh_get_derived_final(ob, get_viewedit_datamask()); if(!dm) return; - + + if (ob->dtx&OB_DRAWWIRE) { + draw_wire = 2; /* draw wire after solid using zoffset and depth buffer adjusment */ + } + #ifdef WITH_VERSE if(me->vnode) { struct VNode *vnode = (VNode*)me->vnode; @@ -2312,7 +2316,7 @@ static void draw_mesh_fancy(Base *base, int dt, int flag) glPointSize(1.0); } else if(dt==OB_WIRE || totface==0) { - draw_wire = 1; + draw_wire = 1; /* draw wire only, no depth buffer stuff */ } else if( (ob==OBACT && (G.f & G_TEXTUREPAINT || FACESEL_PAINT_TEST)) || CHECK_OB_DRAWTEXTURE(G.vd, dt)) @@ -2448,20 +2452,21 @@ static void draw_mesh_fancy(Base *base, int dt, int flag) * * UPDATE bug #10290 - With this wire-only objects can draw * behind other objects depending on their order in the scene. 2x if 0's below. undo'ing zr's commit: r4059 + * + * if draw wire is 1 then just drawing wire, no need for depth buffer stuff, + * otherwise this wire is to overlay solid mode faces so do some depth buffer tricks. */ -#if 0 - if (dt!=OB_WIRE) { + if (dt!=OB_WIRE && draw_wire==2) { bglPolygonOffset(1.0); glDepthMask(0); // disable write in zbuffer, selected edge wires show better } -#endif + dm->drawEdges(dm, (dt==OB_WIRE || totface==0)); -#if 0 - if (dt!=OB_WIRE) { + + if (dt!=OB_WIRE && draw_wire==2) { glDepthMask(1); bglPolygonOffset(0.0); } -#endif } dm->release(dm); |