From b4f56c01edbf6ac47888dd50ecda951c1aa3928d Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 17 Nov 2003 06:08:31 +0000 Subject: [PATCH] fixes --- stepmania/src/PaneDisplay.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/stepmania/src/PaneDisplay.cpp b/stepmania/src/PaneDisplay.cpp index c3398af0f0..af76e9f97f 100644 --- a/stepmania/src/PaneDisplay.cpp +++ b/stepmania/src/PaneDisplay.cpp @@ -122,15 +122,6 @@ void PaneDisplay::Update( float fDeltaTime ) ActorFrame::Update( fDeltaTime ); } -template -int FindIndex( const T &array, const Song *s ) -{ - T::const_iterator it = find( array.begin(), array.end(), s ); - if( it == array.end() ) - return -1; - return it - array.begin(); -} - void PaneDisplay::SetContent( PaneContents c ) { m_textContents[c].SetText( "" ); @@ -164,10 +155,21 @@ void PaneDisplay::SetContent( PaneContents c ) break; - case SONG_PROFILE_RANK: - val = (float) FindIndex( SONGMAN->GetBestSongs( PlayerMemCard(m_PlayerNumber) ), GAMESTATE->m_pCurSong ); + case SONG_MACHINE_RANK: + { + const vector best = SONGMAN->GetBestSongs( MEMORY_CARD_MACHINE ); + val = (float) FindIndex( best.begin(), best.end(), GAMESTATE->m_pCurSong ); val += 1; break; + } + + case SONG_PROFILE_RANK: + { + const vector best = SONGMAN->GetBestSongs( PlayerMemCard(m_PlayerNumber) ); + val = (float) FindIndex( best.begin(), best.end(), GAMESTATE->m_pCurSong ); + val += 1; + break; + } case COURSE_MACHINE_HIGH_SCORE: // XXX add percentdp