add StrokeIsUnder font option

This commit is contained in:
Chris Danford
2008-05-05 22:34:34 +00:00
parent 2ed5c7eff8
commit 4d30695f08
3 changed files with 26 additions and 7 deletions
+22 -7
View File
@@ -517,6 +517,18 @@ bool BitmapText::EarlyAbortDraw() const
return m_wTextLines.empty();
}
#define DRAW_STROKE \
bool bUsingStrokeTexture = !!m_vpFontPageTextures[0]->m_pTextureStroke; \
if( bUsingStrokeTexture && m_StrokeColor.a > 0 ) \
{ \
RageColor c = m_StrokeColor; \
c.a *= m_pTempState->diffuse[0].a; \
for( unsigned i=0; i<m_aVertices.size(); i++ ) \
m_aVertices[i].c = c; \
DrawChars( true ); \
}
// draw text at x, y using colorTop blended down to colorBottom, with size multiplied by scale
void BitmapText::DrawPrimitives()
{
@@ -543,6 +555,14 @@ void BitmapText::DrawPrimitives()
DISPLAY->PopMatrix();
}
//
// render the stroke
//
if( m_pFont->GetStrokeIsUnder() )
{
DRAW_STROKE;
}
//
// render the diffuse pass
//
@@ -633,14 +653,9 @@ void BitmapText::DrawPrimitives()
//
// render the stroke
//
bool bUsingStrokeTexture = !!m_vpFontPageTextures[0]->m_pTextureStroke;
if( bUsingStrokeTexture && m_StrokeColor.a > 0 )
if( !m_pFont->GetStrokeIsUnder() )
{
RageColor c = m_StrokeColor;
c.a *= m_pTempState->diffuse[0].a;
for( unsigned i=0; i<m_aVertices.size(); i++ )
m_aVertices[i].c = c;
DrawChars( true );
DRAW_STROKE;
}
}