diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index b91189ebbb..866815dc3f 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -127,6 +127,8 @@ int Course::GetMeter( int Difficult ) const void Course::LoadFromCRSFile( CString sPath ) { + LOG->Trace( "Course::LoadFromCRSFile( '%s' )", sPath.c_str() ); + m_sPath = sPath; // save path MsdFile msd; @@ -464,8 +466,8 @@ static vector GetFilteredBestSongs( StepsType nt ) Song* pSong = vSongsByMostPlayed[j]; if( pSong->m_fMusicLengthSeconds > PREFSMAN->m_fLongVerSongSeconds || pSong->m_fMusicLengthSeconds > PREFSMAN->m_fMarathonVerSongSeconds || - !pSong->GetNotes(nt, DIFFICULTY_MEDIUM, PREFSMAN->m_bAutogenMissingTypes) || - !pSong->GetNotes(nt, DIFFICULTY_HARD, PREFSMAN->m_bAutogenMissingTypes) ) + !pSong->GetStepsByDifficulty(nt, DIFFICULTY_MEDIUM, PREFSMAN->m_bAutogenMissingTypes) || + !pSong->GetStepsByDifficulty(nt, DIFFICULTY_HARD, PREFSMAN->m_bAutogenMissingTypes) ) vSongsByMostPlayed.erase( vSongsByMostPlayed.begin()+j ); } @@ -516,9 +518,9 @@ void Course::GetCourseInfo( StepsType nt, vector &ci, int Difficul if( pSong ) { if( e.difficulty == DIFFICULTY_INVALID ) - pNotes = pSong->GetNotes( nt, low_meter, high_meter, PREFSMAN->m_bAutogenMissingTypes ); + pNotes = pSong->GetStepsByMeter( nt, low_meter, high_meter, PREFSMAN->m_bAutogenMissingTypes ); else - pNotes = pSong->GetNotes( nt, e.difficulty, PREFSMAN->m_bAutogenMissingTypes ); + pNotes = pSong->GetStepsByDifficulty( nt, e.difficulty, PREFSMAN->m_bAutogenMissingTypes ); } break; case Entry::random: @@ -538,9 +540,9 @@ void Course::GetCourseInfo( StepsType nt, vector &ci, int Difficul continue; /* wrong group */ if( e.difficulty == DIFFICULTY_INVALID ) - pNotes = pSong->GetNotes( nt, low_meter, high_meter, PREFSMAN->m_bAutogenMissingTypes ); + pNotes = pSong->GetStepsByMeter( nt, low_meter, high_meter, PREFSMAN->m_bAutogenMissingTypes ); else - pNotes = pSong->GetNotes( nt, e.difficulty, PREFSMAN->m_bAutogenMissingTypes ); + pNotes = pSong->GetStepsByDifficulty( nt, e.difficulty, PREFSMAN->m_bAutogenMissingTypes ); if( pNotes ) // found a match break; // stop searching @@ -575,9 +577,9 @@ void Course::GetCourseInfo( StepsType nt, vector &ci, int Difficul } if( e.difficulty == DIFFICULTY_INVALID ) - pNotes = pSong->GetNotes( nt, low_meter, high_meter, PREFSMAN->m_bAutogenMissingTypes ); + pNotes = pSong->GetStepsByMeter( nt, low_meter, high_meter, PREFSMAN->m_bAutogenMissingTypes ); else - pNotes = pSong->GetNotes( nt, e.difficulty, PREFSMAN->m_bAutogenMissingTypes ); + pNotes = pSong->GetStepsByDifficulty( nt, e.difficulty, PREFSMAN->m_bAutogenMissingTypes ); if( pNotes == NULL ) pNotes = pSong->GetClosestNotes( nt, DIFFICULTY_MEDIUM ); @@ -600,7 +602,7 @@ void Course::GetCourseInfo( StepsType nt, vector &ci, int Difficul if(dc < DIFFICULTY_CHALLENGE) { dc = Difficulty(dc + 1); - Steps* pNewNotes = pSong->GetNotes( nt, dc, PREFSMAN->m_bAutogenMissingTypes ); + Steps* pNewNotes = pSong->GetStepsByDifficulty( nt, dc, PREFSMAN->m_bAutogenMissingTypes ); if(pNewNotes) pNotes = pNewNotes; } diff --git a/stepmania/src/EditMenu.cpp b/stepmania/src/EditMenu.cpp index a39b8fc53d..74418c3860 100644 --- a/stepmania/src/EditMenu.cpp +++ b/stepmania/src/EditMenu.cpp @@ -314,10 +314,10 @@ void EditMenu::OnRowValueChanged( Row row ) Steps* EditMenu::GetSelectedNotes() { - return GetSelectedSong()->GetNotes(GetSelectedNotesType(),GetSelectedDifficulty(), false); + return GetSelectedSong()->GetStepsByDifficulty(GetSelectedNotesType(),GetSelectedDifficulty(), false); } Steps* EditMenu::GetSelectedSourceNotes() { - return GetSelectedSong()->GetNotes(GetSelectedSourceNotesType(),GetSelectedSourceDifficulty(), false); + return GetSelectedSong()->GetStepsByDifficulty(GetSelectedSourceNotesType(),GetSelectedSourceDifficulty(), false); } diff --git a/stepmania/src/GrooveGraph.cpp b/stepmania/src/GrooveGraph.cpp index 361afa5ca6..918cc01772 100644 --- a/stepmania/src/GrooveGraph.cpp +++ b/stepmania/src/GrooveGraph.cpp @@ -65,7 +65,7 @@ void GrooveGraph::SetFromSong( Song* pSong ) { for( int i=0; iGetNotes( GAMESTATE->GetCurrentStyleDef()->m_StepsType, (Difficulty)i ); + Steps* pNotes = pSong->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, (Difficulty)i ); const float* fRadarValues = pNotes ? pNotes->GetRadarValues() : NULL; for( int j=0; j &arraySongs, SongSortOrder so, CStrin continue; vector arraySteps; - pSong->GetNotes( arraySteps, GAMESTATE->GetCurrentStyleDef()->m_StepsType, DIFFICULTY_INVALID, -1, -1, "", PREFSMAN->m_bAutogenMissingTypes ); + pSong->GetSteps( arraySteps, GAMESTATE->GetCurrentStyleDef()->m_StepsType, DIFFICULTY_INVALID, -1, -1, "", PREFSMAN->m_bAutogenMissingTypes ); if( !arraySteps.empty() ) arraySongs.push_back( pSong ); @@ -1429,21 +1429,21 @@ CString MusicWheel::GetSectionNameFromSongAndSort( const Song* pSong, SongSortOr } case SORT_EASY_METER: { - Steps* pNotes = pSong->GetNotes(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_EASY); + Steps* pNotes = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_EASY); if( pNotes ) return ssprintf("%02d", pNotes->GetMeter() ); return "N/A"; } case SORT_MEDIUM_METER: { - Steps* pNotes = pSong->GetNotes(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_MEDIUM); + Steps* pNotes = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_MEDIUM); if( pNotes ) return ssprintf("%02d", pNotes->GetMeter() ); return "N/A"; } case SORT_HARD_METER: { - Steps* pNotes = pSong->GetNotes(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_HARD); + Steps* pNotes = pSong->GetStepsByDifficulty(GAMESTATE->GetCurrentStyleDef()->m_StepsType,DIFFICULTY_HARD); if( pNotes ) return ssprintf("%02d", pNotes->GetMeter() ); return "N/A"; diff --git a/stepmania/src/NoteSkinManager.cpp b/stepmania/src/NoteSkinManager.cpp index 4c15c596e9..2836c90ae9 100644 --- a/stepmania/src/NoteSkinManager.cpp +++ b/stepmania/src/NoteSkinManager.cpp @@ -125,7 +125,7 @@ CString NoteSkinManager::GetMetric( PlayerNumber pn, CString sButtonName, CStrin if( data.metrics.GetValue( sButtonName, sValue, sReturn ) ) return sReturn; if( !data.metrics.GetValue( "NoteDisplay", sValue, sReturn ) ) - RageException::Throw( "Could not read metric '%s - %s' or 'NoteDisplay - %s' in '%s'", + RageException::Throw( "Could not read metric '[%s] %s' or '[NoteDisplay] %s' in '%s'", sButtonName.c_str(), sValue.c_str(), sValue.c_str(), sNoteSkinName.c_str() ); return sReturn; } diff --git a/stepmania/src/ScreenEz2SelectMusic.cpp b/stepmania/src/ScreenEz2SelectMusic.cpp index 79a942ed13..bf46cb6ab4 100644 --- a/stepmania/src/ScreenEz2SelectMusic.cpp +++ b/stepmania/src/ScreenEz2SelectMusic.cpp @@ -610,7 +610,7 @@ void ScreenEz2SelectMusic::MusicChanged() for( pn = 0; pn < NUM_PLAYERS; ++pn) { - pSong->GetNotes( m_arrayNotes[pn], GAMESTATE->GetCurrentStyleDef()->m_StepsType ); + pSong->GetSteps( m_arrayNotes[pn], GAMESTATE->GetCurrentStyleDef()->m_StepsType ); SortNotesArrayByDifficulty( m_arrayNotes[pn] ); } diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index 84217f7a7f..17c91f3657 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -49,11 +49,11 @@ bool ScreenJukebox::SetSong() Difficulty dc = GAMESTATE->m_PreferredDifficulty[PLAYER_1]; Steps* pNotes = NULL; if( dc != DIFFICULTY_INVALID ) - pNotes = pSong->GetNotes( GAMESTATE->GetCurrentStyleDef()->m_StepsType, GAMESTATE->m_PreferredDifficulty[PLAYER_1] ); + pNotes = pSong->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, GAMESTATE->m_PreferredDifficulty[PLAYER_1] ); else // "all difficulties" { vector vNotes; - pSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); + pSong->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); if( vNotes.size() > 0 ) pNotes = vNotes[rand()%vNotes.size()]; } diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index cc78ef2f0a..cde224c4fe 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -115,7 +115,7 @@ void ScreenPlayerOptions::ImportOptions() else { vector vNotes; - GAMESTATE->m_pCurSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); + GAMESTATE->m_pCurSong->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); SortNotesArrayByDifficulty( vNotes ); for( unsigned i=0; i vNotes; - GAMESTATE->m_pCurSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); + GAMESTATE->m_pCurSong->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); SortNotesArrayByDifficulty( vNotes ); for( unsigned i=0; i vNotes; - GAMESTATE->m_pCurSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); + GAMESTATE->m_pCurSong->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); SortNotesArrayByDifficulty( vNotes ); GAMESTATE->m_pCurNotes[p] = vNotes[ m_iSelectedOption[p][PO_STEP] ]; } diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 2146f9d809..bfefc0fa01 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -975,7 +975,7 @@ void ScreenSelectMusic::AfterMusicChange() m_fSampleStartSeconds = pSong->m_fMusicSampleStartSeconds; m_fSampleLengthSeconds = pSong->m_fMusicSampleLengthSeconds; - pSong->GetNotes( m_arrayNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); + pSong->GetSteps( m_arrayNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); SortNotesArrayByDifficulty( m_arrayNotes ); m_Banner.LoadFromSong( pSong ); diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index a2595b0c95..26d196cd59 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -830,7 +830,7 @@ void Song::ReCalculateRadarValuesAndLastBeat() } } -void Song::GetNotes( vector& arrayAddTo, StepsType nt, Difficulty dc, int iMeterLow, int iMeterHigh, CString sDescription, bool bIncludeAutoGen ) const +void Song::GetSteps( vector& arrayAddTo, StepsType nt, Difficulty dc, int iMeterLow, int iMeterHigh, CString sDescription, bool bIncludeAutoGen ) const { for( unsigned i=0; i& arrayAddTo, StepsType nt, Difficulty dc, in } } -Steps* Song::GetNotes( StepsType nt, Difficulty dc, bool bIncludeAutoGen ) const +Steps* Song::GetStepsByDifficulty( StepsType nt, Difficulty dc, bool bIncludeAutoGen ) const { vector vNotes; - GetNotes( vNotes, nt, dc, -1, -1, "", bIncludeAutoGen ); + GetSteps( vNotes, nt, dc, -1, -1, "", bIncludeAutoGen ); if( vNotes.size() == 0 ) return NULL; else return vNotes[0]; } -Steps* Song::GetNotes( StepsType nt, int iMeterLow, int iMeterHigh, bool bIncludeAutoGen ) const +Steps* Song::GetStepsByMeter( StepsType nt, int iMeterLow, int iMeterHigh, bool bIncludeAutoGen ) const { vector vNotes; - GetNotes( vNotes, nt, DIFFICULTY_INVALID, iMeterLow, iMeterHigh, "", bIncludeAutoGen ); + GetSteps( vNotes, nt, DIFFICULTY_INVALID, iMeterLow, iMeterHigh, "", bIncludeAutoGen ); if( vNotes.size() == 0 ) return NULL; else return vNotes[0]; } -Steps* Song::GetNotes( StepsType nt, CString sDescription, bool bIncludeAutoGen ) const +Steps* Song::GetStepsByDescription( StepsType nt, CString sDescription, bool bIncludeAutoGen ) const { vector vNotes; - GetNotes( vNotes, nt, DIFFICULTY_INVALID, -1, -1, sDescription, bIncludeAutoGen ); + GetSteps( vNotes, nt, DIFFICULTY_INVALID, -1, -1, sDescription, bIncludeAutoGen ); if( vNotes.size() == 0 ) return NULL; else @@ -884,27 +884,27 @@ Steps* Song::GetClosestNotes( StepsType nt, Difficulty dc, bool bIncludeAutoGen { Difficulty newDC = dc; Steps* pNotes; - pNotes = GetNotes( nt, newDC, bIncludeAutoGen ); + pNotes = GetStepsByDifficulty( nt, newDC, bIncludeAutoGen ); if( pNotes ) return pNotes; newDC = (Difficulty)(dc-1); CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 ); - pNotes = GetNotes( nt, newDC, bIncludeAutoGen ); + pNotes = GetStepsByDifficulty( nt, newDC, bIncludeAutoGen ); if( pNotes ) return pNotes; newDC = (Difficulty)(dc+1); CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 ); - pNotes = GetNotes( nt, newDC, bIncludeAutoGen ); + pNotes = GetStepsByDifficulty( nt, newDC, bIncludeAutoGen ); if( pNotes ) return pNotes; newDC = (Difficulty)(dc-2); CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 ); - pNotes = GetNotes( nt, newDC, bIncludeAutoGen ); + pNotes = GetStepsByDifficulty( nt, newDC, bIncludeAutoGen ); if( pNotes ) return pNotes; newDC = (Difficulty)(dc+2); CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 ); - pNotes = GetNotes( nt, newDC, bIncludeAutoGen ); + pNotes = GetStepsByDifficulty( nt, newDC, bIncludeAutoGen ); return pNotes; } @@ -1017,7 +1017,7 @@ void Song::AddAutoGenNotes() for( StepsType nt=(StepsType)0; nt apNotes; - this->GetNotes( apNotes, nt ); + this->GetSteps( apNotes, nt ); if(apNotes.empty() || apNotes[0]->IsAutogen()) continue; /* can't autogen from other autogen */ @@ -1069,7 +1069,7 @@ Grade Song::GetGradeForDifficulty( const StyleDef *st, PlayerNumber pn, Difficul { // return max grade of notes in difficulty class vector aNotes; - this->GetNotes( aNotes, st->m_StepsType ); + this->GetSteps( aNotes, st->m_StepsType ); SortNotesArrayByDifficulty( aNotes ); Grade grade = GRADE_NO_DATA; @@ -1091,9 +1091,9 @@ bool Song::IsNew() const bool Song::IsEasy( StepsType nt ) const { - Steps* pBeginnerNotes = GetNotes( nt, DIFFICULTY_BEGINNER ); - Steps* pEasyNotes = GetNotes( nt, DIFFICULTY_EASY ); - Steps* pHardNotes = GetNotes( nt, DIFFICULTY_HARD ); + Steps* pBeginnerNotes = GetStepsByDifficulty( nt, DIFFICULTY_BEGINNER ); + Steps* pEasyNotes = GetStepsByDifficulty( nt, DIFFICULTY_EASY ); + Steps* pHardNotes = GetStepsByDifficulty( nt, DIFFICULTY_HARD ); // HACK: Looks bizarre to see the easy mark by Legend of MAX. if( pHardNotes && pHardNotes->GetMeter() > 9 ) @@ -1183,7 +1183,7 @@ void SortSongPointerArrayByTitle( vector &arraySongPointers ) static int GetSongSortDifficulty(const Song *pSong) { vector aNotes; - pSong->GetNotes( aNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); + pSong->GetSteps( aNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); // sort by anything but beginner /* This makes the sort a little odd; songs can end up in unintuitive places because, @@ -1391,8 +1391,8 @@ struct CompareSongByMeter CompareSongByMeter(Difficulty d): dc(d) { } bool operator() (const Song* pSong1, const Song* pSong2) { - Steps* pNotes1 = pSong1->GetNotes( GAMESTATE->GetCurrentStyleDef()->m_StepsType, dc ); - Steps* pNotes2 = pSong2->GetNotes( GAMESTATE->GetCurrentStyleDef()->m_StepsType, dc ); + Steps* pNotes1 = pSong1->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, dc ); + Steps* pNotes2 = pSong2->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, dc ); const int iMeter1 = pNotes1 ? pNotes1->GetMeter() : 0; const int iMeter2 = pNotes2 ? pNotes2->GetMeter() : 0; @@ -1579,7 +1579,7 @@ int Song::GetNumNotesWithGrade( Grade g ) const { int iCount = 0; vector vNotes; - this->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); + this->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType ); for( unsigned j=0; jm_MemCardScores[MEMORY_CARD_MACHINE].grade == g ) iCount++; diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 4e6cfdf951..439039950e 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -305,9 +305,9 @@ void SongManager::ReadNoteScoresFromFile( CString fn, int c ) if( pSong ) { if( dc==DIFFICULTY_INVALID ) - pNotes = pSong->GetNotes( nt, sDescription ); + pNotes = pSong->GetStepsByDescription( nt, sDescription ); else - pNotes = pSong->GetNotes( nt, dc ); + pNotes = pSong->GetStepsByDifficulty( nt, dc ); } getline(f, line); @@ -985,7 +985,7 @@ void SongManager::GetExtraStageInfo( bool bExtra2, const StyleDef *sd, Song* pSong = apSongs[s]; vector apNotes; - pSong->GetNotes( apNotes, sd->m_StepsType ); + pSong->GetSteps( apNotes, sd->m_StepsType ); for( unsigned n=0; n& arrayAddTo, StepsType nt, Difficulty dc = DIFFICULTY_INVALID, int iMeterLow = -1, int iMeterHigh = -1, CString sDescription = "", bool bIncludeAutoGen = true ) const; - Steps* GetNotes( StepsType nt, Difficulty dc, bool bIncludeAutoGen = true ) const; - Steps* GetNotes( StepsType nt, int iMeterLow, int iMeterHigh, bool bIncludeAutoGen = true ) const; - Steps* GetNotes( StepsType nt, CString sDescription, bool bIncludeAutoGen = true ) const; + void GetSteps( vector& arrayAddTo, StepsType nt, Difficulty dc = DIFFICULTY_INVALID, int iMeterLow = -1, int iMeterHigh = -1, CString sDescription = "", bool bIncludeAutoGen = true ) const; + Steps* GetStepsByDifficulty( StepsType nt, Difficulty dc, bool bIncludeAutoGen = true ) const; + Steps* GetStepsByMeter( StepsType nt, int iMeterLow, int iMeterHigh, bool bIncludeAutoGen = true ) const; + Steps* GetStepsByDescription( StepsType nt, CString sDescription, bool bIncludeAutoGen = true ) const; Steps* GetClosestNotes( StepsType nt, Difficulty dc, bool bIncludeAutoGen = true ) const; void GetEdits( vector& arrayAddTo, StepsType nt, bool bIncludeAutoGen = true ) const; int GetNumTimesPlayed() const;