From: havoc Date: Tue, 23 Jan 2007 16:51:26 +0000 (+0000) Subject: fix bug in GL_CullFace which was causing it to often malfunction X-Git-Tag: xonotic-v0.1.0preview~3667 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fdcf990dba1f09244d0f35b410caafe7d451432c;p=xonotic%2Fdarkplaces.git fix bug in GL_CullFace which was causing it to often malfunction git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6741 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_backend.c b/gl_backend.c index b77e5fb9..7a15dc6c 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -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 } } }