only keep top 3 scores in players' stats.xml to keep the file size small

This commit is contained in:
Chris Danford
2004-05-28 04:46:43 +00:00
parent 58439b1ed8
commit aee70ad0cc
7 changed files with 36 additions and 24 deletions
+4 -2
View File
@@ -125,7 +125,7 @@ void HighScoreList::Init()
vHighScores.clear();
}
void HighScoreList::AddHighScore( HighScore hs, int &iIndexOut )
void HighScoreList::AddHighScore( HighScore hs, int &iIndexOut, bool bIsMachine )
{
int i;
for( i=0; i<(int)vHighScores.size(); i++ )
@@ -133,7 +133,9 @@ void HighScoreList::AddHighScore( HighScore hs, int &iIndexOut )
if( hs >= vHighScores[i] )
break;
}
const int iMaxScores = PREFSMAN->m_iMaxHighScoresPerList;
const int iMaxScores = bIsMachine ?
PREFSMAN->m_iMaxHighScoresPerListForMachine :
PREFSMAN->m_iMaxHighScoresPerListForPlayer;
if( i < iMaxScores )
{
vHighScores.insert( vHighScores.begin()+i, hs );