]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
made r_showoverdraw honor material face culling settings
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 17 Apr 2011 20:05:27 +0000 (20:05 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 17 Apr 2011 20:05:27 +0000 (20:05 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11062 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index d517bd8bfaf1ee8e9e3088081146f0134d6fd0fc..e566d1e97644585964f027e39df945833ab4e509 100644 (file)
@@ -10989,7 +10989,10 @@ void R_DrawDebugModel(void)
        dp_model_t *model = ent->model;
        vec3_t v;
 
-       if (r_showoverdraw.value > 0 && (sv.active || ent != r_refdef.scene.worldentity))
+       if (!sv.active  && !cls.demoplayback && ent != r_refdef.scene.worldentity)
+               return;
+
+       if (r_showoverdraw.value > 0)
        {
                float c = r_refdef.view.colorscale * r_showoverdraw.value * 0.125f;
                flagsmask = MATERIALFLAG_SKY | MATERIALFLAG_WALL;
@@ -10998,7 +11001,6 @@ void R_DrawDebugModel(void)
                GL_DepthMask(false);
                GL_DepthRange(0, 1);
                GL_BlendFunc(GL_ONE, GL_ONE);
-               GL_CullFace(GL_NONE);
                for (i = 0, j = model->firstmodelsurface, surface = model->data_surfaces + j;i < model->nummodelsurfaces;i++, j++, surface++)
                {
                        if (ent == r_refdef.scene.worldentity && !r_refdef.viewcache.world_surfacevisible[j])
@@ -11007,6 +11009,7 @@ void R_DrawDebugModel(void)
                        if ((rsurface.texture->currentmaterialflags & flagsmask) && surface->num_triangles)
                        {
                                RSurf_PrepareVerticesForBatch(BATCHNEED_ARRAY_VERTEX | BATCHNEED_NOGAPS, 1, &surface);
+                               GL_CullFace((rsurface.texture->currentmaterialflags & MATERIALFLAG_NOCULLFACE) ? GL_NONE : r_refdef.view.cullface_back);
                                if (!rsurface.texture->currentlayers->depthmask)
                                        GL_Color(c, 0, 0, 1.0f);
                                else if (ent == r_refdef.scene.worldentity)