From 33899d03d61709caa586f93b6bdff2adf4d4d09e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 23 Dec 2003 04:44:34 +0000 Subject: [PATCH] combo graph fix --- stepmania/src/ComboGraph.cpp | 3 +++ stepmania/src/Player.cpp | 2 +- stepmania/src/ScreenEvaluation.cpp | 8 ++++---- stepmania/src/ScreenGameplay.cpp | 3 +++ stepmania/src/StageStats.cpp | 13 ++++++------- stepmania/src/StageStats.h | 2 +- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/stepmania/src/ComboGraph.cpp b/stepmania/src/ComboGraph.cpp index 0461577402..3f3eea9003 100644 --- a/stepmania/src/ComboGraph.cpp +++ b/stepmania/src/ComboGraph.cpp @@ -52,6 +52,9 @@ void ComboGraph::Load( CString Path, const StageStats &s, PlayerNumber pn ) if( combo.GetStageCnt() < MinComboSizeToShow ) continue; /* too small */ + if( !MaxComboSize ) + continue; + const bool IsMax = (combo.GetStageCnt() == MaxComboSize); if( !IsMax ) continue; diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index fba00c7e9a..6e4d55099f 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -1151,7 +1151,7 @@ void PlayerMinus::HandleTapRowScore( unsigned row ) /* Use the real current beat, not the beat we've been passed. That's because we * want to record the current life/combo to the current time; eg. if it's a MISS, * the beat we're registering is in the past, but the life is changing now. */ - g_CurStageStats.UpdateComboList( m_PlayerNumber, GAMESTATE->m_fSongBeat ); + g_CurStageStats.UpdateComboList( m_PlayerNumber, GAMESTATE->m_fSongBeat, false ); float life = -1; if( m_pLifeMeter ) diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index f3faf01fa2..88b717b691 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -115,13 +115,13 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName ) : Screen(sClassName) } g_CurStageStats.iCurCombo[PLAYER_1] = 0; - g_CurStageStats.UpdateComboList( PLAYER_1, 0 ); + g_CurStageStats.UpdateComboList( PLAYER_1, 0, false ); g_CurStageStats.iCurCombo[PLAYER_1] = 1; - g_CurStageStats.UpdateComboList( PLAYER_1, 1 ); + g_CurStageStats.UpdateComboList( PLAYER_1, 1, false ); g_CurStageStats.iCurCombo[PLAYER_1] = 50; - g_CurStageStats.UpdateComboList( PLAYER_1, 25 ); + g_CurStageStats.UpdateComboList( PLAYER_1, 25, false ); g_CurStageStats.iCurCombo[PLAYER_1] = 250; - g_CurStageStats.UpdateComboList( PLAYER_1, 100 ); + g_CurStageStats.UpdateComboList( PLAYER_1, 100, false ); } LOG->Trace( "ScreenEvaluation::ScreenEvaluation()" ); diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index ff62a7ba8c..62f127adfb 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -214,6 +214,9 @@ ScreenGameplay::ScreenGameplay( CString sName, bool bDemonstration ) : Screen("S ASSERT( !m_apNotesQueue[p].empty() ); g_CurStageStats.pSteps[p] = m_apNotesQueue[p][0]; g_CurStageStats.iMeter[p] = m_apNotesQueue[p][0]->GetMeter(); + + /* Record combo rollover. */ + g_CurStageStats.UpdateComboList( (PlayerNumber)p, 0, true ); } if( GAMESTATE->IsExtraStage() ) diff --git a/stepmania/src/StageStats.cpp b/stepmania/src/StageStats.cpp index 049783417a..2f64ff50fc 100644 --- a/stepmania/src/StageStats.cpp +++ b/stepmania/src/StageStats.cpp @@ -296,7 +296,9 @@ void StageStats::GetLifeRecord( PlayerNumber pn, float *life, int nout ) const } } -void StageStats::UpdateComboList( PlayerNumber pn, float pos ) +/* If "rollover" is true, we're being called before gameplay begins, so we can record + * the amount of the first combo that comes from the previous song. */ +void StageStats::UpdateComboList( PlayerNumber pn, float pos, bool rollover ) { if( pos < 0 ) return; @@ -314,17 +316,14 @@ void StageStats::UpdateComboList( PlayerNumber pn, float pos ) Combo_t NewCombo; NewCombo.start = pos; ComboList[pn].push_back( NewCombo ); - - /* If this is the first combo, and the current combo is greater than 1, - * 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; } Combo_t &combo = ComboList[pn].back(); combo.size = pos - combo.start; combo.cnt = cnt; + + if( rollover ) + combo.rollover = cnt; } /* This returns the largest combo contained within the song, as if diff --git a/stepmania/src/StageStats.h b/stepmania/src/StageStats.h index b85c7e7217..bfe34d9866 100644 --- a/stepmania/src/StageStats.h +++ b/stepmania/src/StageStats.h @@ -94,7 +94,7 @@ struct StageStats float fFirstPos[NUM_PLAYERS], fLastPos[NUM_PLAYERS]; bool FullCombo( PlayerNumber pn ) const; - void UpdateComboList( PlayerNumber pn, float pos ); + void UpdateComboList( PlayerNumber pn, float pos, bool rollover ); Combo_t GetMaxCombo( PlayerNumber pn ) const; };