remove separate glow modes
This commit is contained in:
@@ -482,7 +482,7 @@ void BitmapText::DrawPrimitives()
|
|||||||
/* render the glow pass */
|
/* render the glow pass */
|
||||||
if( m_pTempState->glow.a > 0.0001f )
|
if( m_pTempState->glow.a > 0.0001f )
|
||||||
{
|
{
|
||||||
DISPLAY->SetTextureModeGlow(m_pTempState->glowmode);
|
DISPLAY->SetTextureModeGlow();
|
||||||
|
|
||||||
for( unsigned i=0; i<verts.size(); i++ )
|
for( unsigned i=0; i<verts.size(); i++ )
|
||||||
verts[i].c = m_pTempState->glow;
|
verts[i].c = m_pTempState->glow;
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ public:
|
|||||||
virtual int GetNumTextureUnits() = 0;
|
virtual int GetNumTextureUnits() = 0;
|
||||||
virtual void SetTexture( int iTextureUnitIndex, RageTexture* pTexture ) = 0;
|
virtual void SetTexture( int iTextureUnitIndex, RageTexture* pTexture ) = 0;
|
||||||
virtual void SetTextureModeModulate() = 0;
|
virtual void SetTextureModeModulate() = 0;
|
||||||
virtual void SetTextureModeGlow( GlowMode m=GLOW_WHITEN ) = 0;
|
virtual void SetTextureModeGlow() = 0;
|
||||||
virtual void SetTextureModeAdd() = 0;
|
virtual void SetTextureModeAdd() = 0;
|
||||||
virtual void SetTextureWrapping( bool b ) = 0;
|
virtual void SetTextureWrapping( bool b ) = 0;
|
||||||
virtual int GetMaxTextureSize() const = 0;
|
virtual int GetMaxTextureSize() const = 0;
|
||||||
|
|||||||
@@ -999,7 +999,7 @@ void RageDisplay_D3D::SetTextureModeModulate()
|
|||||||
g_pd3dDevice->SetTextureStageState( g_iCurrentTextureIndex, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
|
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
|
if( g_iCurrentTextureIndex >= (int) g_DeviceCaps.MaxSimultaneousTextures ) // not supported
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public:
|
|||||||
int GetNumTextureUnits();
|
int GetNumTextureUnits();
|
||||||
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture );
|
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture );
|
||||||
void SetTextureModeModulate();
|
void SetTextureModeModulate();
|
||||||
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN );
|
void SetTextureModeGlow();
|
||||||
void SetTextureModeAdd();
|
void SetTextureModeAdd();
|
||||||
void SetTextureWrapping( bool b );
|
void SetTextureWrapping( bool b );
|
||||||
int GetMaxTextureSize() const;
|
int GetMaxTextureSize() const;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
int GetNumTextureUnits() { return 1; }
|
int GetNumTextureUnits() { return 1; }
|
||||||
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture ) { }
|
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture ) { }
|
||||||
void SetTextureModeModulate() { }
|
void SetTextureModeModulate() { }
|
||||||
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN ) { }
|
void SetTextureModeGlow() { }
|
||||||
void SetTextureModeAdd() { }
|
void SetTextureModeAdd() { }
|
||||||
void SetTextureWrapping( bool b ) { }
|
void SetTextureWrapping( bool b ) { }
|
||||||
int GetMaxTextureSize() const { return 2048; }
|
int GetMaxTextureSize() const { return 2048; }
|
||||||
|
|||||||
@@ -1344,18 +1344,16 @@ void RageDisplay_OGL::SetTextureModeModulate()
|
|||||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
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)
|
if( !g_bEXT_texture_env_combine )
|
||||||
m = GLOW_BRIGHTEN; /* we can't do GLOW_WHITEN */
|
|
||||||
|
|
||||||
switch(m)
|
|
||||||
{
|
{
|
||||||
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 );
|
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
case GLOW_WHITEN:
|
|
||||||
/* Source color is the diffuse color only: */
|
/* Source color is the diffuse color only: */
|
||||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
|
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_COMBINE_RGB_EXT), GL_REPLACE);
|
||||||
@@ -1367,8 +1365,6 @@ void RageDisplay_OGL::SetTextureModeGlow(GlowMode m)
|
|||||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE0_ALPHA_EXT), GL_PRIMARY_COLOR_EXT);
|
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_OPERAND1_ALPHA_EXT), GL_SRC_ALPHA);
|
||||||
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE1_ALPHA_EXT), GL_TEXTURE);
|
glTexEnvi(GL_TEXTURE_ENV, GLenum(GL_SOURCE1_ALPHA_EXT), GL_TEXTURE);
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RageDisplay_OGL::SetTextureModeAdd()
|
void RageDisplay_OGL::SetTextureModeAdd()
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public:
|
|||||||
int GetNumTextureUnits();
|
int GetNumTextureUnits();
|
||||||
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture );
|
void SetTexture( int iTextureUnitIndex, RageTexture* pTexture );
|
||||||
void SetTextureModeModulate();
|
void SetTextureModeModulate();
|
||||||
void SetTextureModeGlow( GlowMode m=GLOW_WHITEN );
|
void SetTextureModeGlow();
|
||||||
void SetTextureModeAdd();
|
void SetTextureModeAdd();
|
||||||
void SetTextureWrapping( bool b );
|
void SetTextureWrapping( bool b );
|
||||||
int GetMaxTextureSize() const;
|
int GetMaxTextureSize() const;
|
||||||
|
|||||||
@@ -511,7 +511,7 @@ void Sprite::DrawTexture( const TweenState *state )
|
|||||||
//////////////////////
|
//////////////////////
|
||||||
if( state->glow.a > 0.0001f )
|
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;
|
v[0].c = v[1].c = v[2].c = v[3].c = state->glow;
|
||||||
DISPLAY->DrawQuad( v );
|
DISPLAY->DrawQuad( v );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user