combo graph half-fix (but still wrong)

This commit is contained in:
Glenn Maynard
2003-12-22 23:25:33 +00:00
parent 066e1a94b9
commit a7eb381bbb
3 changed files with 11 additions and 10 deletions
+6 -6
View File
@@ -13,16 +13,16 @@ void ComboGraph::Load( CString Path, const StageStats &s, PlayerNumber pn )
int MaxComboSize = 0; int MaxComboSize = 0;
unsigned i; unsigned i;
for( i = 0; i < s.ComboList[pn].size(); ++i ) for( i = 0; i < s.ComboList[pn].size(); ++i )
MaxComboSize = max( MaxComboSize, s.ComboList[pn][i].cnt ); MaxComboSize = max( MaxComboSize, s.ComboList[pn][i].GetStageCnt() );
float width = -1; float width = -1;
for( i = 0; i < s.ComboList[pn].size(); ++i ) for( i = 0; i < s.ComboList[pn].size(); ++i )
{ {
const StageStats::Combo_t &combo = s.ComboList[pn][i]; const StageStats::Combo_t &combo = s.ComboList[pn][i];
if( combo.cnt < MinComboSizeToShow ) if( combo.GetStageCnt() < MinComboSizeToShow )
continue; /* too small */ continue; /* too small */
const bool IsMax = (combo.cnt == MaxComboSize); const bool IsMax = (combo.GetStageCnt() == MaxComboSize);
LOG->Trace("combo %i is %f+%f", i, combo.start, combo.size); LOG->Trace("combo %i is %f+%f", i, combo.start, combo.size);
Sprite *sprite = new Sprite; Sprite *sprite = new Sprite;
@@ -48,10 +48,10 @@ void ComboGraph::Load( CString Path, const StageStats &s, PlayerNumber pn )
for( i = 0; i < s.ComboList[pn].size(); ++i ) for( i = 0; i < s.ComboList[pn].size(); ++i )
{ {
const StageStats::Combo_t &combo = s.ComboList[pn][i]; const StageStats::Combo_t &combo = s.ComboList[pn][i];
if( combo.cnt < MinComboSizeToShow ) if( combo.GetStageCnt() < MinComboSizeToShow )
continue; /* too small */ continue; /* too small */
const bool IsMax = (combo.cnt == MaxComboSize); const bool IsMax = (combo.GetStageCnt() == MaxComboSize);
if( !IsMax ) if( !IsMax )
continue; continue;
@@ -65,7 +65,7 @@ void ComboGraph::Load( CString Path, const StageStats &s, PlayerNumber pn )
const float CenterXPos = SCALE( CenterPercent, 0.0f, 1.0f, -width/2.0f, width/2.0f ); const float CenterXPos = SCALE( CenterPercent, 0.0f, 1.0f, -width/2.0f, width/2.0f );
text->SetX( CenterXPos ); text->SetX( CenterXPos );
text->SetText( ssprintf("%i",combo.cnt) ); text->SetText( ssprintf("%i",combo.GetStageCnt()) );
text->Command( "diffusealpha,0;sleep,.5f;linear,.3;diffusealpha,1" ); text->Command( "diffusealpha,0;sleep,.5f;linear,.3;diffusealpha,1" );
m_Actors.push_back( text ); m_Actors.push_back( text );
-3
View File
@@ -316,10 +316,7 @@ void StageStats::UpdateComboList( PlayerNumber pn, float pos )
* then that extra part of the combo must have come from a previous song. * then that extra part of the combo must have come from a previous song.
* Remember it separately. */ * Remember it separately. */
if( ComboList[pn].size() == 1 ) if( ComboList[pn].size() == 1 )
{
ComboList[pn][0].rollover = cnt-1; ComboList[pn][0].rollover = cnt-1;
cnt = 1;
}
} }
Combo_t &combo = ComboList[pn].back(); Combo_t &combo = ComboList[pn].back();
+5 -1
View File
@@ -80,9 +80,13 @@ struct StageStats
/* Combo size, in steps. */ /* Combo size, in steps. */
int cnt; int cnt;
/* Combo rollover from the last song (see UpdateComboList for details). */ /* Size of the combo that didn't come from this stage (rollover from the last song).
* (This is a subset of cnt.) */
int rollover; int rollover;
/* Get the size of the combo that came from this song. */
int GetStageCnt() const { return cnt - rollover; }
Combo_t(): start(0), size(0), cnt(0), rollover(0) { } Combo_t(): start(0), size(0), cnt(0), rollover(0) { }
bool IsZero() const { return start < 0; } bool IsZero() const { return start < 0; }
}; };