2x overdraw on the whole life meter stream so that translucency is even

This commit is contained in:
Chris Danford
2005-04-30 00:23:47 +00:00
parent 783a08b58c
commit 05757f9d46
4 changed files with 28 additions and 7 deletions
+4 -1
View File
@@ -80,7 +80,10 @@ LifeMeterBar::LifeMeterBar()
NUM_CHAMBERS,
THEME->GetPathG(sType,sExtra+"normal"),
THEME->GetPathG(sType,sExtra+"hot"),
THEME->GetPathG(sType,sExtra+"passing")
THEME->GetPathG(sType,sExtra+"passing"),
THEME->GetMetricA(sType,"StreamNormalOnCommand"),
THEME->GetMetricA(sType,"StreamHotOnCommand"),
THEME->GetMetricA(sType,"StreamPassingOnCommand")
);
this->AddChild( m_pStream );
+4 -1
View File
@@ -54,7 +54,10 @@ void LifeMeterTime::Load( PlayerNumber pn )
NUM_CHAMBERS,
THEME->GetPathG(sType,sExtra+"normal"),
THEME->GetPathG(sType,sExtra+"hot"),
THEME->GetPathG(sType,sExtra+"passing")
THEME->GetPathG(sType,sExtra+"passing"),
THEME->GetMetricA(sType,"StreamNormalOnCommand"),
THEME->GetMetricA(sType,"StreamHotOnCommand"),
THEME->GetMetricA(sType,"StreamPassingOnCommand")
);
this->AddChild( m_pStream );
+16 -4
View File
@@ -10,7 +10,10 @@ void StreamDisplay::Load(
int iNumChambers,
const CString &sNormalPath,
const CString &sHotPath,
const CString &sPassingPath
const CString &sPassingPath,
const apActorCommands &acNormalOnCommand,
const apActorCommands &acHotOnCommand,
const apActorCommands &acPassingOnCommand
)
{
m_fMeterWidth = fMeterWidth;
@@ -30,14 +33,17 @@ void StreamDisplay::Load(
ID.filename = sNormalPath;
m_sprStreamNormal.Load( ID );
m_sprStreamNormal.SetUseZBuffer( true );
m_sprStreamNormal.RunCommands( acNormalOnCommand );
ID.filename = sHotPath;
m_sprStreamHot.Load( ID );
m_sprStreamHot.SetUseZBuffer( true );
m_sprStreamHot.RunCommands( acHotOnCommand );
ID.filename = sPassingPath;
m_sprStreamPassing.Load( ID );
m_sprStreamPassing.SetUseZBuffer( true );
m_sprStreamPassing.RunCommands( acPassingOnCommand );
}
void StreamDisplay::Update( float fDeltaSecs )
@@ -89,7 +95,7 @@ void StreamDisplay::DrawPrimitives()
float fPercentOffset = fmodf( GAMESTATE->m_fSongBeat/4+1000, fPercentBetweenStrips );
ASSERT( fPercentOffset >= 0 && fPercentOffset <= fPercentBetweenStrips );
for( float f=fPercentOffset+1; f>=0; f-=fPercentBetweenStrips )
for( float f=fPercentOffset+2; f>=0; f-=fPercentBetweenStrips )
{
DrawMask( f );
DrawStrip( f );
@@ -187,14 +193,20 @@ void StreamDisplay::DrawStrip( float fRightEdgePercent )
m_sprStreamPassing.SetCustomTextureRect( frectCustomTexRect );
m_sprStreamHot.SetCustomTextureRect( frectCustomTexRect );
m_sprStreamPassing.SetDiffuse( RageColor(1,1,1,m_fPassingAlpha) );
m_sprStreamHot.SetDiffuse( RageColor(1,1,1,m_fHotAlpha) );
float fOrigPassingAlpha = m_sprStreamPassing.GetDiffuse().a;
float fOrigHotAlpha = m_sprStreamHot.GetDiffuse().a;
m_sprStreamPassing.SetDiffuseAlpha( m_fPassingAlpha * fOrigPassingAlpha );
m_sprStreamHot.SetDiffuseAlpha( m_fHotAlpha * fOrigHotAlpha );
if( m_fPassingAlpha < 1 && m_fHotAlpha < 1)
m_sprStreamNormal.Draw();
if( m_fHotAlpha < 1)
m_sprStreamPassing.Draw();
m_sprStreamHot.Draw();
m_sprStreamPassing.SetDiffuseAlpha( fOrigPassingAlpha );
m_sprStreamHot.SetDiffuseAlpha( fOrigHotAlpha );
}
void StreamDisplay::DrawMask( float fPercent )
+4 -1
View File
@@ -27,7 +27,10 @@ public:
int iNumChambers,
const CString &sNormalPath,
const CString &sHotPath,
const CString &sPassingPath
const CString &sPassingPath,
const apActorCommands &acNormalOnCommand,
const apActorCommands &acHotOnCommand,
const apActorCommands &acPassingOnCommand
);
void DrawPrimitives();