[ScreenEvaluation] Stop the Bonus bars from overflowing in course modes.
This commit is contained in:
@@ -11,6 +11,7 @@ StepMania 5.0 $NEXT | 20110xyy
|
||||
2011/05/14
|
||||
----------
|
||||
* [MusicWheel] Added ShowSectionsInBPMSort and ShowSectionsInLengthSort metrics. [AJ]
|
||||
* [ScreenEvaluation] Stop the Bonus bars from overflowing in course modes. [AJ]
|
||||
|
||||
2011/05/11
|
||||
----------
|
||||
|
||||
@@ -370,6 +370,11 @@ void ScreenEvaluation::Init()
|
||||
// init bonus area
|
||||
if( SHOW_BONUS_AREA )
|
||||
{
|
||||
// In course mode, we need to make sure the bar doesn't overflow. -aj
|
||||
float fDivider = 1.0f;
|
||||
if( GAMESTATE->IsCourseMode() )
|
||||
fDivider = fDivider / GAMESTATE->m_pCurCourse->m_vEntries.size();
|
||||
|
||||
FOREACH_EnabledPlayer( p )
|
||||
{
|
||||
m_sprBonusFrame[p].Load( THEME->GetPathG(m_sName,ssprintf("BonusFrame p%d",p+1)) );
|
||||
@@ -382,7 +387,7 @@ void ScreenEvaluation::Init()
|
||||
for( int r=0; r<NUM_SHOWN_RADAR_CATEGORIES; r++ ) // foreach line
|
||||
{
|
||||
m_sprPossibleBar[p][r].Load( THEME->GetPathG(m_sName,ssprintf("BarPossible p%d",p+1)) );
|
||||
m_sprPossibleBar[p][r].SetWidth( m_sprPossibleBar[p][r].GetUnzoomedWidth() * m_pStageStats->m_player[p].m_radarPossible[r] );
|
||||
m_sprPossibleBar[p][r].SetWidth( m_sprPossibleBar[p][r].GetUnzoomedWidth() * m_pStageStats->m_player[p].m_radarPossible[r] * fDivider );
|
||||
m_sprPossibleBar[p][r].SetName( ssprintf("BarPossible%dP%d",r+1,p+1) );
|
||||
ActorUtil::LoadAllCommands( m_sprPossibleBar[p][r], m_sName );
|
||||
SET_XY( m_sprPossibleBar[p][r] );
|
||||
@@ -390,7 +395,7 @@ void ScreenEvaluation::Init()
|
||||
|
||||
m_sprActualBar[p][r].Load( THEME->GetPathG(m_sName,ssprintf("BarActual p%d",p+1)) );
|
||||
// should be out of the possible bar, not actual (whatever value that is at)
|
||||
m_sprActualBar[p][r].SetWidth( m_sprPossibleBar[p][r].GetUnzoomedWidth() * m_pStageStats->m_player[p].m_radarActual[r] );
|
||||
m_sprActualBar[p][r].SetWidth( m_sprPossibleBar[p][r].GetUnzoomedWidth() * m_pStageStats->m_player[p].m_radarActual[r] * fDivider );
|
||||
|
||||
float value = (float)100 * m_sprActualBar[p][r].GetUnzoomedWidth() / m_sprPossibleBar[p][r].GetUnzoomedWidth();
|
||||
LOG->Trace("Radar bar %d of 5 - %f percent", r, value);
|
||||
|
||||
Reference in New Issue
Block a user