[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45720] trunk/blender/source/blender/ editors/mesh/editmesh_knife.c: Attempted fix for #30985: knife draw messing up display after confirming.

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Apr 17 19:25:10 CEST 2012


Revision: 45720
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45720
Author:   blendix
Date:     2012-04-17 17:25:10 +0000 (Tue, 17 Apr 2012)
Log Message:
-----------
Attempted fix for #30985: knife draw messing up display after confirming. I couldn't
redo the problem, but the depth test toggle here should be conditional as in other
3d view drawing code.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/mesh/editmesh_knife.c

Modified: trunk/blender/source/blender/editors/mesh/editmesh_knife.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_knife.c	2012-04-17 16:51:10 UTC (rev 45719)
+++ trunk/blender/source/blender/editors/mesh/editmesh_knife.c	2012-04-17 17:25:10 UTC (rev 45720)
@@ -853,11 +853,12 @@
 }
 
 /* modal loop selection drawing callback */
-static void knifetool_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *arg)
+static void knifetool_draw(const bContext *C, ARegion *UNUSED(ar), void *arg)
 {
+	View3D *v3d = CTX_wm_view3d(C);
 	knifetool_opdata *kcd = arg;
 
-	glDisable(GL_DEPTH_TEST);
+	if(v3d->zbuf) glDisable(GL_DEPTH_TEST);
 
 	glPolygonOffset(1.0f, 1.0f);
 
@@ -995,7 +996,8 @@
 	}
 
 	glPopMatrix();
-	glEnable(GL_DEPTH_TEST);
+
+	if(v3d->zbuf) glEnable(GL_DEPTH_TEST);
 }
 
 static float len_v3_tri_side_max(const float v1[3], const float v2[3], const float v3[3])




More information about the Bf-blender-cvs mailing list