style fixes

This commit is contained in:
Glenn Maynard
2005-05-19 20:34:35 +00:00
parent b78ea78dea
commit 14da28b9e5
2 changed files with 23 additions and 23 deletions
+12 -12
View File
@@ -1143,7 +1143,7 @@ RageColor Course::GetColor() const
// FIXME: Calculate the meter. // FIXME: Calculate the meter.
int iMeter = 5; int iMeter = 5;
switch (PREFSMAN->m_CourseSortOrder) switch( PREFSMAN->m_CourseSortOrder )
{ {
case PrefsManager::COURSE_SORT_SONGS: case PrefsManager::COURSE_SORT_SONGS:
if( m_entries.size() >= 7 ) return SORT_LEVEL2_COLOR; if( m_entries.size() >= 7 ) return SORT_LEVEL2_COLOR;
@@ -1151,23 +1151,23 @@ RageColor Course::GetColor() const
else return SORT_LEVEL5_COLOR; else return SORT_LEVEL5_COLOR;
case PrefsManager::COURSE_SORT_METER: case PrefsManager::COURSE_SORT_METER:
if ( !IsFixed() ) return SORT_LEVEL1_COLOR; if( !IsFixed() ) return SORT_LEVEL1_COLOR;
else if (iMeter > 9) return SORT_LEVEL2_COLOR; else if( iMeter > 9 ) return SORT_LEVEL2_COLOR;
else if (iMeter >= 7) return SORT_LEVEL3_COLOR; else if( iMeter >= 7 ) return SORT_LEVEL3_COLOR;
else if (iMeter >= 5) return SORT_LEVEL4_COLOR; else if( iMeter >= 5 ) return SORT_LEVEL4_COLOR;
else return SORT_LEVEL5_COLOR; else return SORT_LEVEL5_COLOR;
case PrefsManager::COURSE_SORT_METER_SUM: case PrefsManager::COURSE_SORT_METER_SUM:
if ( !IsFixed() ) return SORT_LEVEL1_COLOR; if( !IsFixed() ) return SORT_LEVEL1_COLOR;
if (m_SortOrder_TotalDifficulty >= 40) return SORT_LEVEL2_COLOR; if( m_SortOrder_TotalDifficulty >= 40 ) return SORT_LEVEL2_COLOR;
if (m_SortOrder_TotalDifficulty >= 30) return SORT_LEVEL3_COLOR; if( m_SortOrder_TotalDifficulty >= 30 ) return SORT_LEVEL3_COLOR;
if (m_SortOrder_TotalDifficulty >= 20) return SORT_LEVEL4_COLOR; if( m_SortOrder_TotalDifficulty >= 20 ) return SORT_LEVEL4_COLOR;
else return SORT_LEVEL5_COLOR; else return SORT_LEVEL5_COLOR;
case PrefsManager::COURSE_SORT_RANK: case PrefsManager::COURSE_SORT_RANK:
if (m_SortOrder_Ranking == 3) return SORT_LEVEL1_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 == 2 ) return SORT_LEVEL3_COLOR;
else if (m_SortOrder_Ranking == 1) return SORT_LEVEL5_COLOR; else if( m_SortOrder_Ranking == 1 ) return SORT_LEVEL5_COLOR;
else return SORT_LEVEL4_COLOR; else return SORT_LEVEL4_COLOR;
default: default:
ASSERT(0); ASSERT(0);
+11 -11
View File
@@ -13,7 +13,7 @@
// //
// Sorting stuff // 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. // HACK: strcmp and other string comparators appear to eat whitespace.
// For example, the string "Players Best 13-16" is sorted between // 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; 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 b1 = pCourse1->m_bIsAutogen;
int b2 = pCourse2->m_bIsAutogen; int b2 = pCourse2->m_bIsAutogen;
@@ -42,7 +42,7 @@ static bool CompareCoursePointersByAutogen(const Course* pCourse1, const Course*
return CompareCoursePointersByName(pCourse1,pCourse2); 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 iNum1 = pCourse1->GetEstimatedNumStages();
int iNum2 = pCourse2->GetEstimatedNumStages(); int iNum2 = pCourse2->GetEstimatedNumStages();
@@ -54,7 +54,7 @@ static bool CompareCoursePointersByDifficulty(const Course* pCourse1, const Cour
return CompareCoursePointersByAutogen( pCourse1, pCourse2 ); 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 iNum1 = pCourse1->m_SortOrder_TotalDifficulty;
int iNum2 = pCourse2->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() ); 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 iNum1 = pCourse1->m_SortOrder_Ranking;
int iNum2 = pCourse2->m_SortOrder_Ranking; int iNum2 = pCourse2->m_SortOrder_Ranking;
@@ -100,19 +100,19 @@ void CourseUtil::SortCoursePointerArrayByDifficulty( vector<Course*> &vpCoursesI
void CourseUtil::SortCoursePointerArrayByRanking( vector<Course*> &vpCoursesInOut ) void CourseUtil::SortCoursePointerArrayByRanking( vector<Course*> &vpCoursesInOut )
{ {
for(unsigned i=0; i<vpCoursesInOut.size(); i++) for( unsigned i=0; i<vpCoursesInOut.size(); i++ )
vpCoursesInOut[i]->UpdateCourseStats( GAMESTATE->GetCurrentStyle()->m_StepsType ); vpCoursesInOut[i]->UpdateCourseStats( GAMESTATE->GetCurrentStyle()->m_StepsType );
sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByRanking ); sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByRanking );
} }
void CourseUtil::SortCoursePointerArrayByTotalDifficulty( vector<Course*> &vpCoursesInOut ) void CourseUtil::SortCoursePointerArrayByTotalDifficulty( vector<Course*> &vpCoursesInOut )
{ {
for(unsigned i=0; i<vpCoursesInOut.size(); i++) for( unsigned i=0; i<vpCoursesInOut.size(); i++ )
vpCoursesInOut[i]->UpdateCourseStats( GAMESTATE->GetCurrentStyle()->m_StepsType ); vpCoursesInOut[i]->UpdateCourseStats( GAMESTATE->GetCurrentStyle()->m_StepsType );
sort( vpCoursesInOut.begin(), vpCoursesInOut.end(), CompareCoursePointersByTotalDifficulty ); 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(); return pCourse1->GetPlayMode() < pCourse2->GetPlayMode();
} }
@@ -129,12 +129,12 @@ void CourseUtil::MoveRandomToEnd( vector<Course*> &vpCoursesInOut )
static map<const Course*, CString> course_sort_val; static map<const Course*, CString> 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]; 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]; return course_sort_val[pSong1] > course_sort_val[pSong2];
} }
@@ -153,7 +153,7 @@ void CourseUtil::SortCoursePointerArrayByAvgDifficulty( vector<Course*> &vpCours
{ {
RageTimer foo; RageTimer foo;
course_sort_val.clear(); 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 ); 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); course_sort_val[vpCoursesInOut[i]] = ssprintf("%09.3f", pTrail != NULL? (float) pTrail->GetMeter(): 0.0f);