diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index c226db618b..f50467ee7c 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -184,10 +184,8 @@ Notes* Course::GetNotesForStage( int iStage ) for( int i=0; im_apNotes.GetSize(); i++ ) { Notes* pNotes = pSong->m_apNotes[i]; - /* XXX: hmm. We need to match the first player, then set up other players - * later ... */ if( 0==stricmp(pNotes->m_sDescription, sDescription) && - GAMESTATE->GetCurrentStyleDef()->MatchesNotesType(pNotes->m_NotesType, 0) ) + GAMESTATE->GetCurrentStyleDef()->MatchesNotesType(pNotes->m_NotesType) ) return pNotes; } @@ -199,7 +197,7 @@ Notes* Course::GetNotesForStage( int iStage ) { Notes* pNotes = pSong->m_apNotes[i]; if( pNotes->m_Difficulty == dc && - GAMESTATE->GetCurrentStyleDef()->MatchesNotesType(pNotes->m_NotesType, 0) ) + GAMESTATE->GetCurrentStyleDef()->MatchesNotesType(pNotes->m_NotesType) ) return pNotes; } diff --git a/stepmania/src/GameManager.cpp b/stepmania/src/GameManager.cpp index 9a7309fc42..f11e74e73d 100644 --- a/stepmania/src/GameManager.cpp +++ b/stepmania/src/GameManager.cpp @@ -382,7 +382,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay true, // m_bUsedForEdit "single", // m_szName - { NOTES_TYPE_DANCE_SINGLE,NOTES_TYPE_DANCE_SINGLE }, // m_NotesTypes + NOTES_TYPE_DANCE_SINGLE, // m_NotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 4, // m_iColsPerPlayer @@ -409,7 +409,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay false, // m_bUsedForEdit "versus", // m_szName - { NOTES_TYPE_DANCE_SINGLE,NOTES_TYPE_DANCE_SINGLE }, // m_NotesTypes + NOTES_TYPE_DANCE_SINGLE, // m_NotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 4, // m_iColsPerPlayer @@ -436,7 +436,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay true, // m_bUsedForEdit "double", // m_szName - { NOTES_TYPE_DANCE_DOUBLE,NOTES_TYPE_DANCE_DOUBLE }, // m_NotesTypes + NOTES_TYPE_DANCE_DOUBLE, // m_NotesType StyleDef::ONE_PLAYER_TWO_CREDITS, // m_StyleType { 320, 320 }, // m_iCenterX 8, // m_iColsPerPlayer @@ -471,7 +471,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay false, // m_bUsedForEdit "couple", // m_szName - { NOTES_TYPE_DANCE_COUPLE, NOTES_TYPE_DANCE_COUPLE }, // m_NotesTypes + NOTES_TYPE_DANCE_COUPLE, // m_NotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 4, // m_iColsPerPlayer @@ -498,7 +498,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay true, // m_bUsedForEdit "solo", // m_szName - { NOTES_TYPE_DANCE_SOLO,NOTES_TYPE_DANCE_SOLO }, // m_NotesTypes + NOTES_TYPE_DANCE_SOLO, // m_NotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 320, 320 }, // m_iCenterX 6, // m_iColsPerPlayer @@ -528,8 +528,8 @@ StyleDef g_StyleDefs[NUM_STYLES] = GAME_DANCE, // m_Game false, // m_bUsedForGameplay true, // m_bUsedForEdit - "couple (edit)", // m_szName - { NOTES_TYPE_DANCE_COUPLE, NOTES_TYPE_DANCE_COUPLE }, // m_NotesTypes + "couple (edit)", // m_szName + NOTES_TYPE_DANCE_COUPLE, // m_NotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 8, // m_iColsPerPlayer @@ -592,7 +592,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay true, // m_bUsedForEdit "single", // m_szName - { NOTES_TYPE_PUMP_SINGLE,NOTES_TYPE_PUMP_SINGLE }, // m_NotesTypes + NOTES_TYPE_PUMP_SINGLE, // m_NotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -621,7 +621,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay false, // m_bUsedForEdit "versus", // m_szName - { NOTES_TYPE_PUMP_SINGLE,NOTES_TYPE_PUMP_SINGLE }, // m_NotesTypes + NOTES_TYPE_PUMP_SINGLE, // m_NotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -650,7 +650,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay true, // m_bUsedForEdit "double", // m_szName - { NOTES_TYPE_PUMP_DOUBLE,NOTES_TYPE_PUMP_DOUBLE }, // m_NotesTypes + NOTES_TYPE_PUMP_DOUBLE, // m_NotesType StyleDef::ONE_PLAYER_TWO_CREDITS, // m_StyleType { 320, 320 }, // m_iCenterX 10, // m_iColsPerPlayer @@ -689,7 +689,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay false, // m_bUsedForEdit "couple", // m_szName - { NOTES_TYPE_PUMP_COUPLE,NOTES_TYPE_PUMP_COUPLE}, // m_NotesTypes + NOTES_TYPE_PUMP_COUPLE, // m_NotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -718,7 +718,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = false, // m_bUsedForGameplay true, // m_bUsedForEdit "couple (edit)", // m_szName - { NOTES_TYPE_PUMP_COUPLE,NOTES_TYPE_PUMP_COUPLE}, // m_NotesTypes + NOTES_TYPE_PUMP_COUPLE, // m_NotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 10, // m_iColsPerPlayer @@ -752,7 +752,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay true, // m_bUsedForEdit "single", // m_szName - { NOTES_TYPE_EZ2_SINGLE,NOTES_TYPE_EZ2_SINGLE }, // m_NotesTypes + NOTES_TYPE_EZ2_SINGLE, // m_NotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -781,7 +781,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay true, // m_bUsedForEdit "real", // m_szName - { NOTES_TYPE_EZ2_REAL,NOTES_TYPE_EZ2_REAL }, // m_NotesTypes + NOTES_TYPE_EZ2_REAL, // m_NotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 160, 480 }, // m_iCenterX 7, // m_iColsPerPlayer @@ -814,7 +814,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay true, // m_bUsedForEdit "versus", // m_szName - { NOTES_TYPE_EZ2_SINGLE,NOTES_TYPE_EZ2_SINGLE }, // m_NotesTypes + NOTES_TYPE_EZ2_SINGLE, // m_NotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -843,7 +843,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay true, // m_bUsedForEdit "versusReal", // m_szName - { NOTES_TYPE_EZ2_REAL,NOTES_TYPE_EZ2_REAL }, // m_NotesTypes + NOTES_TYPE_EZ2_REAL, // m_NotesType StyleDef::TWO_PLAYERS_TWO_CREDITS, // m_StyleType { 160, 480 }, // m_iCenterX 7, // m_iColsPerPlayer @@ -876,7 +876,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay true, // m_bUsedForEdit "double", // m_szName - { NOTES_TYPE_EZ2_DOUBLE,NOTES_TYPE_EZ2_DOUBLE }, // m_NotesTypes + NOTES_TYPE_EZ2_DOUBLE, // m_NotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 320, 320 }, // m_iCenterX 10, // m_iColsPerPlayer @@ -915,7 +915,7 @@ StyleDef g_StyleDefs[NUM_STYLES] = true, // m_bUsedForGameplay true, // m_bUsedForEdit "single", // m_szName - { NOTES_TYPE_PARA,NOTES_TYPE_PARA}, // m_NotesTypes + NOTES_TYPE_PARA, // m_NotesType StyleDef::ONE_PLAYER_ONE_CREDIT, // m_StyleType { 320, 320 }, // m_iCenterX 5, // m_iColsPerPlayer @@ -1210,7 +1210,7 @@ void GameManager::GetNotesTypesForGame( Game game, CArray& continue; for( int pl = 0; !found && pl < NUM_PLAYERS; ++pl) { - if( g_StyleDefs[s].m_NotesTypes[pl] != nt ) + if( g_StyleDefs[s].m_NotesType != nt ) continue; found=true; diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 3c76d08770..17a0cdb252 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -348,7 +348,6 @@ MusicWheel::MusicWheel() GAMESTATE->m_PlayerOptions[p] = po; } } - /* XXX: Set up couples correctly */ GAMESTATE->m_SongOptions = so; } @@ -448,7 +447,7 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr } CArray arraySteps; - pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef(), 0, arraySteps ); + pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, arraySteps ); if( arraySteps.GetSize() > 0 ) arraySongs.Add( pSong ); @@ -611,7 +610,7 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr if( pSong == NULL ) continue; - bool bIsEasy = pSong->IsEasy( GAMESTATE->GetCurrentStyleDef()->m_NotesTypes[0] ); + bool bIsEasy = pSong->IsEasy( GAMESTATE->GetCurrentStyleDef()->m_NotesType ); WheelItemData& WID = arrayWheelItemDatas[i]; WID.m_IconType = bIsEasy ? MusicStatusDisplay::easy : MusicStatusDisplay::none; } diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index 59bdc5cc36..6e6d124d66 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -206,7 +206,8 @@ void NoteData::AddHoldNote( HoldNote add ) int i; // look for other hold notes that overlap and merge them - // XXX: this is done implicitly with 4s + // XXX: this is done implicitly with 4s, but 4s uses this function. + // Rework this later. for( i=0; iGetCurrentStyleDef()->m_NotesTypes[0] ) + switch( GAMESTATE->GetCurrentStyleDef()->m_NotesType ) { case NOTES_TYPE_DANCE_SINGLE: case NOTES_TYPE_DANCE_DOUBLE: diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 36e04ce446..6202ef4578 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -188,7 +188,7 @@ ScreenEdit::ScreenEdit() { m_pNotes = new Notes; m_pNotes->m_Difficulty = DIFFICULTY_MEDIUM; - m_pNotes->m_NotesType = GAMESTATE->GetCurrentStyleDef()->m_NotesTypes[0]; + m_pNotes->m_NotesType = GAMESTATE->GetCurrentStyleDef()->m_NotesType; m_pNotes->m_sDescription = "Untitled"; // In ScreenEditMenu, the screen preceding this one, diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index cb31a77fd7..bf77b7704f 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -726,7 +726,7 @@ void ScreenSelectMusic::AfterMusicChange() m_fPlaySampleCountdown = SAMPLE_MUSIC_DELAY; for( int pn = 0; pn < NUM_PLAYERS; ++pn) { - pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef(), pn, m_arrayNotes[pn] ); + pSong->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, m_arrayNotes[pn] ); SortNotesArrayByDifficulty( m_arrayNotes[pn] ); } diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 2082f4cd1b..75af35f033 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -574,12 +574,6 @@ void Song::TidyUpData() } } -/* Get Notes that match a given style and player. */ -void Song::GetNotesThatMatch( const StyleDef *s, int p, CArray& arrayAddTo ) const -{ - GetNotesThatMatch( s->m_NotesTypes[p], arrayAddTo ); -} - void Song::GetNotesThatMatch( NotesType nt, CArray& arrayAddTo ) const { for( int i=0; i& arrayAddTo ) /* Return whether the song is playable in the given style. */ 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])) - return false; - } + if(!SongHasNotesType(st->m_NotesType)) + return false; return true; } @@ -802,7 +792,7 @@ Grade Song::GetGradeForDifficulty( const StyleDef *st, int p, Difficulty dc ) co { // return max grade of notes in difficulty class CArray aNotes; - this->GetNotesThatMatch( st, p, aNotes ); + this->GetNotesThatMatch( st->m_NotesType, aNotes ); SortNotesArrayByDifficulty( aNotes ); Grade grade = GRADE_NO_DATA; @@ -869,8 +859,8 @@ int CompareSongPointersByDifficulty(const void *arg1, const void *arg2) CArray aNotes1; CArray aNotes2; - pSong1->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef(), PLAYER_1, aNotes1 ); - pSong2->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef(), PLAYER_1, aNotes2 ); + pSong1->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, aNotes1 ); + pSong2->GetNotesThatMatch( GAMESTATE->GetCurrentStyleDef()->m_NotesType, aNotes2 ); int iEasiestMeter1 = 1000; // infinity int iEasiestMeter2 = 1000; // infinity diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index a19df9c0dc..a62893e9cb 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -543,7 +543,7 @@ void SongManager::GetExtraStageInfo( bool bExtra2, CString sPreferredGroup, cons Song* pSong = apSongs[s]; CArray apNotes; - pSong->GetNotesThatMatch( sd, 0, apNotes ); + pSong->GetNotesThatMatch( sd->m_NotesType, apNotes ); for( int n=0; nm_apNotes[ rand()%pSong->m_apNotes.GetSize() ]; - if( pNotes->m_NotesType != GAMESTATE->GetCurrentStyleDef()->m_NotesTypes[0] ) + if( pNotes->m_NotesType != GAMESTATE->GetCurrentStyleDef()->m_NotesType ) continue; // found something we can use! diff --git a/stepmania/src/SongSelector.cpp b/stepmania/src/SongSelector.cpp index 30321bb88f..23165dbc80 100644 --- a/stepmania/src/SongSelector.cpp +++ b/stepmania/src/SongSelector.cpp @@ -265,7 +265,7 @@ void SongSelector::OnNotesTypeChange() m_textStyle.SetText( GAMEMAN->GetStyleDefForStyle(GetSelectedStyle())->m_szName ); m_pNotess.RemoveAll(); - GetSelectedSong()->GetNotesThatMatch( GAMEMAN->GetStyleDefForStyle(GetSelectedStyle()), 0, m_pNotess ); + GetSelectedSong()->GetNotesThatMatch( GAMEMAN->GetStyleDefForStyle(GetSelectedStyle())->m_NotesType, 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 f3db155b7d..42fae0da7c 100644 --- a/stepmania/src/StyleDef.cpp +++ b/stepmania/src/StyleDef.cpp @@ -81,9 +81,9 @@ PlayerNumber StyleDef::ControllerToPlayerNumber( GameController controller ) con } } -bool StyleDef::MatchesNotesType( NotesType type, int pn ) const +bool StyleDef::MatchesNotesType( NotesType type ) const { - if(type == m_NotesTypes[pn]) return true; + if(type == m_NotesType) return true; return false; } diff --git a/stepmania/src/StyleDef.h b/stepmania/src/StyleDef.h index 8b56ecb7a8..1dd31da235 100644 --- a/stepmania/src/StyleDef.h +++ b/stepmania/src/StyleDef.h @@ -40,11 +40,9 @@ public: /* The name of the style. (This is currently unused.) */ char m_szName[60]; - /* m_NotesTypes[] defines the notes format used for each player. For - * example, the "dance versus" reads the Notes with the tag "dance-single". - * For most modes, this will be the same for all styles; it's different - * for each player in couples. */ - NotesType m_NotesTypes[NUM_PLAYERS]; + /* Notes format used for each player. For example, "dance versus" reads + * the Notes with the tag "dance-single". */ + NotesType m_NotesType; enum StyleType { @@ -74,6 +72,6 @@ public: void GetTransformedNoteDataForStyle( PlayerNumber pn, NoteData* pOriginal, NoteData* pNoteDataOut ) const; - bool MatchesNotesType( NotesType type, int pn ) const; + bool MatchesNotesType( NotesType type ) const; }; diff --git a/stepmania/src/song.h b/stepmania/src/song.h index 79ae65e4ec..5891f2e4f1 100644 --- a/stepmania/src/song.h +++ b/stepmania/src/song.h @@ -186,7 +186,6 @@ public: bool SongCompleteForStyle( const StyleDef *st ) const; bool SongHasNotesType( NotesType nt ) const; bool SongHasNotesTypeAndDifficulty( NotesType nt, Difficulty dc ) const; - void GetNotesThatMatch( const StyleDef *s, int p, CArray& arrayAddTo ) const; void GetNotesThatMatch( NotesType nt, CArray& arrayAddTo ) const; int GetNumTimesPlayed() const; bool IsNew() const;