floating-point scores
This commit is contained in:
@@ -178,7 +178,14 @@ ScreenEvaluation::ScreenEvaluation( CString sClassName ) : Screen(sClassName)
|
|||||||
if( GAMESTATE->IsHumanPlayer(p) && GAMESTATE->m_SongOptions.m_bSaveScore )
|
if( GAMESTATE->IsHumanPlayer(p) && GAMESTATE->m_SongOptions.m_bSaveScore )
|
||||||
{
|
{
|
||||||
if( GAMESTATE->m_pCurNotes[p] )
|
if( GAMESTATE->m_pCurNotes[p] )
|
||||||
GAMESTATE->m_pCurNotes[p]->AddScore( (PlayerNumber)p, grade[p], stageStats.iScore[p] + stageStats.iBonus[p], bNewRecord[p] );
|
{
|
||||||
|
float score;
|
||||||
|
if( PREFSMAN->m_bPercentageScoring )
|
||||||
|
score = stageStats.GetPercentDancePoints( (PlayerNumber)p );
|
||||||
|
else
|
||||||
|
score = float(stageStats.iScore[p] + stageStats.iBonus[p]);
|
||||||
|
GAMESTATE->m_pCurNotes[p]->AddScore( (PlayerNumber)p, grade[p], score, bNewRecord[p] );
|
||||||
|
}
|
||||||
|
|
||||||
// update unlock data if unlocks are on
|
// update unlock data if unlocks are on
|
||||||
if ( PREFSMAN->m_bUseUnlockSystem )
|
if ( PREFSMAN->m_bUseUnlockSystem )
|
||||||
|
|||||||
@@ -900,12 +900,12 @@ void ScreenSelectMusic::AfterNotesChange( PlayerNumber pn )
|
|||||||
|
|
||||||
if( pNotes )
|
if( pNotes )
|
||||||
{
|
{
|
||||||
int iScore;
|
float fScore;
|
||||||
if( PROFILEMAN->IsUsingProfile(pn) )
|
if( PROFILEMAN->IsUsingProfile(pn) )
|
||||||
iScore = pNotes->m_MemCardScores[pn].iScore;
|
fScore = pNotes->m_MemCardScores[pn].fScore;
|
||||||
else
|
else
|
||||||
iScore = pNotes->m_MemCardScores[MEMORY_CARD_MACHINE].iScore;
|
fScore = pNotes->m_MemCardScores[MEMORY_CARD_MACHINE].fScore;
|
||||||
m_textHighScore[pn].SetText( ssprintf("%*i", NUM_SCORE_DIGITS, iScore) );
|
m_textHighScore[pn].SetText( ssprintf("%*i", NUM_SCORE_DIGITS, (int) fScore) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -358,14 +358,14 @@ void SongManager::ReadNoteScoresFromFile( CString fn, int c )
|
|||||||
|
|
||||||
int iNumTimesPlayed;
|
int iNumTimesPlayed;
|
||||||
Grade grade;
|
Grade grade;
|
||||||
int iScore;
|
float fScore;
|
||||||
if( sscanf(line.c_str(), "%d %d %i\n", &iNumTimesPlayed, (int *)&grade, &iScore) != 3 )
|
if( sscanf(line.c_str(), "%d %d %f\n", &iNumTimesPlayed, (int *)&grade, &fScore) != 3 )
|
||||||
break;
|
break;
|
||||||
if( pNotes )
|
if( pNotes )
|
||||||
{
|
{
|
||||||
pNotes->m_MemCardScores[c].iNumTimesPlayed = iNumTimesPlayed;
|
pNotes->m_MemCardScores[c].iNumTimesPlayed = iNumTimesPlayed;
|
||||||
pNotes->m_MemCardScores[c].grade = grade;
|
pNotes->m_MemCardScores[c].grade = grade;
|
||||||
pNotes->m_MemCardScores[c].iScore = iScore;
|
pNotes->m_MemCardScores[c].fScore = fScore;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -550,10 +550,10 @@ void SongManager::ReadSM300NoteScores()
|
|||||||
|
|
||||||
iRetVal = sscanf(
|
iRetVal = sscanf(
|
||||||
value,
|
value,
|
||||||
"%d::%[^:]::%d::%d",
|
"%d::%[^:]::%f::%d",
|
||||||
&pNotes->m_MemCardScores[MEMORY_CARD_MACHINE].iNumTimesPlayed,
|
&pNotes->m_MemCardScores[MEMORY_CARD_MACHINE].iNumTimesPlayed,
|
||||||
szGradeLetters,
|
szGradeLetters,
|
||||||
&pNotes->m_MemCardScores[MEMORY_CARD_MACHINE].iScore,
|
&pNotes->m_MemCardScores[MEMORY_CARD_MACHINE].fScore,
|
||||||
&iMaxCombo
|
&iMaxCombo
|
||||||
);
|
);
|
||||||
if( iRetVal != 4 )
|
if( iRetVal != 4 )
|
||||||
@@ -661,10 +661,10 @@ void SongManager::SaveNoteScoresToFile( CString fn, int c )
|
|||||||
pNotes->GetDifficulty(),
|
pNotes->GetDifficulty(),
|
||||||
pNotes->GetDescription().c_str() );
|
pNotes->GetDescription().c_str() );
|
||||||
|
|
||||||
fprintf(fp, "%d %d %i\n",
|
fprintf(fp, "%d %d %f\n",
|
||||||
pNotes->m_MemCardScores[c].iNumTimesPlayed,
|
pNotes->m_MemCardScores[c].iNumTimesPlayed,
|
||||||
pNotes->m_MemCardScores[c].grade,
|
pNotes->m_MemCardScores[c].grade,
|
||||||
pNotes->m_MemCardScores[c].iScore);
|
pNotes->m_MemCardScores[c].fScore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ Steps::Steps()
|
|||||||
{
|
{
|
||||||
m_MemCardScores[m].iNumTimesPlayed = 0;
|
m_MemCardScores[m].iNumTimesPlayed = 0;
|
||||||
m_MemCardScores[m].grade = GRADE_NO_DATA;
|
m_MemCardScores[m].grade = GRADE_NO_DATA;
|
||||||
m_MemCardScores[m].iScore = 0;
|
m_MemCardScores[m].fScore = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,32 +298,32 @@ void Steps::SetRadarValue(int r, float val)
|
|||||||
* XXX: Isn't it possible to beat the grade but not beat the score, since
|
* XXX: Isn't it possible to beat the grade but not beat the score, since
|
||||||
* grading and scores are on completely different systems? Should we be
|
* grading and scores are on completely different systems? Should we be
|
||||||
* checking for these completely separately? */
|
* checking for these completely separately? */
|
||||||
bool Steps::MemCardScore::HigherScore( int vsScore, Grade vsGrade ) const
|
bool Steps::MemCardScore::HigherScore( float vsScore, Grade vsGrade ) const
|
||||||
{
|
{
|
||||||
if( vsScore > this->iScore )
|
if( vsScore > this->fScore )
|
||||||
return true;
|
return true;
|
||||||
if( vsScore < this->iScore )
|
if( vsScore < this->fScore )
|
||||||
return false;
|
return false;
|
||||||
return vsGrade > this->grade;
|
return vsGrade > this->grade;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Steps::AddScore( PlayerNumber pn, Grade grade, int iScore, bool& bNewRecordOut )
|
void Steps::AddScore( PlayerNumber pn, Grade grade, float fScore, bool& bNewRecordOut )
|
||||||
{
|
{
|
||||||
bNewRecordOut = false;
|
bNewRecordOut = false;
|
||||||
|
|
||||||
m_MemCardScores[MEMORY_CARD_MACHINE].iNumTimesPlayed++;
|
m_MemCardScores[MEMORY_CARD_MACHINE].iNumTimesPlayed++;
|
||||||
m_MemCardScores[pn].iNumTimesPlayed++;
|
m_MemCardScores[pn].iNumTimesPlayed++;
|
||||||
|
|
||||||
if( m_MemCardScores[pn].HigherScore(iScore, grade) && iScore > 0)
|
if( m_MemCardScores[pn].HigherScore(fScore, grade) && fScore > 0)
|
||||||
{
|
{
|
||||||
m_MemCardScores[pn].iScore = iScore;
|
m_MemCardScores[pn].fScore = fScore;
|
||||||
m_MemCardScores[pn].grade = grade;
|
m_MemCardScores[pn].grade = grade;
|
||||||
bNewRecordOut = true;
|
bNewRecordOut = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_MemCardScores[MEMORY_CARD_MACHINE].HigherScore(iScore, grade) )
|
if( m_MemCardScores[MEMORY_CARD_MACHINE].HigherScore(fScore, grade) )
|
||||||
{
|
{
|
||||||
m_MemCardScores[MEMORY_CARD_MACHINE].iScore = iScore;
|
m_MemCardScores[MEMORY_CARD_MACHINE].fScore = fScore;
|
||||||
m_MemCardScores[MEMORY_CARD_MACHINE].grade = grade;
|
m_MemCardScores[MEMORY_CARD_MACHINE].grade = grade;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,11 +58,11 @@ public:
|
|||||||
{
|
{
|
||||||
int iNumTimesPlayed;
|
int iNumTimesPlayed;
|
||||||
Grade grade;
|
Grade grade;
|
||||||
int iScore;
|
float fScore;
|
||||||
bool HigherScore( int iScore, Grade grade ) const;
|
bool HigherScore( float fScore, Grade grade ) const;
|
||||||
} m_MemCardScores[NUM_MEMORY_CARDS];
|
} m_MemCardScores[NUM_MEMORY_CARDS];
|
||||||
|
|
||||||
void AddScore( PlayerNumber pn, Grade grade, int iScore, bool& bNewRecordOut );
|
void AddScore( PlayerNumber pn, Grade grade, float fScore, bool& bNewRecordOut );
|
||||||
|
|
||||||
|
|
||||||
void TidyUpData();
|
void TidyUpData();
|
||||||
|
|||||||
Reference in New Issue
Block a user