Simplify: use an enum instead of magic constants.

This commit is contained in:
Glenn Maynard
2003-07-27 18:39:34 +00:00
parent 6562c230e2
commit 9a5f812c8f
4 changed files with 7 additions and 8 deletions
+4 -4
View File
@@ -574,18 +574,18 @@ void MusicWheel::BuildWheelItemDatas( vector<WheelItemData> &arrayWheelItemDatas
// default sort order; other songs may alter this // default sort order; other songs may alter this
SortCoursePointerArrayByDifficulty( apCourses ); SortCoursePointerArrayByDifficulty( apCourses );
if (PREFSMAN->m_iCourseSortOrder != 0) if (PREFSMAN->m_iCourseSortOrder != PrefsManager::COURSE_SORT_SONGS)
{ {
for(i=0; i<apCourses.size(); i++) for(i=0; i<apCourses.size(); i++)
apCourses[i]->UpdateCourseStats(); apCourses[i]->UpdateCourseStats();
if (PREFSMAN->m_iCourseSortOrder == 1) if (PREFSMAN->m_iCourseSortOrder == PrefsManager::COURSE_SORT_METER)
SortCoursePointerArrayByAvgDifficulty( apCourses ); SortCoursePointerArrayByAvgDifficulty( apCourses );
if (PREFSMAN->m_iCourseSortOrder == 2) if (PREFSMAN->m_iCourseSortOrder == PrefsManager::COURSE_SORT_METER_SUM)
SortCoursePointerArrayByTotalDifficulty( apCourses ); SortCoursePointerArrayByTotalDifficulty( apCourses );
if (PREFSMAN->m_iCourseSortOrder == 3) if (PREFSMAN->m_iCourseSortOrder == PrefsManager::COURSE_SORT_RANK)
SortCoursePointerArrayByRanking( apCourses ); SortCoursePointerArrayByRanking( apCourses );
} }
+1 -1
View File
@@ -110,7 +110,7 @@ PrefsManager::PrefsManager()
m_bPickExtraStage = false; m_bPickExtraStage = false;
// default to old sort order // default to old sort order
m_iCourseSortOrder = 0; m_iCourseSortOrder = COURSE_SORT_SONGS;
m_fLongVerSongSeconds = 60*2.5f; // Dynamite Rave is 2:55 m_fLongVerSongSeconds = 60*2.5f; // Dynamite Rave is 2:55
m_fMarathonVerSongSeconds = 60*5.f; m_fMarathonVerSongSeconds = 60*5.f;
+1 -2
View File
@@ -85,8 +85,7 @@ public:
bool m_bTenFooterInRed; bool m_bTenFooterInRed;
// course ranking // course ranking
// by # songs = 0, avg diff=1, total diff=2, ranking=3 enum { COURSE_SORT_SONGS, COURSE_SORT_METER, COURSE_SORT_METER_SUM, COURSE_SORT_RANK } m_iCourseSortOrder;
int m_iCourseSortOrder;
/* 0 = no; 1 = yes; -1 = auto (do whatever is appropriate for the arch). */ /* 0 = no; 1 = yes; -1 = auto (do whatever is appropriate for the arch). */
int m_iBoostAppPriority; int m_iBoostAppPriority;
+1 -1
View File
@@ -195,7 +195,7 @@ void ScreenAppearanceOptions::ExportOptions()
PREFSMAN->m_bShowLyrics = !!m_iSelectedOption[0][AO_SHOW_LYRICS]; PREFSMAN->m_bShowLyrics = !!m_iSelectedOption[0][AO_SHOW_LYRICS];
PREFSMAN->m_bDancePointsForOni = !!m_iSelectedOption[0][AO_DANCE_POINTS_FOR_ONI]; PREFSMAN->m_bDancePointsForOni = !!m_iSelectedOption[0][AO_DANCE_POINTS_FOR_ONI];
PREFSMAN->m_bTenFooterInRed = !!m_iSelectedOption[0][AO_TEN_FOOT_RED]; PREFSMAN->m_bTenFooterInRed = !!m_iSelectedOption[0][AO_TEN_FOOT_RED];
PREFSMAN->m_iCourseSortOrder = m_iSelectedOption[0][AO_COURSE_SORT]; (int&)PREFSMAN->m_iCourseSortOrder = m_iSelectedOption[0][AO_COURSE_SORT];
PREFSMAN->SaveGamePrefsToDisk(); PREFSMAN->SaveGamePrefsToDisk();
PREFSMAN->SaveGlobalPrefsToDisk(); PREFSMAN->SaveGlobalPrefsToDisk();