Revert "Different drawing for object centers."
authorAntony Riakiotakis <kalast@gmail.com>
Mon, 4 May 2015 16:00:29 +0000 (18:00 +0200)
committerAntony Riakiotakis <kalast@gmail.com>
Mon, 4 May 2015 16:00:29 +0000 (18:00 +0200)
This reverts commit 5a8629c0d7da6cfb4b696f1787111c9492e03aba.

It does not really work that well since objects can draw in front of
selection circles now.

source/blender/editors/space_view3d/drawobject.c

index de2b5a39313ab1cb327d4ba9540375e1d0733871..5b2ac50216a25e634a11f216373a3aadc38cbe83 100644 (file)
@@ -735,7 +735,11 @@ static void drawcentercircle(View3D *v3d, RegionView3D *rv3d, const float co[3],
        const float size = ED_view3d_pixel_size(rv3d, co) * (float)U.obcenter_dia * 0.5f;
        float verts[CIRCLE_RESOL][3];
 
-       if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
+       /* using gldepthfunc guarantees that it does write z values,
+        * but not checks for it, so centers remain visible independent order of drawing */
+       if (v3d->zbuf) glDepthFunc(GL_ALWAYS);
+       /* write to near buffer always */
+       glDepthRange(0.0, 0.0);
        glEnable(GL_BLEND);
        
        if (special_color) {
@@ -765,9 +769,10 @@ static void drawcentercircle(View3D *v3d, RegionView3D *rv3d, const float co[3],
        /* finish up */
        glDisableClientState(GL_VERTEX_ARRAY);
 
+       glDepthRange(0.0, 1.0);
        glDisable(GL_BLEND);
 
-       if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
+       if (v3d->zbuf) glDepthFunc(GL_LEQUAL);
 }
 
 /* *********** text drawing for object/particles/armature ************* */