From a7eb381bbbdd36d08be8e7f76143264672362d6f Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 22 Dec 2003 23:25:33 +0000 Subject: [PATCH] combo graph half-fix (but still wrong) --- stepmania/src/ComboGraph.cpp | 12 ++++++------ stepmania/src/StageStats.cpp | 3 --- stepmania/src/StageStats.h | 6 +++++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/stepmania/src/ComboGraph.cpp b/stepmania/src/ComboGraph.cpp index 2ef6a284fc..8b7c14271a 100644 --- a/stepmania/src/ComboGraph.cpp +++ b/stepmania/src/ComboGraph.cpp @@ -13,16 +13,16 @@ void ComboGraph::Load( CString Path, const StageStats &s, PlayerNumber pn ) int MaxComboSize = 0; unsigned 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; for( i = 0; i < s.ComboList[pn].size(); ++i ) { const StageStats::Combo_t &combo = s.ComboList[pn][i]; - if( combo.cnt < MinComboSizeToShow ) + if( combo.GetStageCnt() < MinComboSizeToShow ) 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); 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 ) { const StageStats::Combo_t &combo = s.ComboList[pn][i]; - if( combo.cnt < MinComboSizeToShow ) + if( combo.GetStageCnt() < MinComboSizeToShow ) continue; /* too small */ - const bool IsMax = (combo.cnt == MaxComboSize); + const bool IsMax = (combo.GetStageCnt() == MaxComboSize); if( !IsMax ) 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 ); 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" ); m_Actors.push_back( text ); diff --git a/stepmania/src/StageStats.cpp b/stepmania/src/StageStats.cpp index bddbe535b6..b57047058b 100644 --- a/stepmania/src/StageStats.cpp +++ b/stepmania/src/StageStats.cpp @@ -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. * Remember it separately. */ if( ComboList[pn].size() == 1 ) - { ComboList[pn][0].rollover = cnt-1; - cnt = 1; - } } Combo_t &combo = ComboList[pn].back(); diff --git a/stepmania/src/StageStats.h b/stepmania/src/StageStats.h index 539f6024a0..75316f3b46 100644 --- a/stepmania/src/StageStats.h +++ b/stepmania/src/StageStats.h @@ -80,9 +80,13 @@ struct StageStats /* Combo size, in steps. */ 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; + /* 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) { } bool IsZero() const { return start < 0; } };