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