diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index 2020918c1f..988d3da310 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -471,9 +471,9 @@ StyleDef g_StyleDefs[NUM_STYLES] = GAME_DANCE, // m_Game true, // m_bUsedForGameplay false, // m_bUsedForEdit - "DDR Couple", // m_szName + "DDR Couples", // m_szName { NOTES_TYPE_DANCE_COUPLE_1, NOTES_TYPE_DANCE_COUPLE_2 }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType + NOTES_TYPE_DANCE_SINGLE, // m_FallbackNotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 4, // m_iColsPerPlayer @@ -716,8 +716,8 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay false, // m_bUsedForEdit "Pump Couples", // m_szName - { NOTES_TYPE_PUMP_SINGLE,NOTES_TYPE_PUMP_COUPLE_2}, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType + { NOTES_TYPE_PUMP_COUPLE_1,NOTES_TYPE_PUMP_COUPLE_2}, // m_NotesTypes + NOTES_TYPE_PUMP_SINGLE, // m_FallbackNotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 367fbeb4fb..53236e6f67 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -556,15 +556,35 @@ void Song::TidyUpData() } } -/* Get Notes that match a given style and player. */ -void Song::GetNotesThatMatch( const StyleDef *s, int p, CArray& arrayAddTo ) const +/* Get Notes that match a given style and player. + * + * If UseFallbacks is true, fallback notes will be returned if (and + * only if) no non-fallback notes are found at all. + * + * If UseFallbacks is false, fallback notes will never be returned. + */ +void Song::GetNotesThatMatch( const StyleDef *s, int p, CArray& arrayAddTo, bool UseFallbacks ) const { + int cnt = GetNotesThatMatch( s->m_NotesTypes[p], arrayAddTo ); + + if ( UseFallbacks && !cnt ) + GetNotesThatMatch( s->m_FallbackNotesType, arrayAddTo ); +} + +/* Get note patterns of the given type; return the number of patterns returned. */ +int Song::GetNotesThatMatch( NotesType nt, CArray& arrayAddTo ) const +{ + int ret=0; + for( int i=0; im_NotesType == s->m_NotesTypes[p] || - m_apNotes[i]->m_NotesType == s->m_FallbackNotesType ) + if( m_apNotes[i]->m_NotesType == nt ) + { arrayAddTo.Add( m_apNotes[i] ); + ret++; + } } + return ret; } /* Return whether the song is playable in the given style. */ diff --git a/stepmania/src/SongSelector.cpp b/stepmania/src/SongSelector.cpp index 2adad9ff6d..57f2c808ec 100644 --- a/stepmania/src/SongSelector.cpp +++ b/stepmania/src/SongSelector.cpp @@ -265,8 +265,8 @@ void SongSelector::OnNotesTypeChange() m_textStyle.SetText( GAMEMAN->GetStyleDefForStyle(GetSelectedStyle())->m_szName ); m_pNotess.RemoveAll(); - /* XXX. This will list fallback notes, which we don't want. */ - GetSelectedSong()->GetNotesThatMatch( GAMEMAN->GetStyleDefForStyle(GetSelectedStyle()), 0, m_pNotess ); + /* Only get primary notes in this style, not fallback notes. */ + GetSelectedSong()->GetNotesThatMatch( GAMEMAN->GetStyleDefForStyle(GetSelectedStyle()), 0, m_pNotess, false ); SortNotesArrayByDifficulty( m_pNotess ); m_pNotess.Add( NULL ); // marker for "(NEW)" m_iSelectedNotes = 0; diff --git a/stepmania/src/song.h b/stepmania/src/song.h index b2969e5030..2ba33cd38c 100644 --- a/stepmania/src/song.h +++ b/stepmania/src/song.h @@ -174,7 +174,8 @@ public: bool SongCompleteForStyle( const StyleDef *st ) const; bool SongHasNotesType( NotesType nt ) const; bool SongHasNotesTypeAndDifficulty( NotesType nt, DifficultyClass dc ) const; - void GetNotesThatMatch( const StyleDef *s, int p, CArray& arrayAddTo ) const; + void GetNotesThatMatch( const StyleDef *s, int p, CArray& arrayAddTo, bool UseFallbacks = true) const; + int GetNotesThatMatch( NotesType nt, CArray& arrayAddTo ) const; int GetNumTimesPlayed() const; bool IsNew() const; bool IsEasy( NotesType nt ) const;