]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix bug in GL_CullFace which was causing it to often malfunction
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 23 Jan 2007 16:51:26 +0000 (16:51 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 23 Jan 2007 16:51:26 +0000 (16:51 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6741 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c

index b77e5fb9e1c0604c1eb3e177f07b143f5a2ef56f..7a15dc6cfcf88adc4b011b98e219ea717cea50f9 100644 (file)
@@ -591,29 +591,26 @@ void GL_DepthTest(int state)
 
 void GL_CullFace(int state)
 {
-       if (gl_state.cullface != state)
+       CHECKGLERROR
+       if (state != GL_NONE)
        {
-               CHECKGLERROR
-               if (state != GL_NONE)
+               if (!gl_state.cullfaceenable)
                {
-                       if (!gl_state.cullfaceenable)
-                       {
-                               gl_state.cullfaceenable = true;
-                               qglEnable(GL_CULL_FACE);CHECKGLERROR
-                       }
-                       if (gl_state.cullface != state)
-                       {
-                               gl_state.cullface = state;
-                               qglCullFace(state);CHECKGLERROR
-                       }
+                       gl_state.cullfaceenable = true;
+                       qglEnable(GL_CULL_FACE);CHECKGLERROR
                }
-               else
+               if (gl_state.cullface != state)
                {
-                       if (gl_state.cullfaceenable)
-                       {
-                               gl_state.cullfaceenable = false;
-                               qglDisable(GL_CULL_FACE);CHECKGLERROR
-                       }
+                       gl_state.cullface = state;
+                       qglCullFace(gl_state.cullface);CHECKGLERROR
+               }
+       }
+       else
+       {
+               if (gl_state.cullfaceenable)
+               {
+                       gl_state.cullfaceenable = false;
+                       qglDisable(GL_CULL_FACE);CHECKGLERROR
                }
        }
 }