diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 84f43660c6..8ceaf322bb 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -121,7 +121,8 @@ void GameState::Reset() ResetMusicStatistics(); ResetStageStatistics(); - SONGMAN->UpdateBestAndShuffled(); + SONGMAN->UpdateBest(); + SONGMAN->UpdateShuffled(); g_vPlayedStageStats.clear(); diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index b4449ba322..3d641e7f5d 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -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 diff --git a/stepmania/src/SongManager.h b/stepmania/src/SongManager.h index 24a5a97a52..bc4367510f 100644 --- a/stepmania/src/SongManager.h +++ b/stepmania/src/SongManager.h @@ -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