remove separate glow modes
This commit is contained in:
@@ -482,7 +482,7 @@ void BitmapText::DrawPrimitives()
|
||||
/* render the glow pass */
|
||||
if( m_pTempState->glow.a > 0.0001f )
|
||||
{
|
||||
DISPLAY->SetTextureModeGlow(m_pTempState->glowmode);
|
||||
DISPLAY->SetTextureModeGlow();
|
||||
|
||||
for( unsigned i=0; i<verts.size(); i++ )
|
||||
verts[i].c = m_pTempState->glow;
|
||||
|
||||
@@ -184,7 +184,7 @@ public:
|
||||
virtual int GetNumTextureUnits() = 0;
|
||||
virtual void SetTexture( int iTextureUnitIndex, RageTexture* pTexture ) = 0;
|
||||
virtual void SetTextureModeModulate() = 0;
|
||||
virtual void SetTextureModeGlow( GlowMode m=GLOW_WHITEN ) = 0;
|
||||
virtual void SetTextureModeGlow() = 0;
|
||||
virtual void SetTextureModeAdd() = 0;
|
||||
virtual void SetTextureWrapping( bool b ) = 0;
|
||||
virtual int GetMaxTextureSize() const = 0;
|
||||
|
||||
@@ -999,7 +999,7 @@ void RageDisplay_D3D::SetTextureModeModulate()
|
||||
g_pd3dDevice->SetTextureStageState( g_iCurrentTextureIndex, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
|
||||
}
|
||||
|
||||
void RageDisplay_D3D::SetTextureModeGlow(GlowMode m)
|
||||
void RageDisplay_D3D::SetTextureModeGlow()
|
||||
{
|
||||
if( g_iCurrentTextureIndex >= (int) g_DeviceCaps.MaxSimultaneousTextures ) // not supported
|
||||
return;
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
int GetNumTextureUnits();
|
||||
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture );
|
||||
void SetTextureModeModulate();
|
||||
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN );
|
||||
void SetTextureModeGlow();
|
||||
void SetTextureModeAdd();
|
||||
void SetTextureWrapping( bool b );
|
||||
int GetMaxTextureSize() const;
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
int GetNumTextureUnits() { return 1; }
|
||||
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture ) { }
|
||||
void SetTextureModeModulate() { }
|
||||
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN ) { }
|
||||
void SetTextureModeGlow() { }
|
||||
void SetTextureModeAdd() { }
|
||||
void SetTextureWrapping( bool b ) { }
|
||||
int GetMaxTextureSize() const { return 2048; }
|
||||
|
||||
@@ -1344,31 +1344,27 @@ void RageDisplay_OGL::SetTextureModeModulate()
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetTextureModeGlow(GlowMode m)
|
||||
void RageDisplay_OGL::SetTextureModeGlow()
|
||||
{
|
||||
if(m == GLOW_WHITEN && !g_bEXT_texture_env_combine)
|
||||
m = GLOW_BRIGHTEN; /* we can't do GLOW_WHITEN */
|
||||
|
||||
switch(m)
|
||||
if( !g_bEXT_texture_env_combine )
|
||||
{
|
||||
case GLOW_BRIGHTEN:
|
||||
/* This is changing blend state, instead of texture state, which isn't
|
||||
* great, but it's better than doing nothing. */
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
|
||||
return;
|
||||
|
||||
case GLOW_WHITEN:
|
||||
/* Source color is the diffuse color only: */
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_COMBINE_RGB_EXT), GL_REPLACE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE0_RGB_EXT), GL_PRIMARY_COLOR_EXT);
|
||||
|
||||
/* Source alpha is texture alpha * diffuse alpha: */
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_COMBINE_ALPHA_EXT), GL_MODULATE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_OPERAND0_ALPHA_EXT), GL_SRC_ALPHA);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE0_ALPHA_EXT), GL_PRIMARY_COLOR_EXT);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_OPERAND1_ALPHA_EXT), GL_SRC_ALPHA);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE1_ALPHA_EXT), GL_TEXTURE);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Source color is the diffuse color only: */
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_COMBINE_RGB_EXT), GL_REPLACE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE0_RGB_EXT), GL_PRIMARY_COLOR_EXT);
|
||||
|
||||
/* Source alpha is texture alpha * diffuse alpha: */
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_COMBINE_ALPHA_EXT), GL_MODULATE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_OPERAND0_ALPHA_EXT), GL_SRC_ALPHA);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE0_ALPHA_EXT), GL_PRIMARY_COLOR_EXT);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_OPERAND1_ALPHA_EXT), GL_SRC_ALPHA);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE1_ALPHA_EXT), GL_TEXTURE);
|
||||
}
|
||||
|
||||
void RageDisplay_OGL::SetTextureModeAdd()
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
int GetNumTextureUnits();
|
||||
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture );
|
||||
void SetTextureModeModulate();
|
||||
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN );
|
||||
void SetTextureModeGlow();
|
||||
void SetTextureModeAdd();
|
||||
void SetTextureWrapping( bool b );
|
||||
int GetMaxTextureSize() const;
|
||||
|
||||
@@ -511,7 +511,7 @@ void Sprite::DrawTexture( const TweenState *state )
|
||||
//////////////////////
|
||||
if( state->glow.a > 0.0001f )
|
||||
{
|
||||
DISPLAY->SetTextureModeGlow(state->glowmode);
|
||||
DISPLAY->SetTextureModeGlow();
|
||||
v[0].c = v[1].c = v[2].c = v[3].c = state->glow;
|
||||
DISPLAY->DrawQuad( v );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user