add Actor::hidden flag (better than hiding by setting diffusealpha=0)

This commit is contained in:
Chris Danford
2003-10-22 10:18:46 +00:00
parent ca012307a5
commit 25a3a2e26a
3 changed files with 24 additions and 15 deletions
+4
View File
@@ -46,6 +46,7 @@ void Actor::Reset()
m_effectColor1 = RageColor(1,1,1,1); m_effectColor1 = RageColor(1,1,1,1);
m_effectColor2 = RageColor(1,1,1,1); m_effectColor2 = RageColor(1,1,1,1);
m_bHidden = false;
m_bShadow = false; m_bShadow = false;
m_fShadowLength = 4; m_fShadowLength = 4;
m_bIsAnimating = true; m_bIsAnimating = true;
@@ -66,6 +67,9 @@ Actor::Actor()
void Actor::Draw() void Actor::Draw()
{ {
if( m_bHidden )
return; // early abort
// call the most-derived versions // call the most-derived versions
this->BeginDraw(); this->BeginDraw();
this->DrawPrimitives(); // call the most-derived version of DrawPrimitives(); this->DrawPrimitives(); // call the most-derived version of DrawPrimitives();
+2
View File
@@ -240,6 +240,7 @@ public:
// //
// other properties // other properties
// //
void SetHidden( bool b ) { m_bHidden = b; }
void SetShadowLength( float fLength ); void SetShadowLength( float fLength );
void EnableShadow( bool b ) { m_bShadow = b; } void EnableShadow( bool b ) { m_bShadow = b; }
@@ -324,6 +325,7 @@ protected:
// //
// other properties // other properties
// //
bool m_bHidden;
bool m_bShadow; bool m_bShadow;
float m_fShadowLength; float m_fShadowLength;
bool m_bIsAnimating; bool m_bIsAnimating;
+18 -15
View File
@@ -533,25 +533,28 @@ void ScreenRanking::SetPage( PageToShow pts )
if( pSteps == NULL ) if( pSteps == NULL )
{ m_sprDiffHeaders[d].SetHidden( true );
// set alpha to 0.0 and continue else
m_sprDiffHeaders[d].SetDiffuse( RageColor(1,1,1,0) ); m_sprDiffHeaders[d].SetDiffuse( RageColor(1,1,1,1) );
continue;
}
// set the header visible
m_sprDiffHeaders[d].SetDiffuse( RageColor(1,1,1,1) );
for( int l=0; l<NUM_RANKING_LINES; l++ ) for( int l=0; l<NUM_RANKING_LINES; l++ )
{ {
Steps::MemCardData::HighScore hs; if( pSteps == NULL )
if( l < (int)pSteps->m_MemCardDatas[MEMORY_CARD_MACHINE].vHighScores.size() ) {
hs = pSteps->m_MemCardDatas[MEMORY_CARD_MACHINE].vHighScores[l]; m_textPercent[l][d].SetHidden( true );
if( hs.sName.empty() ) }
hs.sName = EMPTY_SCORE_NAME; else
{
Steps::MemCardData::HighScore hs;
if( l < (int)pSteps->m_MemCardDatas[MEMORY_CARD_MACHINE].vHighScores.size() )
hs = pSteps->m_MemCardDatas[MEMORY_CARD_MACHINE].vHighScores[l];
if( hs.sName.empty() )
hs.sName = EMPTY_SCORE_NAME;
m_textPercent[l][d].SetText( ssprintf("%s\n%0.3f%%", hs.sName.c_str(), hs.fPercentDP*100) ); m_textPercent[l][d].SetText( ssprintf("%s\n%0.3f%%", hs.sName.c_str(), hs.fPercentDP*100) );
m_textPercent[l][d].SetDiffuse( TEXT_COLOR(pts.colorIndex) ); m_textPercent[l][d].SetText( ssprintf("%s\n%0.3f%%", hs.sName.c_str(), hs.fPercentDP*100) );
m_textPercent[l][d].SetDiffuse( TEXT_COLOR(pts.colorIndex) );
}
} }
} }
} }