From 5ca26b37c2605c08cc1fcfad47809d245c277045 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 12 Sep 2002 07:13:25 +0000 Subject: [PATCH] Remove fallback notes. More code than it's worth. --- stepmania/src/GameManager.cpp | 21 ----------------- stepmania/src/Song.cpp | 43 ++++------------------------------ stepmania/src/SongSelector.cpp | 3 +-- stepmania/src/StyleDef.cpp | 2 -- stepmania/src/StyleDef.h | 3 --- stepmania/src/song.h | 3 +-- 6 files changed, 6 insertions(+), 69 deletions(-) diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index 988d3da310..6e3f0014df 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -381,7 +381,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "DDR Single", // m_szName { NOTES_TYPE_DANCE_SINGLE,NOTES_TYPE_DANCE_SINGLE }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 4, // m_iColsPerPlayer @@ -409,7 +408,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = false, // m_bUsedForEdit "DDR Versus", // m_szName { NOTES_TYPE_DANCE_SINGLE,NOTES_TYPE_DANCE_SINGLE }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 4, // m_iColsPerPlayer @@ -437,7 +435,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "DDR Double", // m_szName { NOTES_TYPE_DANCE_DOUBLE,NOTES_TYPE_DANCE_DOUBLE }, // m_NotesTypes - NOTES_TYPE_INVALID, StyleDef::ONE_PLAYER_TWO_CREDITS, // m_StyleType { 320, 320 }, // m_iCenterX 8, // m_iColsPerPlayer @@ -473,7 +470,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = false, // m_bUsedForEdit "DDR Couples", // m_szName { NOTES_TYPE_DANCE_COUPLE_1, NOTES_TYPE_DANCE_COUPLE_2 }, // m_NotesTypes - NOTES_TYPE_DANCE_SINGLE, // m_FallbackNotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 4, // m_iColsPerPlayer @@ -501,7 +497,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "DDR Solo", // m_szName { NOTES_TYPE_DANCE_SOLO,NOTES_TYPE_DANCE_SOLO }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 320, 320 }, // m_iCenterX 6, // m_iColsPerPlayer @@ -533,7 +528,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "DDR Couples Player 1", // m_szName { NOTES_TYPE_DANCE_COUPLE_1, NOTES_TYPE_DANCE_COUPLE_1 }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::ONE_PLAYER_TWO_CREDITS, // m_StyleType { 320, 320 }, // m_iCenterX 4, // m_iColsPerPlayer @@ -561,7 +555,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "DDR Couples Player 2", // m_szName { NOTES_TYPE_DANCE_COUPLE_2, NOTES_TYPE_DANCE_COUPLE_2 }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::ONE_PLAYER_TWO_CREDITS, // m_StyleType { 320, 320 }, // m_iCenterX 4, // m_iColsPerPlayer @@ -617,7 +610,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "Pump Single", // m_szName { NOTES_TYPE_PUMP_SINGLE,NOTES_TYPE_PUMP_SINGLE }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -647,7 +639,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = false, // m_bUsedForEdit "Pump Versus", // m_szName { NOTES_TYPE_PUMP_SINGLE,NOTES_TYPE_PUMP_SINGLE }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -677,7 +668,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "Pump Double", // m_szName { NOTES_TYPE_PUMP_DOUBLE,NOTES_TYPE_PUMP_DOUBLE }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::ONE_PLAYER_TWO_CREDITS, // m_StyleType { 320, 480 }, // m_iCenterX 10, // m_iColsPerPlayer @@ -717,7 +707,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = false, // m_bUsedForEdit "Pump Couples", // m_szName { 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 @@ -747,7 +736,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "Pump Couples Player 1", // m_szName { NOTES_TYPE_PUMP_COUPLE_1,NOTES_TYPE_PUMP_COUPLE_1}, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -777,7 +765,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "Pump Couples Player 2", // m_szName { NOTES_TYPE_PUMP_COUPLE_2,NOTES_TYPE_PUMP_COUPLE_2}, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -808,7 +795,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "EZ2 Single", // m_szName { NOTES_TYPE_EZ2_SINGLE,NOTES_TYPE_EZ2_SINGLE }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -838,7 +824,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "EZ2 SingleHard", // m_szName { NOTES_TYPE_EZ2_SINGLE_HARD,NOTES_TYPE_EZ2_SINGLE_HARD}, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -868,7 +853,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "EZ2 Real", // m_szName { NOTES_TYPE_EZ2_REAL,NOTES_TYPE_EZ2_REAL }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 7, // m_iColsPerPlayer @@ -902,7 +886,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "EZ2Double", // m_szName { NOTES_TYPE_EZ2_DOUBLE,NOTES_TYPE_EZ2_DOUBLE }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 10, // m_iColsPerPlayer @@ -942,7 +925,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "EZ2 Versus", // m_szName { NOTES_TYPE_EZ2_SINGLE,NOTES_TYPE_EZ2_SINGLE }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -972,7 +954,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "EZ2 VersusHard", // m_szName { NOTES_TYPE_EZ2_SINGLE_HARD,NOTES_TYPE_EZ2_SINGLE_HARD }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -1002,7 +983,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "EZ2 VersusReal", // m_szName { NOTES_TYPE_EZ2_REAL,NOTES_TYPE_EZ2_REAL }, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 7, // m_iColsPerPlayer @@ -1036,7 +1016,6 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForEdit "Para Single", // m_szName { NOTES_TYPE_PARA,NOTES_TYPE_PARA}, // m_NotesTypes - NOTES_TYPE_INVALID, // m_FallbackNotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 320, 320 }, // m_iCenterX 5, // m_iColsPerPlayer diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index b431ac9aba..ba210236cd 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -10,19 +10,6 @@ ----------------------------------------------------------------------------- */ -/* Couples notes: - * Couples is just two sets of notes, paired as a game type, with a fallback - * to the normal mode. This lets us import Pump _2 songs without having to - * duplicate the _1 side for couples. This way, we get to handle couples - * the same way in every game. (Which is nice, because not many people - * use couples.) - * - * This does mean it's impossible to tell (in the current UI) whether a - * given song has couples or not; they all show up the same, even if both - * sides are using the fallback. (Except that couples songs tend to have - * slightly varying radar values, unless the pattern is just flipped.) - * -glenn - */ #include "Notes.h" #include "RageUtil.h" #include // for fmod @@ -567,35 +554,14 @@ void Song::TidyUpData() } } -/* 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 +/* Get Notes that match a given style and player. */ +void Song::GetNotesThatMatch( const StyleDef *s, int p, CArray& arrayAddTo ) 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 == nt ) - { + if( m_apNotes[i]->m_NotesType == s->m_NotesTypes[p] ) arrayAddTo.Add( m_apNotes[i] ); - ret++; - } } - return ret; } /* Return whether the song is playable in the given style. */ @@ -604,8 +570,7 @@ bool Song::SongCompleteForStyle( const StyleDef *st ) const for( int pn = 0; pn < NUM_PLAYERS; ++pn ) { if(st->m_NotesTypes[pn] == NOTES_TYPE_INVALID) continue; /* unused */ - if(!SongHasNotesType(st->m_NotesTypes[pn]) && - !SongHasNotesType(st->m_FallbackNotesType)) + if(!SongHasNotesType(st->m_NotesTypes[pn])) return false; } return true; diff --git a/stepmania/src/SongSelector.cpp b/stepmania/src/SongSelector.cpp index 57f2c808ec..30321bb88f 100644 --- a/stepmania/src/SongSelector.cpp +++ b/stepmania/src/SongSelector.cpp @@ -265,8 +265,7 @@ void SongSelector::OnNotesTypeChange() m_textStyle.SetText( GAMEMAN->GetStyleDefForStyle(GetSelectedStyle())->m_szName ); m_pNotess.RemoveAll(); - /* Only get primary notes in this style, not fallback notes. */ - GetSelectedSong()->GetNotesThatMatch( GAMEMAN->GetStyleDefForStyle(GetSelectedStyle()), 0, m_pNotess, false ); + GetSelectedSong()->GetNotesThatMatch( GAMEMAN->GetStyleDefForStyle(GetSelectedStyle()), 0, m_pNotess ); SortNotesArrayByDifficulty( m_pNotess ); m_pNotess.Add( NULL ); // marker for "(NEW)" m_iSelectedNotes = 0; diff --git a/stepmania/src/StyleDef.cpp b/stepmania/src/StyleDef.cpp index e4b8de0531..f3db155b7d 100644 --- a/stepmania/src/StyleDef.cpp +++ b/stepmania/src/StyleDef.cpp @@ -84,9 +84,7 @@ PlayerNumber StyleDef::ControllerToPlayerNumber( GameController controller ) con bool StyleDef::MatchesNotesType( NotesType type, int pn ) const { if(type == m_NotesTypes[pn]) return true; - if(type == m_FallbackNotesType) return true; return false; - } diff --git a/stepmania/src/StyleDef.h b/stepmania/src/StyleDef.h index 18d00e790d..8b56ecb7a8 100644 --- a/stepmania/src/StyleDef.h +++ b/stepmania/src/StyleDef.h @@ -46,9 +46,6 @@ public: * for each player in couples. */ NotesType m_NotesTypes[NUM_PLAYERS]; - /* This type is used as a fallback; if, for any player, m_StyleType[p] isn't - * available, this type will be used. Use NOTES_TYPE_INVALID for no fallback. */ - NotesType m_FallbackNotesType; enum StyleType { ONE_PLAYER_ONE_CREDIT, // e.g. single diff --git a/stepmania/src/song.h b/stepmania/src/song.h index ff528fbf09..8b00503422 100644 --- a/stepmania/src/song.h +++ b/stepmania/src/song.h @@ -176,8 +176,7 @@ 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, bool UseFallbacks = true) const; - int GetNotesThatMatch( NotesType nt, CArray& arrayAddTo ) const; + void GetNotesThatMatch( const StyleDef *s, int p, CArray& arrayAddTo ) const; int GetNumTimesPlayed() const; bool IsNew() const; bool IsEasy( NotesType nt ) const;