diff --git a/stepmania/src/HighScore.cpp b/stepmania/src/HighScore.cpp index e12c84b96d..9f8307bbaa 100644 --- a/stepmania/src/HighScore.cpp +++ b/stepmania/src/HighScore.cpp @@ -58,6 +58,7 @@ XNode* HighScore::CreateNode() const pNode->AppendChild( "Time", (int)time ); pNode->AppendChild( "PlayerGuid", sPlayerGuid ); pNode->AppendChild( "MachineGuid", sMachineGuid ); + pNode->AppendChild( "ProductID", iProductID ); return pNode; } @@ -87,6 +88,7 @@ void HighScore::LoadFromNode( const XNode* pNode ) else if( (*child)->name == "Time" ) (*child)->GetValue( (int&)time ); else if( (*child)->name == "PlayerGuid" ) (*child)->GetValue( sPlayerGuid ); else if( (*child)->name == "MachineGuid" ) (*child)->GetValue( sMachineGuid ); + else if( (*child)->name == "ProductID" ) (*child)->GetValue( iProductID ); } /* Validate input. */ diff --git a/stepmania/src/HighScore.h b/stepmania/src/HighScore.h index 4cdac1e00e..f572aca8ae 100644 --- a/stepmania/src/HighScore.h +++ b/stepmania/src/HighScore.h @@ -26,7 +26,7 @@ struct HighScore time_t time; // return value of time() when screenshot was taken CString sPlayerGuid; // who made this high score CString sMachineGuid; // where this high score was made - + int iProductID; HighScore() { Unset(); } void Unset() @@ -40,6 +40,7 @@ struct HighScore time = 0; sPlayerGuid = ""; sMachineGuid = ""; + iProductID = 0; } bool operator>=( const HighScore& other ) const; @@ -55,6 +56,7 @@ struct HighScore COMPARE( time ); COMPARE( sPlayerGuid ); COMPARE( sMachineGuid ); + COMPARE( iProductID ); #undef COMPARE return true; } diff --git a/stepmania/src/PrefsManager.cpp b/stepmania/src/PrefsManager.cpp index 2fc42ac44d..f5660e5599 100644 --- a/stepmania/src/PrefsManager.cpp +++ b/stepmania/src/PrefsManager.cpp @@ -298,6 +298,7 @@ void PrefsManager::Init() } m_sMemoryCardProfileSubdir = PRODUCT_NAME; + m_iProductID = 1; } PrefsManager::~PrefsManager() @@ -507,6 +508,7 @@ void PrefsManager::ReadPrefsFromFile( CString sIni ) ini.GetValue( "Options", "DisableScreenSaver", m_bDisableScreenSaver ); ini.GetValue( "Options", "MemoryCardProfileSubdir", m_sMemoryCardProfileSubdir ); + ini.GetValue( "Options", "ProductID", m_iProductID ); FOREACH_PlayerNumber( p ) { ini.GetValue( "Options", ssprintf("DefaultLocalProfileIDP%d",p+1), m_sDefaultLocalProfileID[p] ); @@ -733,6 +735,7 @@ void PrefsManager::SaveGlobalPrefsToDisk() const ini.SetValue( "Options", "DisableScreenSaver", m_bDisableScreenSaver ); ini.SetValue( "Options", "MemoryCardProfileSubdir", m_sMemoryCardProfileSubdir ); + ini.SetValue( "Options", "ProductID", m_iProductID ); FOREACH_PlayerNumber( p ) { ini.SetValue( "Options", ssprintf("DefaultLocalProfileIDP%d",p+1), m_sDefaultLocalProfileID[p] ); @@ -796,4 +799,3 @@ void PrefsManager::ResetToFactoryDefaults() SaveGlobalPrefsToDisk(); m_bFirstRun = false; } - diff --git a/stepmania/src/PrefsManager.h b/stepmania/src/PrefsManager.h index f0e0cbfa1d..9bee0a8dfc 100644 --- a/stepmania/src/PrefsManager.h +++ b/stepmania/src/PrefsManager.h @@ -182,6 +182,7 @@ public: bool m_bDisableScreenSaver; CString m_sLanguage; CString m_sMemoryCardProfileSubdir; // the directory on a memory card to look in for a profile + int m_iProductID; // Saved in HighScore to track what software version a score came from. CString m_sDefaultLocalProfileID[NUM_PLAYERS]; CString m_sMemoryCardOsMountPoint[NUM_PLAYERS]; // if set, always use the device that mounts to this point int m_iMemoryCardUsbBus[NUM_PLAYERS]; // look for this bus when assigning cards. -1 = match any diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index ab3d0d7e26..36787b7a27 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -898,6 +898,7 @@ void ScreenEvaluation::CommitScores( hs.time = time(NULL); hs.sPlayerGuid = PROFILEMAN->IsUsingProfile(p) ? PROFILEMAN->GetProfile(p)->m_sGuid : ""; hs.sMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid; + hs.iProductID = PREFSMAN->m_iProductID; StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;