This commit is contained in:
Glenn Maynard
2005-09-11 21:18:22 +00:00
parent a3da8338a6
commit 047339c369
+19 -19
View File
@@ -51,9 +51,9 @@ void ComboGraph::Load( const StageStats &s, const PlayerStageStats &pss )
const float fLastSecond = s.GetTotalPossibleStepsSeconds(); const float fLastSecond = s.GetTotalPossibleStepsSeconds();
/* Find the largest combo. */ /* Find the largest combo. */
int MaxComboSize = 0; int iMaxComboSize = 0;
for( unsigned i = 0; i < pss.ComboList.size(); ++i ) for( unsigned i = 0; i < pss.ComboList.size(); ++i )
MaxComboSize = max( MaxComboSize, pss.ComboList[i].GetStageCnt() ); iMaxComboSize = max( iMaxComboSize, pss.ComboList[i].GetStageCnt() );
for( unsigned i = 0; i < pss.ComboList.size(); ++i ) for( unsigned i = 0; i < pss.ComboList.size(); ++i )
{ {
@@ -61,20 +61,20 @@ void ComboGraph::Load( const StageStats &s, const PlayerStageStats &pss )
if( combo.GetStageCnt() < MinComboSizeToShow ) if( combo.GetStageCnt() < MinComboSizeToShow )
continue; /* too small */ continue; /* too small */
const bool IsMax = (combo.GetStageCnt() == MaxComboSize); const bool bIsMax = (combo.GetStageCnt() == iMaxComboSize);
LOG->Trace("combo %i is %f+%f", i, combo.fStartSecond, combo.fSizeSeconds); LOG->Trace( "combo %i is %f+%f of %f", i, combo.fStartSecond, combo.fSizeSeconds, fLastSecond );
Actor *sprite = IsMax? m_pMaxCombo->Copy():m_pNormalCombo->Copy(); Actor *pSprite = bIsMax? m_pMaxCombo->Copy():m_pNormalCombo->Copy();
const float start = SCALE( combo.fStartSecond, fFirstSecond, fLastSecond, 0.0f, 1.0f ); const float fStart = SCALE( combo.fStartSecond, fFirstSecond, fLastSecond, 0.0f, 1.0f );
const float size = SCALE( combo.fSizeSeconds, 0, fLastSecond-fFirstSecond, 0.0f, 1.0f ); const float fSize = SCALE( combo.fSizeSeconds, 0, fLastSecond-fFirstSecond, 0.0f, 1.0f );
sprite->SetCropLeft ( SCALE( size, 0.0f, 1.0f, 0.5f, 0.0f ) ); pSprite->SetCropLeft ( SCALE( fSize, 0.0f, 1.0f, 0.5f, 0.0f ) );
sprite->SetCropRight( SCALE( size, 0.0f, 1.0f, 0.5f, 0.0f ) ); pSprite->SetCropRight( SCALE( fSize, 0.0f, 1.0f, 0.5f, 0.0f ) );
sprite->SetCropLeft( start ); pSprite->SetCropLeft( fStart );
sprite->SetCropRight( 1 - (size + start) ); pSprite->SetCropRight( 1 - (fSize + fStart) );
this->AddChild( sprite ); this->AddChild( pSprite );
} }
for( unsigned i = 0; i < pss.ComboList.size(); ++i ) for( unsigned i = 0; i < pss.ComboList.size(); ++i )
@@ -83,14 +83,14 @@ void ComboGraph::Load( const StageStats &s, const PlayerStageStats &pss )
if( combo.GetStageCnt() < MinComboSizeToShow ) if( combo.GetStageCnt() < MinComboSizeToShow )
continue; /* too small */ continue; /* too small */
if( !MaxComboSize ) if( !iMaxComboSize )
continue; continue;
const bool IsMax = (combo.GetStageCnt() == MaxComboSize); const bool bIsMax = (combo.GetStageCnt() == iMaxComboSize);
if( !IsMax ) if( !bIsMax )
continue; continue;
BitmapText *text = (BitmapText *) m_MaxComboText.Copy(); // XXX Copy should be covariant BitmapText *pText = (BitmapText *) m_MaxComboText.Copy(); // XXX Copy should be covariant
const float start = SCALE( combo.fStartSecond, fFirstSecond, fLastSecond, 0.0f, 1.0f ); const float start = SCALE( combo.fStartSecond, fFirstSecond, fLastSecond, 0.0f, 1.0f );
const float size = SCALE( combo.fSizeSeconds, 0, fLastSecond-fFirstSecond, 0.0f, 1.0f ); const float size = SCALE( combo.fSizeSeconds, 0, fLastSecond-fFirstSecond, 0.0f, 1.0f );
@@ -98,11 +98,11 @@ void ComboGraph::Load( const StageStats &s, const PlayerStageStats &pss )
const float fWidth = m_pNormalCombo->GetUnzoomedWidth(); const float fWidth = m_pNormalCombo->GetUnzoomedWidth();
const float CenterPercent = start + size/2; const float CenterPercent = start + size/2;
const float CenterXPos = SCALE( CenterPercent, 0.0f, 1.0f, -fWidth/2.0f, fWidth/2.0f ); const float CenterXPos = SCALE( CenterPercent, 0.0f, 1.0f, -fWidth/2.0f, fWidth/2.0f );
text->SetX( CenterXPos ); pText->SetX( CenterXPos );
text->SetText( ssprintf("%i",combo.GetStageCnt()) ); pText->SetText( ssprintf("%i",combo.GetStageCnt()) );
this->AddChild( text ); this->AddChild( pText );
} }
} }