Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-05-10 21:32:31 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-05-10 21:32:31 +0400
commit8e4f1a77053690259941c2af8f1a5601ad05fc73 (patch)
tree5eb04cadcb2c6768f26e3face55667a5b62f5a09 /source/blender/src/drawobject.c
parent6546305b60b05e94227b1144bb982d81e42423ec (diff)
parent5e5dc2e9385b3118f99ba5497e206adf481e65a2 (diff)
merge 14760:HEAD
Diffstat (limited to 'source/blender/src/drawobject.c')
-rw-r--r--source/blender/src/drawobject.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
index c5b7c874e6e..124c784978d 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -2328,14 +2328,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;
@@ -2375,7 +2379,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) && (!do_gpu_material(dt))) || CHECK_OB_DRAWTEXTURE(G.vd, dt)))
{
@@ -2529,20 +2533,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);