fix Various showed as BPM for some courses with <= MAX_COURSE_ENTRIES_BEFORE_VARIOUS

This commit is contained in:
Chris Danford
2005-03-17 17:53:10 +00:00
parent 0eb271a1b1
commit 1f112ae2ca
6 changed files with 33 additions and 21 deletions
+10 -10
View File
@@ -92,13 +92,6 @@ void BPMDisplay::SetBPMRange( const DisplayBpms &bpms )
const vector<float> &BPMS = bpms.vfBpms;
if( (int) BPMS.size() > MAX_COURSE_ENTRIES_BEFORE_VARIOUS )
{
m_BPMS.push_back( -1 );
m_textBPM.SetText( "Various" );
return;
}
bool AllIdentical = true;
for( unsigned i = 0; i < BPMS.size(); ++i )
{
@@ -181,7 +174,7 @@ void BPMDisplay::NoBPM()
m_sprLabel->SetDiffuse( NORMAL_COLOR );
}
void BPMDisplay::SetBPM( const Song* pSong )
void BPMDisplay::SetBpmFromSong( const Song* pSong )
{
ASSERT( pSong );
switch( pSong->m_DisplayBPMType )
@@ -203,7 +196,7 @@ void BPMDisplay::SetBPM( const Song* pSong )
}
}
void BPMDisplay::SetBPM( const Course* pCourse )
void BPMDisplay::SetBpmFromCourse( const Course* pCourse )
{
ASSERT( pCourse );
@@ -218,13 +211,20 @@ void BPMDisplay::SetBPM( const Course* pCourse )
m_fCycleTime = 0.2f;
}
void BPMDisplay::SetBPM( float fBPM )
void BPMDisplay::SetConstantBpm( float fBPM )
{
DisplayBpms bpms;
bpms.Add( fBPM );
SetBPMRange( bpms );
}
void BPMDisplay::SetVarious()
{
m_BPMS.clear();
m_BPMS.push_back( -1 );
m_textBPM.SetText( "Various" );
}
void BPMDisplay::DrawPrimitives()
{
ActorFrame::DrawPrimitives();
+4 -3
View File
@@ -20,11 +20,12 @@ public:
void Load();
virtual void Update( float fDeltaTime );
virtual void DrawPrimitives();
void SetBPM( const Song* pSong );
void SetBPM( const Course* pCourse );
void SetBPM( float fBPM );
void SetBpmFromSong( const Song* pSong );
void SetBpmFromCourse( const Course* pCourse );
void SetConstantBpm( float fBPM );
void CycleRandomly();
void NoBPM();
void SetVarious();
protected:
float GetActiveBPM() const;
+1 -1
View File
@@ -1579,7 +1579,7 @@ void ScreenGameplay::Update( float fDeltaTime )
if( m_fLastBPS != GAMESTATE->m_fCurBPS && !m_BPMDisplay.GetHidden() )
{
m_fLastBPS = GAMESTATE->m_fCurBPS;
m_BPMDisplay.SetBPM( GAMESTATE->m_fCurBPS * 60.0f );
m_BPMDisplay.SetConstantBpm( GAMESTATE->m_fCurBPS * 60.0f );
}
//
+1 -1
View File
@@ -485,7 +485,7 @@ void ScreenNetSelectMusic::MusicChanged()
UpdateDifficulties( pn );
return;
}
m_BPMDisplay.SetBPM( GAMESTATE->m_pCurSong );
m_BPMDisplay.SetBpmFromSong( GAMESTATE->m_pCurSong );
FOREACH_EnabledPlayer (pn)
{
+12 -4
View File
@@ -324,7 +324,17 @@ CString ScreenOptions::GetExplanationTitle( int iRow ) const
// HACK: tack the BPM onto the name of the speed line
if( sLineName.CompareNoCase("speed")==0 )
{
if( SHOW_BPM_IN_SPEED_TITLE )
bool bShowBpmInSpeedTitle = SHOW_BPM_IN_SPEED_TITLE;
if( GAMESTATE->m_pCurCourse )
{
Trail* pTrail = GAMESTATE->m_pCurTrail[GAMESTATE->m_MasterPlayerNumber];
const int iNumCourseEntries = pTrail->m_vEntries.size();
if( iNumCourseEntries > MAX_COURSE_ENTRIES_BEFORE_VARIOUS )
bShowBpmInSpeedTitle = false;
}
if( bShowBpmInSpeedTitle )
{
DisplayBpms bpms;
if( GAMESTATE->m_pCurSong )
@@ -341,9 +351,7 @@ CString ScreenOptions::GetExplanationTitle( int iRow ) const
pTrail->GetDisplayBpms( bpms );
}
if( (int) bpms.vfBpms.size() > MAX_COURSE_ENTRIES_BEFORE_VARIOUS )
{} // add nothing
else if( bpms.IsSecret() )
if( bpms.IsSecret() )
sTitle += ssprintf( " (??" "?)" ); /* split so gcc doesn't think this is a trigraph */
else if( bpms.BpmIsConstant() )
sTitle += ssprintf( " (%.0f)", bpms.GetMin() );
+5 -2
View File
@@ -1510,7 +1510,7 @@ void ScreenSelectMusic::AfterMusicChange()
}
else
{
m_BPMDisplay.SetBPM( pSong );
m_BPMDisplay.SetBpmFromSong( pSong );
}
g_sCDTitlePath = pSong->GetCDTitlePath();
@@ -1636,7 +1636,10 @@ void ScreenSelectMusic::AfterMusicChange()
if( g_sBannerPath.empty() )
m_Banner.LoadFallback();
m_BPMDisplay.SetBPM( pCourse );
if( (int)pTrail->m_vEntries.size() > MAX_COURSE_ENTRIES_BEFORE_VARIOUS )
m_BPMDisplay.SetVarious();
else
m_BPMDisplay.SetBpmFromCourse( pCourse );
m_DifficultyDisplay.UnsetDifficulties();