This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 7c443a71770962338b25f40af18367b9ac0f9e1f
Author: MAN-AT-ARMS <m4n4t4...@gmail.com>
Date:   Sat Mar 14 06:50:31 2015 -0400

    All: Rend2: Fix culling again
---
 MP/code/rend2/tr_backend.c | 16 ++--------------
 MP/code/rend2/tr_shade.c   | 30 +++++++++++++++++++-----------
 SP/code/rend2/tr_backend.c | 16 ++--------------
 SP/code/rend2/tr_shade.c   | 30 +++++++++++++++++++-----------
 4 files changed, 42 insertions(+), 50 deletions(-)

diff --git a/MP/code/rend2/tr_backend.c b/MP/code/rend2/tr_backend.c
index c2899f0..9cea80f 100644
--- a/MP/code/rend2/tr_backend.c
+++ b/MP/code/rend2/tr_backend.c
@@ -133,24 +133,12 @@ void GL_Cull( int cullType ) {
        } 
        else 
        {
-               qboolean cullFront;
+               qboolean cullFront = (cullType == CT_FRONT_SIDED);
 
                if ( glState.faceCulling == CT_TWO_SIDED )
-               {
                        qglEnable( GL_CULL_FACE );
-               }
-
-               cullFront = (cullType == CT_FRONT_SIDED);
-               if ( backEnd.viewParms.isMirror )
-               {
-                       cullFront = !cullFront;
-               }
-               if ( backEnd.currentEntity && backEnd.currentEntity->mirrored )
-               {
-                       cullFront = !cullFront;
-               }
 
-               if (glState.faceCullFront != cullFront)
+               if ( glState.faceCullFront != cullFront )
                        qglCullFace( cullFront ? GL_FRONT : GL_BACK );
 
                glState.faceCullFront = cullFront;
diff --git a/MP/code/rend2/tr_shade.c b/MP/code/rend2/tr_shade.c
index bd64b84..402538e 100644
--- a/MP/code/rend2/tr_shade.c
+++ b/MP/code/rend2/tr_shade.c
@@ -1634,20 +1634,28 @@ void RB_StageIteratorGeneric( void )
        //
        // set face culling appropriately
        //
-       if ((backEnd.viewParms.flags & VPF_DEPTHSHADOW))
+       if (input->shader->cullType == CT_TWO_SIDED)
        {
-               //GL_Cull( CT_TWO_SIDED );
-               
-               if (input->shader->cullType == CT_TWO_SIDED)
-                       GL_Cull( CT_TWO_SIDED );
-               else if (input->shader->cullType == CT_FRONT_SIDED)
-                       GL_Cull( CT_BACK_SIDED );
-               else
-                       GL_Cull( CT_FRONT_SIDED );
-               
+               GL_Cull( CT_TWO_SIDED );
        }
        else
-               GL_Cull( input->shader->cullType );
+       {
+               qboolean cullFront = (input->shader->cullType == 
CT_FRONT_SIDED);
+
+               if ( backEnd.viewParms.flags & VPF_DEPTHSHADOW )
+                       cullFront = !cullFront;
+
+               if ( backEnd.viewParms.isMirror )
+                       cullFront = !cullFront;
+
+               if ( backEnd.currentEntity && backEnd.currentEntity->mirrored )
+                       cullFront = !cullFront;
+
+               if (cullFront)
+                       GL_Cull( CT_FRONT_SIDED );
+               else
+                       GL_Cull( CT_BACK_SIDED );
+       }
 
        // set polygon offset if necessary
        if ( input->shader->polygonOffset )
diff --git a/SP/code/rend2/tr_backend.c b/SP/code/rend2/tr_backend.c
index 1d44c67..ef7f3e4 100644
--- a/SP/code/rend2/tr_backend.c
+++ b/SP/code/rend2/tr_backend.c
@@ -133,24 +133,12 @@ void GL_Cull( int cullType ) {
        }
        else
        {
-               qboolean cullFront;
+               qboolean cullFront = (cullType == CT_FRONT_SIDED);
 
                if ( glState.faceCulling == CT_TWO_SIDED )
-               {
                        qglEnable( GL_CULL_FACE );
-               }
-
-               cullFront = (cullType == CT_FRONT_SIDED);
-               if ( backEnd.viewParms.isMirror )
-               {
-                       cullFront = !cullFront;
-               }
-               if ( backEnd.currentEntity && backEnd.currentEntity->mirrored )
-               {
-                       cullFront = !cullFront;
-               }
 
-               if (glState.faceCullFront != cullFront)
+               if ( glState.faceCullFront != cullFront )
                        qglCullFace( cullFront ? GL_FRONT : GL_BACK );
 
                glState.faceCullFront = cullFront;
diff --git a/SP/code/rend2/tr_shade.c b/SP/code/rend2/tr_shade.c
index cd4cafb..cd847ef 100644
--- a/SP/code/rend2/tr_shade.c
+++ b/SP/code/rend2/tr_shade.c
@@ -1635,20 +1635,28 @@ void RB_StageIteratorGeneric( void )
        //
        // set face culling appropriately
        //
-       if ((backEnd.viewParms.flags & VPF_DEPTHSHADOW))
+       if (input->shader->cullType == CT_TWO_SIDED)
        {
-               //GL_Cull( CT_TWO_SIDED );
-               
-               if (input->shader->cullType == CT_TWO_SIDED)
-                       GL_Cull( CT_TWO_SIDED );
-               else if (input->shader->cullType == CT_FRONT_SIDED)
-                       GL_Cull( CT_BACK_SIDED );
-               else
-                       GL_Cull( CT_FRONT_SIDED );
-               
+               GL_Cull( CT_TWO_SIDED );
        }
        else
-               GL_Cull( input->shader->cullType );
+       {
+               qboolean cullFront = (input->shader->cullType == 
CT_FRONT_SIDED);
+
+               if ( backEnd.viewParms.flags & VPF_DEPTHSHADOW )
+                       cullFront = !cullFront;
+
+               if ( backEnd.viewParms.isMirror )
+                       cullFront = !cullFront;
+
+               if ( backEnd.currentEntity && backEnd.currentEntity->mirrored )
+                       cullFront = !cullFront;
+
+               if (cullFront)
+                       GL_Cull( CT_FRONT_SIDED );
+               else
+                       GL_Cull( CT_BACK_SIDED );
+       }
 
        // set polygon offset if necessary
        if ( input->shader->polygonOffset )

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-games/iortcw.git

_______________________________________________
Pkg-games-commits mailing list
Pkg-games-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

Reply via email to