#6077: OpenGL2: Add r_ignoreDstAlpha.

This commit is contained in:
SmileTheory 2013-12-17 04:08:25 -08:00
parent 1a86229538
commit bc2efc4870
3 changed files with 15 additions and 0 deletions

View file

@ -159,6 +159,7 @@ cvar_t *r_shadowMapSize;
cvar_t *r_shadowCascadeZNear;
cvar_t *r_shadowCascadeZFar;
cvar_t *r_shadowCascadeZBias;
cvar_t *r_ignoreDstAlpha;
cvar_t *r_ignoreGLErrors;
cvar_t *r_logFile;
@ -1215,6 +1216,7 @@ void R_Register( void )
r_shadowCascadeZNear = ri.Cvar_Get( "r_shadowCascadeZNear", "4", CVAR_ARCHIVE | CVAR_LATCH );
r_shadowCascadeZFar = ri.Cvar_Get( "r_shadowCascadeZFar", "3072", CVAR_ARCHIVE | CVAR_LATCH );
r_shadowCascadeZBias = ri.Cvar_Get( "r_shadowCascadeZBias", "-320", CVAR_ARCHIVE | CVAR_LATCH );
r_ignoreDstAlpha = ri.Cvar_Get( "r_ignoreDstAlpha", "1", CVAR_ARCHIVE | CVAR_LATCH );
//
// temporary latched variables that can only change over a restart

View file

@ -1816,6 +1816,7 @@ extern cvar_t *r_shadowMapSize;
extern cvar_t *r_shadowCascadeZNear;
extern cvar_t *r_shadowCascadeZFar;
extern cvar_t *r_shadowCascadeZBias;
extern cvar_t *r_ignoreDstAlpha;
extern cvar_t *r_greyscale;

View file

@ -203,10 +203,16 @@ static int NameToSrcBlendMode( const char *name )
}
else if ( !Q_stricmp( name, "GL_DST_ALPHA" ) )
{
if (r_ignoreDstAlpha->integer)
return GLS_SRCBLEND_ONE;
return GLS_SRCBLEND_DST_ALPHA;
}
else if ( !Q_stricmp( name, "GL_ONE_MINUS_DST_ALPHA" ) )
{
if (r_ignoreDstAlpha->integer)
return GLS_SRCBLEND_ZERO;
return GLS_SRCBLEND_ONE_MINUS_DST_ALPHA;
}
else if ( !Q_stricmp( name, "GL_SRC_ALPHA_SATURATE" ) )
@ -243,10 +249,16 @@ static int NameToDstBlendMode( const char *name )
}
else if ( !Q_stricmp( name, "GL_DST_ALPHA" ) )
{
if (r_ignoreDstAlpha->integer)
return GLS_DSTBLEND_ONE;
return GLS_DSTBLEND_DST_ALPHA;
}
else if ( !Q_stricmp( name, "GL_ONE_MINUS_DST_ALPHA" ) )
{
if (r_ignoreDstAlpha->integer)
return GLS_DSTBLEND_ZERO;
return GLS_DSTBLEND_ONE_MINUS_DST_ALPHA;
}
else if ( !Q_stricmp( name, "GL_SRC_COLOR" ) )