diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index ce9c6121d9..b59e427927 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -1143,7 +1143,7 @@ RageColor Course::GetColor() const // FIXME: Calculate the meter. int iMeter = 5; - switch (PREFSMAN->m_CourseSortOrder) + switch( PREFSMAN->m_CourseSortOrder ) { case PrefsManager::COURSE_SORT_SONGS: if( m_entries.size() >= 7 ) return SORT_LEVEL2_COLOR; @@ -1151,23 +1151,23 @@ RageColor Course::GetColor() const else return SORT_LEVEL5_COLOR; case PrefsManager::COURSE_SORT_METER: - if ( !IsFixed() ) return SORT_LEVEL1_COLOR; - else if (iMeter > 9) return SORT_LEVEL2_COLOR; - else if (iMeter >= 7) return SORT_LEVEL3_COLOR; - else if (iMeter >= 5) return SORT_LEVEL4_COLOR; + if( !IsFixed() ) return SORT_LEVEL1_COLOR; + else if( iMeter > 9 ) return SORT_LEVEL2_COLOR; + else if( iMeter >= 7 ) return SORT_LEVEL3_COLOR; + else if( iMeter >= 5 ) return SORT_LEVEL4_COLOR; else return SORT_LEVEL5_COLOR; case PrefsManager::COURSE_SORT_METER_SUM: - if ( !IsFixed() ) return SORT_LEVEL1_COLOR; - if (m_SortOrder_TotalDifficulty >= 40) return SORT_LEVEL2_COLOR; - if (m_SortOrder_TotalDifficulty >= 30) return SORT_LEVEL3_COLOR; - if (m_SortOrder_TotalDifficulty >= 20) return SORT_LEVEL4_COLOR; + if( !IsFixed() ) return SORT_LEVEL1_COLOR; + if( m_SortOrder_TotalDifficulty >= 40 ) return SORT_LEVEL2_COLOR; + if( m_SortOrder_TotalDifficulty >= 30 ) return SORT_LEVEL3_COLOR; + if( m_SortOrder_TotalDifficulty >= 20 ) return SORT_LEVEL4_COLOR; else return SORT_LEVEL5_COLOR; case PrefsManager::COURSE_SORT_RANK: - if (m_SortOrder_Ranking == 3) return SORT_LEVEL1_COLOR; - else if (m_SortOrder_Ranking == 2) return SORT_LEVEL3_COLOR; - else if (m_SortOrder_Ranking == 1) return SORT_LEVEL5_COLOR; + if( m_SortOrder_Ranking == 3 ) return SORT_LEVEL1_COLOR; + else if( m_SortOrder_Ranking == 2 ) return SORT_LEVEL3_COLOR; + else if( m_SortOrder_Ranking == 1 ) return SORT_LEVEL5_COLOR; else return SORT_LEVEL4_COLOR; default: ASSERT(0); diff --git a/stepmania/src/CourseUtil.cpp b/stepmania/src/CourseUtil.cpp index 945fcfe29f..7a8ad35cae 100644 --- a/stepmania/src/CourseUtil.cpp +++ b/stepmania/src/CourseUtil.cpp @@ -13,7 +13,7 @@ // // Sorting stuff // -static bool CompareCoursePointersByName(const Course* pCourse1, const Course* pCourse2) +static bool CompareCoursePointersByName( const Course* pCourse1, const Course* pCourse2 ) { // HACK: strcmp and other string comparators appear to eat whitespace. // For example, the string "Players Best 13-16" is sorted between @@ -30,7 +30,7 @@ static bool CompareCoursePointersByName(const Course* pCourse1, const Course* pC return sName1.CompareNoCase( sName2 ) == -1; } -static bool CompareCoursePointersByAutogen(const Course* pCourse1, const Course* pCourse2) +static bool CompareCoursePointersByAutogen( const Course* pCourse1, const Course* pCourse2 ) { int b1 = pCourse1->m_bIsAutogen; int b2 = pCourse2->m_bIsAutogen; @@ -42,7 +42,7 @@ static bool CompareCoursePointersByAutogen(const Course* pCourse1, const Course* return CompareCoursePointersByName(pCourse1,pCourse2); } -static bool CompareCoursePointersByDifficulty(const Course* pCourse1, const Course* pCourse2) +static bool CompareCoursePointersByDifficulty( const Course* pCourse1, const Course* pCourse2 ) { int iNum1 = pCourse1->GetEstimatedNumStages(); int iNum2 = pCourse2->GetEstimatedNumStages(); @@ -54,7 +54,7 @@ static bool CompareCoursePointersByDifficulty(const Course* pCourse1, const Cour return CompareCoursePointersByAutogen( pCourse1, pCourse2 ); } -static bool CompareCoursePointersByTotalDifficulty(const Course* pCourse1, const Course* pCourse2) +static bool CompareCoursePointersByTotalDifficulty( const Course* pCourse1, const Course* pCourse2 ) { int iNum1 = pCourse1->m_SortOrder_TotalDifficulty; int iNum2 = pCourse2->m_SortOrder_TotalDifficulty; @@ -83,7 +83,7 @@ static bool CompareRandom( const Course* pCourse1, const Course* pCourse2 ) return ( pCourse1->IsFixed() && !pCourse2->IsFixed() ); } -static bool CompareCoursePointersByRanking(const Course* pCourse1, const Course* pCourse2) +static bool CompareCoursePointersByRanking( const Course* pCourse1, const Course* pCourse2 ) { int iNum1 = pCourse1->m_SortOrder_Ranking; int iNum2 = pCourse2->m_SortOrder_Ranking; @@ -100,19 +100,19 @@ void CourseUtil::SortCoursePointerArrayByDifficulty( vector &vpCoursesI void CourseUtil::SortCoursePointerArrayByRanking( vector &vpCoursesInOut ) { - for(unsigned i=0; iUpdateCourseStats( GAMESTATE->GetCurrentStyle()->m_StepsType ); sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByRanking ); } void CourseUtil::SortCoursePointerArrayByTotalDifficulty( vector &vpCoursesInOut ) { - for(unsigned i=0; iUpdateCourseStats( GAMESTATE->GetCurrentStyle()->m_StepsType ); sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByTotalDifficulty ); } -static bool CompareCoursePointersByType(const Course* pCourse1, const Course* pCourse2) +static bool CompareCoursePointersByType( const Course* pCourse1, const Course* pCourse2 ) { return pCourse1->GetPlayMode() < pCourse2->GetPlayMode(); } @@ -129,12 +129,12 @@ void CourseUtil::MoveRandomToEnd( vector &vpCoursesInOut ) static map course_sort_val; -bool CompareCoursePointersBySortValueAscending(const Course *pSong1, const Course *pSong2) +bool CompareCoursePointersBySortValueAscending( const Course *pSong1, const Course *pSong2 ) { return course_sort_val[pSong1] < course_sort_val[pSong2]; } -bool CompareCoursePointersBySortValueDescending(const Course *pSong1, const Course *pSong2) +bool CompareCoursePointersBySortValueDescending( const Course *pSong1, const Course *pSong2 ) { return course_sort_val[pSong1] > course_sort_val[pSong2]; } @@ -153,7 +153,7 @@ void CourseUtil::SortCoursePointerArrayByAvgDifficulty( vector &vpCours { RageTimer foo; course_sort_val.clear(); - for(unsigned i = 0; i < vpCoursesInOut.size(); ++i) + for( unsigned i = 0; i < vpCoursesInOut.size(); ++i ) { const Trail* pTrail = vpCoursesInOut[i]->GetTrail( GAMESTATE->GetCurrentStyle()->m_StepsType ); course_sort_val[vpCoursesInOut[i]] = ssprintf("%09.3f", pTrail != NULL? (float) pTrail->GetMeter(): 0.0f);