This commit is contained in:
Glenn Maynard
2005-01-01 22:07:16 +00:00
parent fac13bf393
commit b7487c02a4
+4 -4
View File
@@ -224,8 +224,8 @@ void BitmapText::DrawChars()
/* We fade from 0 to LeftColor, then from RightColor to 0. (We won't fade all the way to
* 0 if the crop is beyond the outer edge.) */
const RageColor RightColor = scale( FadeSize.right, FadeDist.right, 0, RageColor(1,1,1,1), RageColor(1,1,1,0) );
const RageColor LeftColor = scale( FadeSize.left, FadeDist.left, 0, RageColor(1,1,1,1), RageColor(1,1,1,0) );
const float RightAlpha = SCALE( FadeSize.right, FadeDist.right, 0, 1, 0 );
const float LeftAlpha = SCALE( FadeSize.left, FadeDist.left, 0, 1, 0 );
const float StartFadeLeftPercent = m_pTempState->crop.left;
const float StopFadeLeftPercent = m_pTempState->crop.left + FadeSize.left;
@@ -247,7 +247,7 @@ void BitmapText::DrawChars()
* TODO: fade all channels, not just alpha */
float fPercent = SCALE( start+0.5f, fLeftFadeStartGlyph, fLeftFadeStopGlyph, 0.0f, 1.0f );
fPercent = clamp( fPercent, 0.0f, 1.0f );
fPercent *= LeftColor.a;
fPercent *= LeftAlpha;
verts[i+0].c.a = (unsigned char)( verts[i+0].c.a * fPercent ); // top left
verts[i+1].c.a = (unsigned char)( verts[i+1].c.a * fPercent ); // bottom left
@@ -259,7 +259,7 @@ void BitmapText::DrawChars()
{
float fPercent = SCALE( start+0.5f, fRightFadeStartGlyph, fRightFadeStopGlyph, 1.0f, 0.0f );
fPercent = clamp( fPercent, 0.0f, 1.0f );
fPercent *= RightColor.a;
fPercent *= RightAlpha;
verts[i+0].c.a = (unsigned char)( verts[i+0].c.a * fPercent ); // top left
verts[i+1].c.a = (unsigned char)( verts[i+1].c.a * fPercent ); // bottom left