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 7508d9bba4ca8bed6ca324aa83a52fba46dd7894
Author: m4n4t4...@gmail.com 
<m4n4t4...@gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date:   Sun Nov 2 15:53:46 2014 +0000

    All: Always use GL_Cull to change cull state
---
 MP/code/rend2/tr_backend.c    |  2 +-
 MP/code/rend2/tr_fbo.c        |  2 +-
 MP/code/rend2/tr_shadows.c    | 29 +++++++----------------------
 MP/code/renderer/tr_backend.c |  2 +-
 MP/code/renderer/tr_shadows.c | 29 +++++++----------------------
 SP/code/rend2/tr_backend.c    |  2 +-
 SP/code/rend2/tr_fbo.c        |  2 +-
 SP/code/rend2/tr_shadows.c    | 29 +++++++----------------------
 SP/code/renderer/tr_backend.c |  2 +-
 SP/code/renderer/tr_shadows.c | 29 +++++++----------------------
 10 files changed, 34 insertions(+), 94 deletions(-)

diff --git a/MP/code/rend2/tr_backend.c b/MP/code/rend2/tr_backend.c
index 7a6b31e..dfdb0b7 100644
--- a/MP/code/rend2/tr_backend.c
+++ b/MP/code/rend2/tr_backend.c
@@ -889,7 +889,7 @@ void    RB_SetGL2D( void ) {
                          GLS_SRCBLEND_SRC_ALPHA |
                          GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA );
 
-       qglDisable( GL_CULL_FACE );
+       GL_Cull( CT_TWO_SIDED );
        qglDisable( GL_CLIP_PLANE0 );
 
        // set time for 2D shaders
diff --git a/MP/code/rend2/tr_fbo.c b/MP/code/rend2/tr_fbo.c
index ba145e6..c5c641f 100644
--- a/MP/code/rend2/tr_fbo.c
+++ b/MP/code/rend2/tr_fbo.c
@@ -748,7 +748,7 @@ void FBO_BlitFromTexture(struct image_s *src, ivec4_t 
inSrcBox, vec2_t inSrcTexS
 
        Mat4Ortho(0, width, height, 0, 0, 1, projection);
 
-       qglDisable( GL_CULL_FACE );
+       GL_Cull( CT_TWO_SIDED );
 
        GL_BindToTMU(src, TB_COLORMAP);
 
diff --git a/MP/code/rend2/tr_shadows.c b/MP/code/rend2/tr_shadows.c
index 506a4e1..3e38a12 100644
--- a/MP/code/rend2/tr_shadows.c
+++ b/MP/code/rend2/tr_shadows.c
@@ -218,7 +218,6 @@ void RB_ShadowTessEnd( void ) {
        // draw the silhouette edges
 
        GL_Bind( tr.whiteImage );
-       qglEnable( GL_CULL_FACE );
        GL_State( GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
        qglColor3f( 0.2f, 0.2f, 0.2f );
 
@@ -229,29 +228,15 @@ void RB_ShadowTessEnd( void ) {
        qglEnable( GL_STENCIL_TEST );
        qglStencilFunc( GL_ALWAYS, 1, 255 );
 
-       // mirrors have the culling order reversed
-       if ( backEnd.viewParms.isMirror ) {
-               qglCullFace( GL_FRONT );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
+       GL_Cull( CT_BACK_SIDED );
+       qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
 
-               R_RenderShadowEdges();
+       R_RenderShadowEdges();
 
-               qglCullFace( GL_BACK );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
-
-               R_RenderShadowEdges();
-       } else {
-               qglCullFace( GL_BACK );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
-
-               R_RenderShadowEdges();
-
-               qglCullFace( GL_FRONT );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
-
-               R_RenderShadowEdges();
-       }
+       GL_Cull( CT_FRONT_SIDED );
+       qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
 
+       R_RenderShadowEdges();
 
        // reenable writing to the color buffer
        qglColorMask(rgba[0], rgba[1], rgba[2], rgba[3]);
@@ -279,7 +264,7 @@ void RB_ShadowFinish( void ) {
        qglStencilFunc( GL_NOTEQUAL, 0, 255 );
 
        qglDisable( GL_CLIP_PLANE0 );
-       qglDisable( GL_CULL_FACE );
+       GL_Cull( CT_TWO_SIDED );
 
        GL_Bind( tr.whiteImage );
 
diff --git a/MP/code/renderer/tr_backend.c b/MP/code/renderer/tr_backend.c
index 6e05dd7..b0fa5e8 100644
--- a/MP/code/renderer/tr_backend.c
+++ b/MP/code/renderer/tr_backend.c
@@ -813,7 +813,7 @@ void    RB_SetGL2D( void ) {
                          GLS_SRCBLEND_SRC_ALPHA |
                          GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA );
 
-       qglDisable( GL_CULL_FACE );
+       GL_Cull( CT_TWO_SIDED );
        qglDisable( GL_CLIP_PLANE0 );
 
        // set time for 2D shaders
diff --git a/MP/code/renderer/tr_shadows.c b/MP/code/renderer/tr_shadows.c
index 9c6d3e8..6d81d9a 100644
--- a/MP/code/renderer/tr_shadows.c
+++ b/MP/code/renderer/tr_shadows.c
@@ -229,7 +229,6 @@ void RB_ShadowTessEnd( void ) {
        // draw the silhouette edges
 
        GL_Bind( tr.whiteImage );
-       qglEnable( GL_CULL_FACE );
        GL_State( GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
 #ifdef VCMODS_OPENGLES
        qglColor4f( 0.2f, 0.2f, 0.2f, 1.0f );
@@ -244,29 +243,15 @@ void RB_ShadowTessEnd( void ) {
        qglEnable( GL_STENCIL_TEST );
        qglStencilFunc( GL_ALWAYS, 1, 255 );
 
-       // mirrors have the culling order reversed
-       if ( backEnd.viewParms.isMirror ) {
-               qglCullFace( GL_FRONT );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
+       GL_Cull( CT_BACK_SIDED );
+       qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
 
-               R_RenderShadowEdges();
+       R_RenderShadowEdges();
 
-               qglCullFace( GL_BACK );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
-
-               R_RenderShadowEdges();
-       } else {
-               qglCullFace( GL_BACK );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
-
-               R_RenderShadowEdges();
-
-               qglCullFace( GL_FRONT );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
-
-               R_RenderShadowEdges();
-       }
+       GL_Cull( CT_FRONT_SIDED );
+       qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
 
+       R_RenderShadowEdges();
 
        // reenable writing to the color buffer
        qglColorMask(rgba[0], rgba[1], rgba[2], rgba[3]);
@@ -303,7 +288,7 @@ void RB_ShadowFinish( void ) {
        qglStencilFunc( GL_NOTEQUAL, 0, 255 );
 
        qglDisable( GL_CLIP_PLANE0 );
-       qglDisable( GL_CULL_FACE );
+       GL_Cull( CT_TWO_SIDED );
 
        GL_Bind( tr.whiteImage );
 
diff --git a/SP/code/rend2/tr_backend.c b/SP/code/rend2/tr_backend.c
index 3989b19..641d365 100644
--- a/SP/code/rend2/tr_backend.c
+++ b/SP/code/rend2/tr_backend.c
@@ -1243,7 +1243,7 @@ void    RB_SetGL2D( void ) {
 
        qglDisable( GL_FOG ); //----(SA)        added
 
-       qglDisable( GL_CULL_FACE );
+       GL_Cull( CT_TWO_SIDED );
        qglDisable( GL_CLIP_PLANE0 );
 
        // set time for 2D shaders
diff --git a/SP/code/rend2/tr_fbo.c b/SP/code/rend2/tr_fbo.c
index ba145e6..c5c641f 100644
--- a/SP/code/rend2/tr_fbo.c
+++ b/SP/code/rend2/tr_fbo.c
@@ -748,7 +748,7 @@ void FBO_BlitFromTexture(struct image_s *src, ivec4_t 
inSrcBox, vec2_t inSrcTexS
 
        Mat4Ortho(0, width, height, 0, 0, 1, projection);
 
-       qglDisable( GL_CULL_FACE );
+       GL_Cull( CT_TWO_SIDED );
 
        GL_BindToTMU(src, TB_COLORMAP);
 
diff --git a/SP/code/rend2/tr_shadows.c b/SP/code/rend2/tr_shadows.c
index ee7625b..adc4fb8 100644
--- a/SP/code/rend2/tr_shadows.c
+++ b/SP/code/rend2/tr_shadows.c
@@ -218,7 +218,6 @@ void RB_ShadowTessEnd( void ) {
        // draw the silhouette edges
 
        GL_Bind( tr.whiteImage );
-       qglEnable( GL_CULL_FACE );
        GL_State( GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
        qglColor3f( 0.2f, 0.2f, 0.2f );
 
@@ -229,29 +228,15 @@ void RB_ShadowTessEnd( void ) {
        qglEnable( GL_STENCIL_TEST );
        qglStencilFunc( GL_ALWAYS, 1, 255 );
 
-       // mirrors have the culling order reversed
-       if ( backEnd.viewParms.isMirror ) {
-               qglCullFace( GL_FRONT );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
+       GL_Cull( CT_BACK_SIDED );
+       qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
 
-               R_RenderShadowEdges();
+       R_RenderShadowEdges();
 
-               qglCullFace( GL_BACK );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
-
-               R_RenderShadowEdges();
-       } else {
-               qglCullFace( GL_BACK );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
-
-               R_RenderShadowEdges();
-
-               qglCullFace( GL_FRONT );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
-
-               R_RenderShadowEdges();
-       }
+       GL_Cull( CT_FRONT_SIDED );
+       qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
 
+       R_RenderShadowEdges();
 
        // reenable writing to the color buffer
        qglColorMask(rgba[0], rgba[1], rgba[2], rgba[3]);
@@ -279,7 +264,7 @@ void RB_ShadowFinish( void ) {
        qglStencilFunc( GL_NOTEQUAL, 0, 255 );
 
        qglDisable( GL_CLIP_PLANE0 );
-       qglDisable( GL_CULL_FACE );
+       GL_Cull( CT_TWO_SIDED );
 
        GL_Bind( tr.whiteImage );
 
diff --git a/SP/code/renderer/tr_backend.c b/SP/code/renderer/tr_backend.c
index 48bd722..7d6c2b2 100644
--- a/SP/code/renderer/tr_backend.c
+++ b/SP/code/renderer/tr_backend.c
@@ -1158,7 +1158,7 @@ void    RB_SetGL2D( void ) {
 
        qglDisable( GL_FOG ); //----(SA)        added
 
-       qglDisable( GL_CULL_FACE );
+       GL_Cull( CT_TWO_SIDED );
        qglDisable( GL_CLIP_PLANE0 );
 
        // set time for 2D shaders
diff --git a/SP/code/renderer/tr_shadows.c b/SP/code/renderer/tr_shadows.c
index ab27734..6688f1c 100644
--- a/SP/code/renderer/tr_shadows.c
+++ b/SP/code/renderer/tr_shadows.c
@@ -229,7 +229,6 @@ void RB_ShadowTessEnd( void ) {
        // draw the silhouette edges
 
        GL_Bind( tr.whiteImage );
-       qglEnable( GL_CULL_FACE );
        GL_State( GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
 #ifdef VCMODS_OPENGLES
        qglColor4f( 0.2f, 0.2f, 0.2f, 1.0f );
@@ -244,29 +243,15 @@ void RB_ShadowTessEnd( void ) {
        qglEnable( GL_STENCIL_TEST );
        qglStencilFunc( GL_ALWAYS, 1, 255 );
 
-       // mirrors have the culling order reversed
-       if ( backEnd.viewParms.isMirror ) {
-               qglCullFace( GL_FRONT );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
+       GL_Cull( CT_BACK_SIDED );
+       qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
 
-               R_RenderShadowEdges();
+       R_RenderShadowEdges();
 
-               qglCullFace( GL_BACK );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
-
-               R_RenderShadowEdges();
-       } else {
-               qglCullFace( GL_BACK );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
-
-               R_RenderShadowEdges();
-
-               qglCullFace( GL_FRONT );
-               qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
-
-               R_RenderShadowEdges();
-       }
+       GL_Cull( CT_FRONT_SIDED );
+       qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
 
+       R_RenderShadowEdges();
 
        // reenable writing to the color buffer
        qglColorMask(rgba[0], rgba[1], rgba[2], rgba[3]);
@@ -303,7 +288,7 @@ void RB_ShadowFinish( void ) {
        qglStencilFunc( GL_NOTEQUAL, 0, 255 );
 
        qglDisable( GL_CLIP_PLANE0 );
-       qglDisable( GL_CULL_FACE );
+       GL_Cull( CT_TWO_SIDED );
 
        GL_Bind( tr.whiteImage );
 

-- 
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