diff --git a/stepmania/src/GameConstantsAndTypes.h b/stepmania/src/GameConstantsAndTypes.h index ea504b898c..6fbfce7827 100644 --- a/stepmania/src/GameConstantsAndTypes.h +++ b/stepmania/src/GameConstantsAndTypes.h @@ -113,7 +113,8 @@ enum SongSortOrder { SORT_TITLE, SORT_BPM, SORT_MOST_PLAYED, - NUM_SORT_ORDERS + SORT_ROULETTE, + NUM_SORT_ORDERS }; diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 52ba4deb5d..d0488ed172 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -45,6 +45,8 @@ const int MAX_WHEEL_SOUND_SPEED = 15; float g_fItemSpacingY, g_fItemCurveX; // cache +static const SongSortOrder MaxSelectableSort = SORT_MOST_PLAYED; + inline RageColor GetNextSectionColor() { static int i=0; i = i % NUM_SECTION_COLORS; @@ -141,7 +143,6 @@ MusicWheel::MusicWheel() * the extra stage, so it knows to always display it. */ for( int so=0; som_pCurSong == NULL ) @@ -624,7 +625,9 @@ void MusicWheel::Update( float fDeltaTime ) CString sPrevSelectedSection = m_CurWheelItemData[m_iSelection]->m_sSectionName; // change the sort order - GAMESTATE->m_SongSortOrder = SongSortOrder( (GAMESTATE->m_SongSortOrder+1) % NUM_SORT_ORDERS ); + GAMESTATE->m_SongSortOrder = SongSortOrder( (GAMESTATE->m_SongSortOrder+1) ); + if(GAMESTATE->m_SongSortOrder > MaxSelectableSort) + GAMESTATE->m_SongSortOrder = SongSortOrder(0); SCREENMAN->SendMessageToTopScreen( SM_SortOrderChanged, 0 ); SetOpenGroup(GetSectionNameFromSongAndSort( pPrevSelectedSong, GAMESTATE->m_SongSortOrder )); diff --git a/stepmania/src/MusicWheel.h b/stepmania/src/MusicWheel.h index 1914601fef..f7087b4aa3 100644 --- a/stepmania/src/MusicWheel.h +++ b/stepmania/src/MusicWheel.h @@ -39,8 +39,6 @@ const ScreenMessage SM_SortOrderChanged = ScreenMessage(SM_User+48); -enum { SORT_ROULETTE = NUM_SORT_ORDERS+1 }; - struct CompareSongPointerArrayBySectionName; class MusicWheel : public ActorFrame @@ -93,7 +91,7 @@ protected: ScrollBar m_ScrollBar; Sprite m_sprSelectionOverlay; - vector m_WheelItemDatas[NUM_SORT_ORDERS+2]; + vector m_WheelItemDatas[NUM_SORT_ORDERS]; vector m_CurWheelItemData; WheelItemDisplay m_WheelItemDisplays[NUM_WHEEL_ITEMS_TO_DRAW];