add courses to "total game DP" count
move RadarValues into a struct
This commit is contained in:
@@ -1044,6 +1044,27 @@ bool Course::IsRanking() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RadarValues Course::GetRadarValues( StepsType st, CourseDifficulty cd ) const
|
||||||
|
{
|
||||||
|
RadarValues rv;
|
||||||
|
|
||||||
|
vector<Course::Info> ci;
|
||||||
|
GAMESTATE->m_pCurCourse->GetCourseInfo( st, ci, cd );
|
||||||
|
for( unsigned i = 0; i < ci.size(); ++i )
|
||||||
|
{
|
||||||
|
const Steps *pNotes = ci[i].pNotes;
|
||||||
|
ASSERT( pNotes );
|
||||||
|
rv += pNotes->GetRadarValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Sorting stuff
|
||||||
|
//
|
||||||
static map<const Course*, float> course_sort_val;
|
static map<const Course*, float> course_sort_val;
|
||||||
|
|
||||||
bool CompareCoursePointersBySortValueAscending(const Course *pSong1, const Course *pSong2)
|
bool CompareCoursePointersBySortValueAscending(const Course *pSong1, const Course *pSong2)
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ public:
|
|||||||
void AutogenEndlessFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup );
|
void AutogenEndlessFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup );
|
||||||
void AutogenNonstopFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup );
|
void AutogenNonstopFromGroup( CString sGroupName, vector<Song*> &apSongsInGroup );
|
||||||
|
|
||||||
|
RadarValues GetRadarValues( StepsType st, CourseDifficulty cd ) const;
|
||||||
|
|
||||||
// sorting values
|
// sorting values
|
||||||
int SortOrder_TotalDifficulty;
|
int SortOrder_TotalDifficulty;
|
||||||
|
|||||||
@@ -64,6 +64,27 @@ enum RadarCategory
|
|||||||
|
|
||||||
CString RadarCategoryToString( RadarCategory cat );
|
CString RadarCategoryToString( RadarCategory cat );
|
||||||
|
|
||||||
|
struct RadarValues
|
||||||
|
{
|
||||||
|
float value[NUM_RADAR_CATEGORIES];
|
||||||
|
|
||||||
|
RadarValues()
|
||||||
|
{
|
||||||
|
FOREACH_RadarCategory( rc )
|
||||||
|
value[rc] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
operator const float* () const { return value; };
|
||||||
|
operator float* () { return value; };
|
||||||
|
|
||||||
|
RadarValues& operator+=( const RadarValues& other )
|
||||||
|
{
|
||||||
|
FOREACH_RadarCategory( rc )
|
||||||
|
value[rc] += other.value[rc];
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
enum Difficulty
|
enum Difficulty
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,23 +59,26 @@ GrooveGraph::GrooveGraph()
|
|||||||
|
|
||||||
void GrooveGraph::SetFromSong( Song* pSong )
|
void GrooveGraph::SetFromSong( Song* pSong )
|
||||||
{
|
{
|
||||||
float fValues[NUM_SHOWN_RADAR_CATEGORIES][NUM_DIFFICULTIES];
|
RadarValues rvs[NUM_DIFFICULTIES];
|
||||||
ZERO( fValues );
|
|
||||||
|
|
||||||
if( pSong )
|
if( pSong )
|
||||||
{
|
{
|
||||||
for( int i=0; i<NUM_DIFFICULTIES; i++ )
|
for( int i=0; i<NUM_DIFFICULTIES; i++ )
|
||||||
{
|
{
|
||||||
Steps* pNotes = pSong->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, (Difficulty)i );
|
Steps* pNotes = pSong->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, (Difficulty)i );
|
||||||
const float* fRadarValues = pNotes ? pNotes->GetRadarValues() : NULL;
|
if( pNotes )
|
||||||
for( int j=0; j<NUM_SHOWN_RADAR_CATEGORIES; j++ )
|
rvs[i] = pNotes->GetRadarValues();
|
||||||
fValues[j][i] = fRadarValues ? fRadarValues[j] : 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for( int j=0; j<NUM_SHOWN_RADAR_CATEGORIES; j++ )
|
for( int j=0; j<NUM_SHOWN_RADAR_CATEGORIES; j++ )
|
||||||
{
|
{
|
||||||
m_Mountains[j].SetValues( fValues[j] );
|
float fValues[NUM_DIFFICULTIES];
|
||||||
|
FOREACH_Difficulty( dc )
|
||||||
|
{
|
||||||
|
fValues[dc] = rvs[j][dc];
|
||||||
|
}
|
||||||
|
m_Mountains[j].SetValues( fValues );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -151,23 +151,16 @@ void PaneDisplay::SetContent( PaneContents c )
|
|||||||
if( (g_Contents[c].req&NEED_PROFILE) && !PROFILEMAN->IsUsingProfile( m_PlayerNumber ) )
|
if( (g_Contents[c].req&NEED_PROFILE) && !PROFILEMAN->IsUsingProfile( m_PlayerNumber ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float fRadarValues[NUM_RADAR_CATEGORIES];
|
RadarValues rv;
|
||||||
memset( fRadarValues, 0, sizeof(fRadarValues) );
|
|
||||||
|
|
||||||
if( g_Contents[c].req&NEED_NOTES )
|
if( g_Contents[c].req&NEED_NOTES )
|
||||||
memcpy( fRadarValues, GAMESTATE->m_pCurNotes[m_PlayerNumber]->GetRadarValues(), sizeof(fRadarValues) );
|
rv = GAMESTATE->m_pCurNotes[m_PlayerNumber]->GetRadarValues();
|
||||||
else if( g_Contents[c].req&NEED_COURSE )
|
else if( g_Contents[c].req&NEED_COURSE )
|
||||||
{
|
{
|
||||||
vector<Course::Info> ci;
|
vector<Course::Info> ci;
|
||||||
GAMESTATE->m_pCurCourse->GetCourseInfo( GAMESTATE->GetCurrentStyleDef()->m_StepsType, ci, GAMESTATE->m_CourseDifficulty[m_PlayerNumber] );
|
CourseDifficulty cd = GAMESTATE->m_CourseDifficulty[m_PlayerNumber];
|
||||||
for( unsigned i = 0; i < ci.size(); ++i )
|
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
|
||||||
{
|
rv = GAMESTATE->m_pCurCourse->GetRadarValues( st, cd );
|
||||||
for( unsigned r = 0; r < NUM_RADAR_CATEGORIES; ++r )
|
|
||||||
{
|
|
||||||
const Steps *pNotes = ci[i].pNotes;
|
|
||||||
fRadarValues[r] += pNotes->GetRadarValues()[r];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Song *pSong = GAMESTATE->m_pCurSong;
|
const Song *pSong = GAMESTATE->m_pCurSong;
|
||||||
@@ -181,20 +174,20 @@ void PaneDisplay::SetContent( PaneContents c )
|
|||||||
switch( c )
|
switch( c )
|
||||||
{
|
{
|
||||||
case COURSE_NUM_STEPS:
|
case COURSE_NUM_STEPS:
|
||||||
case SONG_NUM_STEPS: val = fRadarValues[RADAR_NUM_TAPS_AND_HOLDS]; break;
|
case SONG_NUM_STEPS: val = rv[RADAR_NUM_TAPS_AND_HOLDS]; break;
|
||||||
case COURSE_JUMPS:
|
case COURSE_JUMPS:
|
||||||
case SONG_JUMPS: val = fRadarValues[RADAR_NUM_JUMPS]; break;
|
case SONG_JUMPS: val = rv[RADAR_NUM_JUMPS]; break;
|
||||||
case COURSE_HOLDS:
|
case COURSE_HOLDS:
|
||||||
case SONG_HOLDS: val = fRadarValues[RADAR_NUM_HOLDS]; break;
|
case SONG_HOLDS: val = rv[RADAR_NUM_HOLDS]; break;
|
||||||
case COURSE_MINES:
|
case COURSE_MINES:
|
||||||
case SONG_MINES: val = fRadarValues[RADAR_NUM_MINES]; break;
|
case SONG_MINES: val = rv[RADAR_NUM_MINES]; break;
|
||||||
case COURSE_HANDS:
|
case COURSE_HANDS:
|
||||||
case SONG_HANDS: val = fRadarValues[RADAR_NUM_HANDS]; break;
|
case SONG_HANDS: val = rv[RADAR_NUM_HANDS]; break;
|
||||||
case SONG_DIFFICULTY_RADAR_STREAM: val = fRadarValues[RADAR_STREAM]; break;
|
case SONG_DIFFICULTY_RADAR_STREAM: val = rv[RADAR_STREAM]; break;
|
||||||
case SONG_DIFFICULTY_RADAR_VOLTAGE: val = fRadarValues[RADAR_VOLTAGE]; break;
|
case SONG_DIFFICULTY_RADAR_VOLTAGE: val = rv[RADAR_VOLTAGE]; break;
|
||||||
case SONG_DIFFICULTY_RADAR_AIR: val = fRadarValues[RADAR_AIR]; break;
|
case SONG_DIFFICULTY_RADAR_AIR: val = rv[RADAR_AIR]; break;
|
||||||
case SONG_DIFFICULTY_RADAR_FREEZE: val = fRadarValues[RADAR_FREEZE]; break;
|
case SONG_DIFFICULTY_RADAR_FREEZE: val = rv[RADAR_FREEZE]; break;
|
||||||
case SONG_DIFFICULTY_RADAR_CHAOS: val = fRadarValues[RADAR_CHAOS]; break;
|
case SONG_DIFFICULTY_RADAR_CHAOS: val = rv[RADAR_CHAOS]; break;
|
||||||
case SONG_PROFILE_HIGH_SCORE:
|
case SONG_PROFILE_HIGH_SCORE:
|
||||||
val = 100.0f * PROFILEMAN->GetProfile(m_PlayerNumber)->GetStepsHighScoreList(pSteps).GetTopScore().fPercentDP;
|
val = 100.0f * PROFILEMAN->GetProfile(m_PlayerNumber)->GetStepsHighScoreList(pSteps).GetTopScore().fPercentDP;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -176,6 +176,9 @@ int Profile::GetTotalNumSongsPassed() const
|
|||||||
int Profile::GetTotalHighScoreDancePointsForStepsType( StepsType st ) const
|
int Profile::GetTotalHighScoreDancePointsForStepsType( StepsType st ) const
|
||||||
{
|
{
|
||||||
int iTotal = 0;
|
int iTotal = 0;
|
||||||
|
|
||||||
|
// add steps high scores
|
||||||
|
{
|
||||||
for( std::map<const Steps*,HighScoresForASteps>::const_iterator iter = m_StepsHighScores.begin();
|
for( std::map<const Steps*,HighScoresForASteps>::const_iterator iter = m_StepsHighScores.begin();
|
||||||
iter != m_StepsHighScores.end();
|
iter != m_StepsHighScores.end();
|
||||||
iter++ )
|
iter++ )
|
||||||
@@ -183,13 +186,35 @@ int Profile::GetTotalHighScoreDancePointsForStepsType( StepsType st ) const
|
|||||||
const Steps* pSteps = iter->first;
|
const Steps* pSteps = iter->first;
|
||||||
ASSERT( pSteps );
|
ASSERT( pSteps );
|
||||||
const HighScoresForASteps& h = iter->second;
|
const HighScoresForASteps& h = iter->second;
|
||||||
|
const HighScoreList& hs = h.hs;
|
||||||
if( pSteps->m_StepsType == st )
|
if( pSteps->m_StepsType == st )
|
||||||
{
|
{
|
||||||
const float* fRadars = pSteps->GetRadarValues();
|
const float* fRadars = pSteps->GetRadarValues();
|
||||||
int iPossibleDP = ScoreKeeperMAX2::GetPossibleDancePoints( fRadars );
|
int iPossibleDP = ScoreKeeperMAX2::GetPossibleDancePoints( fRadars );
|
||||||
iTotal += (int)truncf( h.hs.GetTopScore().fPercentDP * iPossibleDP );
|
iTotal += (int)truncf( hs.GetTopScore().fPercentDP * iPossibleDP );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add course high scores
|
||||||
|
{
|
||||||
|
for( std::map<const Course*,HighScoresForACourse>::const_iterator iter = m_CourseHighScores.begin();
|
||||||
|
iter != m_CourseHighScores.end();
|
||||||
|
iter++ )
|
||||||
|
{
|
||||||
|
const Course* pCourse = iter->first;
|
||||||
|
ASSERT( pCourse );
|
||||||
|
const HighScoresForACourse& h = iter->second;
|
||||||
|
FOREACH_CourseDifficulty( cd )
|
||||||
|
{
|
||||||
|
const HighScoreList& hs = h.hs[st][cd];
|
||||||
|
const float* fRadars = pCourse->GetRadarValues(st,cd);
|
||||||
|
int iPossibleDP = ScoreKeeperMAX2::GetPossibleDancePoints( fRadars );
|
||||||
|
iTotal += (int)truncf( hs.GetTopScore().fPercentDP * iPossibleDP );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return iTotal;
|
return iTotal;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -668,7 +668,7 @@ float ScreenRanking::SetPage( PageToShow pts )
|
|||||||
case PageToShow::TYPE_CATEGORY:
|
case PageToShow::TYPE_CATEGORY:
|
||||||
{
|
{
|
||||||
m_textCategory.SetText( ssprintf("Type %c", 'A'+pts.category) );
|
m_textCategory.SetText( ssprintf("Type %c", 'A'+pts.category) );
|
||||||
m_textStepsType.SetText( GameManager::NotesTypeToString(pts.nt) );
|
m_textStepsType.SetText( GameManager::NotesTypeToThemedString(pts.nt) );
|
||||||
|
|
||||||
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,8 +39,6 @@ Steps::Steps()
|
|||||||
m_LoadedFromProfile = PROFILE_SLOT_INVALID;
|
m_LoadedFromProfile = PROFILE_SLOT_INVALID;
|
||||||
m_Difficulty = DIFFICULTY_INVALID;
|
m_Difficulty = DIFFICULTY_INVALID;
|
||||||
m_iMeter = 0;
|
m_iMeter = 0;
|
||||||
for(int i = 0; i < NUM_RADAR_CATEGORIES; ++i)
|
|
||||||
m_fRadarValues[i] = -1; /* unknown */
|
|
||||||
|
|
||||||
notes = NULL;
|
notes = NULL;
|
||||||
notes_comp = NULL;
|
notes_comp = NULL;
|
||||||
@@ -236,8 +234,7 @@ void Steps::DeAutogen()
|
|||||||
m_sDescription = Real()->m_sDescription;
|
m_sDescription = Real()->m_sDescription;
|
||||||
m_Difficulty = Real()->m_Difficulty;
|
m_Difficulty = Real()->m_Difficulty;
|
||||||
m_iMeter = Real()->m_iMeter;
|
m_iMeter = Real()->m_iMeter;
|
||||||
for(int i = 0; i < NUM_RADAR_CATEGORIES; ++i)
|
m_RadarValues = Real()->m_RadarValues;
|
||||||
m_fRadarValues[i] = Real()->m_fRadarValues[i];
|
|
||||||
|
|
||||||
parent = NULL;
|
parent = NULL;
|
||||||
|
|
||||||
@@ -309,7 +306,7 @@ void Steps::SetRadarValue(int r, float val)
|
|||||||
{
|
{
|
||||||
DeAutogen();
|
DeAutogen();
|
||||||
ASSERT(r < NUM_RADAR_CATEGORIES);
|
ASSERT(r < NUM_RADAR_CATEGORIES);
|
||||||
m_fRadarValues[r] = val;
|
m_RadarValues[r] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public:
|
|||||||
CString GetDescription() const { return Real()->m_sDescription; }
|
CString GetDescription() const { return Real()->m_sDescription; }
|
||||||
Difficulty GetDifficulty() const { return Real()->m_Difficulty; }
|
Difficulty GetDifficulty() const { return Real()->m_Difficulty; }
|
||||||
int GetMeter() const { return Real()->m_iMeter; }
|
int GetMeter() const { return Real()->m_iMeter; }
|
||||||
const float *GetRadarValues() const { return Real()->m_fRadarValues; }
|
const RadarValues& GetRadarValues() const { return Real()->m_RadarValues; }
|
||||||
|
|
||||||
void SetDescription(CString desc);
|
void SetDescription(CString desc);
|
||||||
void SetDifficulty(Difficulty d);
|
void SetDifficulty(Difficulty d);
|
||||||
@@ -80,8 +80,7 @@ protected:
|
|||||||
CString m_sDescription; // Step author, edit name, or something meaningful
|
CString m_sDescription; // Step author, edit name, or something meaningful
|
||||||
Difficulty m_Difficulty; // difficulty classification
|
Difficulty m_Difficulty; // difficulty classification
|
||||||
int m_iMeter; // difficulty rating from MIN_METER to MAX_METER
|
int m_iMeter; // difficulty rating from MIN_METER to MAX_METER
|
||||||
float m_fRadarValues[NUM_RADAR_CATEGORIES]; // between 0.0-1.2 starting from 12-o'clock rotating clockwise
|
RadarValues m_RadarValues;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool CompareNotesPointersByRadarValues(const Steps* pNotes1, const Steps* pNotes2);
|
bool CompareNotesPointersByRadarValues(const Steps* pNotes1, const Steps* pNotes2);
|
||||||
|
|||||||
Reference in New Issue
Block a user