diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index ac2d94b86f..683f059bac 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -28,6 +28,7 @@ #include "RageFile.h" #include "arch/arch.h" #include "ThemeManager.h" +#include "ProfileManager.h" /* Amount to increase meter ranges to make them difficult: */ const int DIFFICULT_METER_CHANGE = 2; @@ -1005,3 +1006,13 @@ bool Course::IsRanking() const return false; } + +void Course::AddHighScore( StepsType st, PlayerNumber pn, MemCardData::HighScore hs, int &iPersonalIndexOut, int &iMachineIndexOut ) +{ + hs.sName = RANKING_TO_FILL_IN_MARKER[pn]; + if( PROFILEMAN->IsUsingProfile(pn) ) + m_MemCardDatas[st][pn].AddHighScore( hs, iPersonalIndexOut ); + else + iPersonalIndexOut = -1; + m_MemCardDatas[st][MEMORY_CARD_MACHINE].AddHighScore( hs, iMachineIndexOut ); +} diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index 2aae9e342c..b55d5157b3 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -176,12 +176,7 @@ public: } m_MemCardDatas[NUM_STEPS_TYPES][NUM_MEMORY_CARDS]; - void AddHighScore( StepsType st, PlayerNumber pn, MemCardData::HighScore hs, int &iPersonalIndexOut, int &iMachineIndexOut ) - { - hs.sName = RANKING_TO_FILL_IN_MARKER[pn]; - m_MemCardDatas[st][pn].AddHighScore( hs, iPersonalIndexOut ); - m_MemCardDatas[st][MEMORY_CARD_MACHINE].AddHighScore( hs, iMachineIndexOut ); - } + void AddHighScore( StepsType st, PlayerNumber pn, MemCardData::HighScore hs, int &iPersonalIndexOut, int &iMachineIndexOut ); MemCardData::HighScore GetTopScore( StepsType st, MemoryCard card ) { diff --git a/stepmania/src/Steps.cpp b/stepmania/src/Steps.cpp index 09f38e442d..8c191f77c6 100644 --- a/stepmania/src/Steps.cpp +++ b/stepmania/src/Steps.cpp @@ -24,6 +24,7 @@ #include "MsdFile.h" #include "GameManager.h" #include "NoteDataUtil.h" +#include "ProfileManager.h" Steps::Steps() @@ -357,3 +358,13 @@ void Steps::MemCardData::AddHighScore( Steps::MemCardData::HighScore hs, int &iI vHighScores.erase( vHighScores.begin()+NUM_RANKING_LINES, vHighScores.end() ); } } + +void Steps::AddHighScore( PlayerNumber pn, MemCardData::HighScore hs, int &iPersonalIndexOut, int &iMachineIndexOut ) +{ + hs.sName = RANKING_TO_FILL_IN_MARKER[pn]; + if( PROFILEMAN->IsUsingProfile(pn) ) + m_MemCardDatas[pn].AddHighScore( hs, iPersonalIndexOut ); + else + iPersonalIndexOut = -1; + m_MemCardDatas[MEMORY_CARD_MACHINE].AddHighScore( hs, iMachineIndexOut ); +} diff --git a/stepmania/src/Steps.h b/stepmania/src/Steps.h index d4a7c19e96..539a718a61 100644 --- a/stepmania/src/Steps.h +++ b/stepmania/src/Steps.h @@ -92,12 +92,7 @@ public: } m_MemCardDatas[NUM_MEMORY_CARDS]; - void AddHighScore( PlayerNumber pn, MemCardData::HighScore hs, int &iPersonalIndexOut, int &iMachineIndexOut ) - { - hs.sName = RANKING_TO_FILL_IN_MARKER[pn]; - m_MemCardDatas[pn].AddHighScore( hs, iPersonalIndexOut ); - m_MemCardDatas[MEMORY_CARD_MACHINE].AddHighScore( hs, iMachineIndexOut ); - } + void AddHighScore( PlayerNumber pn, MemCardData::HighScore hs, int &iPersonalIndexOut, int &iMachineIndexOut ); MemCardData::HighScore GetTopScore( MemoryCard card ) {