Simplify: SortOrder_NumStages was always being set to ci.size()+1,

and is never used outside of this function.

Fix float/int warning.
This commit is contained in:
Glenn Maynard
2003-07-27 18:28:05 +00:00
parent fa97933f7a
commit 6562c230e2
2 changed files with 6 additions and 10 deletions
+6 -9
View File
@@ -815,8 +815,8 @@ static bool CompareCoursePointersByAvgDifficulty(const Course* pCourse1, const C
static bool CompareCoursePointersByTotalDifficulty(const Course* pCourse1, const Course* pCourse2)
{
float iNum1 = pCourse1->SortOrder_TotalDifficulty;
float iNum2 = pCourse2->SortOrder_TotalDifficulty;
int iNum1 = pCourse1->SortOrder_TotalDifficulty;
int iNum2 = pCourse2->SortOrder_TotalDifficulty;
if( iNum1 < iNum2 )
return true;
@@ -828,8 +828,8 @@ static bool CompareCoursePointersByTotalDifficulty(const Course* pCourse1, const
static bool CompareCoursePointersByRanking(const Course* pCourse1, const Course* pCourse2)
{
float iNum1 = pCourse1->SortOrder_Ranking;
float iNum2 = pCourse2->SortOrder_Ranking;
int iNum1 = pCourse1->SortOrder_Ranking;
int iNum2 = pCourse2->SortOrder_Ranking;
if( iNum1 < iNum2 )
return true;
@@ -880,7 +880,6 @@ void Course::UpdateCourseStats()
LOG->Trace("Updating course stats for %s", this->m_sName.c_str() );
SortOrder_AvgDifficulty = 0;
SortOrder_NumStages = 0;
SortOrder_Ranking = 2;
SortOrder_TotalDifficulty = 0;
@@ -895,18 +894,16 @@ void Course::UpdateCourseStats()
if (m_entries[i].type != Entry::fixed)
{
SortOrder_AvgDifficulty = 9999999; // large number
SortOrder_NumStages = ci.size();
SortOrder_Ranking = 3;
SortOrder_TotalDifficulty = 999999; // large number
return;
}
SortOrder_NumStages++;
SortOrder_TotalDifficulty += ci[i].pNotes->GetMeter();
}
SortOrder_AvgDifficulty = (float)SortOrder_TotalDifficulty/SortOrder_NumStages;
if (SortOrder_NumStages > 7) SortOrder_Ranking = 3;
SortOrder_AvgDifficulty = (float)SortOrder_TotalDifficulty/GetEstimatedNumStages();
if (GetEstimatedNumStages() > 7) SortOrder_Ranking = 3;
CStringArray RankingCourses;
-1
View File
@@ -121,7 +121,6 @@ public:
void AddScores( NotesType nt, bool bPlayerEnabled[NUM_PLAYERS], int iDancePoints[NUM_PLAYERS], float fSurviveTime[NUM_PLAYERS], int iRankingIndexOut[NUM_PLAYERS], bool bNewRecordOut[NUM_PLAYERS] ); // iNewRecordIndexOut[p] = -1 if not a new record
// sorting values
int SortOrder_NumStages;
int SortOrder_TotalDifficulty;
float SortOrder_AvgDifficulty;
int SortOrder_Ranking;