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-09 19:21:23 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-05-09 19:21:23 +0400
commitf7173498f3d3e00ed257490687478de43b5ca895 (patch)
tree7a5e4e5b4d9518a94a4c38ab01cdfe7afe9f429c /source/blender/src/drawobject.c
parent4fa0ba06d61e8d7daa4c95c9ba98f46e13f2a734 (diff)
missed modifier.c last commit, made explode copy some settings.
added back zr's depth buffer wire stuff, but only when wire is being drawn over solid mode. normal wire objects will still display correctly.
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 561024fb74b..6a0863a5b63 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -2245,14 +2245,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;
@@ -2292,7 +2296,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))
@@ -2428,20 +2432,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);