split UpdateBestAndShuffled()

add SortSongs()
This commit is contained in:
Glenn Maynard
2004-02-27 21:28:15 +00:00
parent 960a4c503d
commit 8c8a5f8460
3 changed files with 14 additions and 3 deletions
+2 -1
View File
@@ -121,7 +121,8 @@ void GameState::Reset()
ResetMusicStatistics();
ResetStageStatistics();
SONGMAN->UpdateBestAndShuffled();
SONGMAN->UpdateBest();
SONGMAN->UpdateShuffled();
g_vPlayedStageStats.clear();
+9 -1
View File
@@ -871,7 +871,7 @@ Course *SongManager::FindCourse( CString sName )
return NULL;
}
void SongManager::UpdateBestAndShuffled()
void SongManager::UpdateBest()
{
// update players best
for( int i = 0; i < NUM_PROFILE_SLOTS; ++i )
@@ -882,7 +882,10 @@ void SongManager::UpdateBestAndShuffled()
m_pBestCourses[i] = m_pCourses;
SortCoursePointerArrayByNumPlays( m_pBestCourses[i], (ProfileSlot) i, true );
}
}
void SongManager::UpdateShuffled()
{
// update shuffled
m_pShuffledSongs = m_pSongs;
random_shuffle( m_pShuffledSongs.begin(), m_pShuffledSongs.end() );
@@ -891,6 +894,11 @@ void SongManager::UpdateBestAndShuffled()
random_shuffle( m_pShuffledCourses.begin(), m_pShuffledCourses.end() );
}
void SongManager::SortSongs()
{
SortSongPointerArrayByTitle( m_pSongs );
}
void SongManager::UpdateRankingCourses()
{
/* Updating the ranking courses data is fairly expensive
+3 -1
View File
@@ -91,7 +91,9 @@ public:
Course* GetCourseFromName( CString sName );
void UpdateBestAndShuffled(); // update Players Best
void UpdateBest(); // update Players Best
void UpdateShuffled(); // re-shuffle songs and courses
void SortSongs(); // sort m_pSongs
void UpdateRankingCourses(); // courses shown on the ranking screen