From 048828e544e69c341d5b55eb9ee6a6ebce3ae4fe Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 27 Sep 2003 19:23:15 +0000 Subject: [PATCH] Add ComparePlayerOptions and CompareSongOptions. Fix "c200" never parsing. --- stepmania/src/PlayerOptions.cpp | 33 ++++++++++++++++++++++++++++++++- stepmania/src/SongOptions.cpp | 16 ++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/stepmania/src/PlayerOptions.cpp b/stepmania/src/PlayerOptions.cpp index df5b3db9d8..015f087b09 100644 --- a/stepmania/src/PlayerOptions.cpp +++ b/stepmania/src/PlayerOptions.cpp @@ -201,7 +201,7 @@ void PlayerOptions::FromString( CString sOptions ) continue; } - else if( sscanf( sBit, "C%d", &i1 ) == 1 ) + else if( sscanf( sBit, "c%d", &i1 ) == 1 ) { m_bTimeSpacing = true; m_fScrollBPM = (float) i1; @@ -441,3 +441,34 @@ float PlayerOptions::GetReversePercentForColumn( int iCol ) f -= 1; return f; } + +bool ComparePlayerOptions( const PlayerOptions &po1, const PlayerOptions &po2 ) +{ +#define COMPARE(x) { if( po1.x != po2.x ) return false; } + COMPARE(m_bTimeSpacing); + COMPARE(m_fScrollSpeed); + COMPARE(m_fScrollBPM); + COMPARE(m_fDark); + COMPARE(m_fBlind); + COMPARE(m_Turn); + COMPARE(m_Transform); + COMPARE(m_bHoldNotes); + COMPARE(m_bTimingAssist); + COMPARE(m_bProTiming); + COMPARE(m_fPerspectiveTilt); + COMPARE(m_fSkew); + COMPARE(m_sPositioning); + COMPARE(m_sNoteSkin); + int i; + for( i = 0; i < PlayerOptions::NUM_ACCELS; ++i ) + COMPARE(m_fAccels[i]); + for( i = 0; i < PlayerOptions::NUM_EFFECTS; ++i ) + COMPARE(m_fEffects[i]); + for( i = 0; i < PlayerOptions::NUM_APPEARANCES; ++i ) + COMPARE(m_fAppearances[i]); + for( i = 0; i < PlayerOptions::NUM_SCROLLS; ++i ) + COMPARE(m_fScrolls[i]); +#undef COMPARE + + return true; +} diff --git a/stepmania/src/SongOptions.cpp b/stepmania/src/SongOptions.cpp index db4ce2bcfd..bc066dd326 100644 --- a/stepmania/src/SongOptions.cpp +++ b/stepmania/src/SongOptions.cpp @@ -114,3 +114,19 @@ void SongOptions::FromString( CString sOptions ) else if( sBit == "savescore" ) m_bSaveScore = on; } } + +bool CompareSongOptions( const SongOptions &so1, const SongOptions &so2 ) +{ +#define COMPARE(x) { if( so1.x != so2.x ) return false; } + COMPARE( m_LifeType ); + COMPARE( m_DrainType ); + COMPARE( m_iBatteryLives ); + COMPARE( m_FailType ); + COMPARE( m_fMusicRate ); + COMPARE( m_bAssistTick ); + COMPARE( m_bAutoSync ); + COMPARE( m_bSaveScore ); +#undef COMPARE + + return true; +}