consolidate Enable/DisableTextureWrapping
This commit is contained in:
@@ -391,7 +391,7 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
|
||||
DISPLAY->SetTextureModeGlow();
|
||||
else
|
||||
DISPLAY->SetTextureModeModulate();
|
||||
DISPLAY->DisableTextureWrapping();
|
||||
DISPLAY->EnableTextureWrapping(false);
|
||||
|
||||
const float fFrameWidth = pBottomCap->GetUnzoomedWidth();
|
||||
const float fFrameHeight = pBottomCap->GetUnzoomedHeight();
|
||||
@@ -534,7 +534,7 @@ void NoteDisplay::DrawHold( const HoldNote& hn, const bool bActive, const float
|
||||
DISPLAY->SetTextureModeGlow();
|
||||
else
|
||||
DISPLAY->SetTextureModeModulate();
|
||||
DISPLAY->DisableTextureWrapping();
|
||||
DISPLAY->EnableTextureWrapping(false);
|
||||
|
||||
const float fFrameWidth = pSprTopCap->GetUnzoomedWidth();
|
||||
const float fFrameHeight = pSprTopCap->GetUnzoomedHeight();
|
||||
|
||||
@@ -803,13 +803,9 @@ void RageDisplay::DisableZBuffer()
|
||||
{
|
||||
glDisable( GL_DEPTH_TEST );
|
||||
}
|
||||
void RageDisplay::EnableTextureWrapping()
|
||||
void RageDisplay::EnableTextureWrapping(bool yes)
|
||||
{
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
|
||||
}
|
||||
void RageDisplay::DisableTextureWrapping()
|
||||
{
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
|
||||
GLenum mode = yes? GL_REPEAT:GL_CLAMP;
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, mode );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, mode );
|
||||
}
|
||||
|
||||
@@ -65,8 +65,7 @@ public:
|
||||
bool ZBufferEnabled() const;
|
||||
void EnableZBuffer();
|
||||
void DisableZBuffer();
|
||||
void EnableTextureWrapping();
|
||||
void DisableTextureWrapping();
|
||||
void EnableTextureWrapping(bool yes=true);
|
||||
|
||||
void DrawQuad( const RageVertex v[4] ); // upper-left, upper-right, lower-left, lower-right
|
||||
void DrawQuads( const RageVertex v[], int iNumVerts );
|
||||
|
||||
@@ -257,6 +257,7 @@ void Sprite::DrawPrimitives()
|
||||
v[2].t = RageVector2( m_CustomTexCoords[4], m_CustomTexCoords[5] ); // bottom right
|
||||
v[3].t = RageVector2( m_CustomTexCoords[6], m_CustomTexCoords[7] ); // top right
|
||||
|
||||
/* XXX: Why don't we honor m_bTextureWrapping when using custom coords? */
|
||||
DISPLAY->EnableTextureWrapping();
|
||||
}
|
||||
else
|
||||
@@ -268,10 +269,7 @@ void Sprite::DrawPrimitives()
|
||||
v[2].t = RageVector2( pTexCoordRect->right, pTexCoordRect->bottom ); // bottom right
|
||||
v[3].t = RageVector2( pTexCoordRect->right, pTexCoordRect->top ); // top right
|
||||
|
||||
if( m_bTextureWrapping )
|
||||
DISPLAY->EnableTextureWrapping();
|
||||
else
|
||||
DISPLAY->DisableTextureWrapping();
|
||||
DISPLAY->EnableTextureWrapping(m_bTextureWrapping);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user