Rename overloaded methods of Song so that stack traces are more helpful.
This commit is contained in:
@@ -127,6 +127,8 @@ int Course::GetMeter( int Difficult ) const
|
|||||||
|
|
||||||
void Course::LoadFromCRSFile( CString sPath )
|
void Course::LoadFromCRSFile( CString sPath )
|
||||||
{
|
{
|
||||||
|
LOG->Trace( "Course::LoadFromCRSFile( '%s' )", sPath.c_str() );
|
||||||
|
|
||||||
m_sPath = sPath; // save path
|
m_sPath = sPath; // save path
|
||||||
|
|
||||||
MsdFile msd;
|
MsdFile msd;
|
||||||
@@ -464,8 +466,8 @@ static vector<Song*> GetFilteredBestSongs( StepsType nt )
|
|||||||
Song* pSong = vSongsByMostPlayed[j];
|
Song* pSong = vSongsByMostPlayed[j];
|
||||||
if( pSong->m_fMusicLengthSeconds > PREFSMAN->m_fLongVerSongSeconds ||
|
if( pSong->m_fMusicLengthSeconds > PREFSMAN->m_fLongVerSongSeconds ||
|
||||||
pSong->m_fMusicLengthSeconds > PREFSMAN->m_fMarathonVerSongSeconds ||
|
pSong->m_fMusicLengthSeconds > PREFSMAN->m_fMarathonVerSongSeconds ||
|
||||||
!pSong->GetNotes(nt, DIFFICULTY_MEDIUM, PREFSMAN->m_bAutogenMissingTypes) ||
|
!pSong->GetStepsByDifficulty(nt, DIFFICULTY_MEDIUM, PREFSMAN->m_bAutogenMissingTypes) ||
|
||||||
!pSong->GetNotes(nt, DIFFICULTY_HARD, PREFSMAN->m_bAutogenMissingTypes) )
|
!pSong->GetStepsByDifficulty(nt, DIFFICULTY_HARD, PREFSMAN->m_bAutogenMissingTypes) )
|
||||||
vSongsByMostPlayed.erase( vSongsByMostPlayed.begin()+j );
|
vSongsByMostPlayed.erase( vSongsByMostPlayed.begin()+j );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -516,9 +518,9 @@ void Course::GetCourseInfo( StepsType nt, vector<Course::Info> &ci, int Difficul
|
|||||||
if( pSong )
|
if( pSong )
|
||||||
{
|
{
|
||||||
if( e.difficulty == DIFFICULTY_INVALID )
|
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
|
else
|
||||||
pNotes = pSong->GetNotes( nt, e.difficulty, PREFSMAN->m_bAutogenMissingTypes );
|
pNotes = pSong->GetStepsByDifficulty( nt, e.difficulty, PREFSMAN->m_bAutogenMissingTypes );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Entry::random:
|
case Entry::random:
|
||||||
@@ -538,9 +540,9 @@ void Course::GetCourseInfo( StepsType nt, vector<Course::Info> &ci, int Difficul
|
|||||||
continue; /* wrong group */
|
continue; /* wrong group */
|
||||||
|
|
||||||
if( e.difficulty == DIFFICULTY_INVALID )
|
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
|
else
|
||||||
pNotes = pSong->GetNotes( nt, e.difficulty, PREFSMAN->m_bAutogenMissingTypes );
|
pNotes = pSong->GetStepsByDifficulty( nt, e.difficulty, PREFSMAN->m_bAutogenMissingTypes );
|
||||||
|
|
||||||
if( pNotes ) // found a match
|
if( pNotes ) // found a match
|
||||||
break; // stop searching
|
break; // stop searching
|
||||||
@@ -575,9 +577,9 @@ void Course::GetCourseInfo( StepsType nt, vector<Course::Info> &ci, int Difficul
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( e.difficulty == DIFFICULTY_INVALID )
|
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
|
else
|
||||||
pNotes = pSong->GetNotes( nt, e.difficulty, PREFSMAN->m_bAutogenMissingTypes );
|
pNotes = pSong->GetStepsByDifficulty( nt, e.difficulty, PREFSMAN->m_bAutogenMissingTypes );
|
||||||
|
|
||||||
if( pNotes == NULL )
|
if( pNotes == NULL )
|
||||||
pNotes = pSong->GetClosestNotes( nt, DIFFICULTY_MEDIUM );
|
pNotes = pSong->GetClosestNotes( nt, DIFFICULTY_MEDIUM );
|
||||||
@@ -600,7 +602,7 @@ void Course::GetCourseInfo( StepsType nt, vector<Course::Info> &ci, int Difficul
|
|||||||
if(dc < DIFFICULTY_CHALLENGE)
|
if(dc < DIFFICULTY_CHALLENGE)
|
||||||
{
|
{
|
||||||
dc = Difficulty(dc + 1);
|
dc = Difficulty(dc + 1);
|
||||||
Steps* pNewNotes = pSong->GetNotes( nt, dc, PREFSMAN->m_bAutogenMissingTypes );
|
Steps* pNewNotes = pSong->GetStepsByDifficulty( nt, dc, PREFSMAN->m_bAutogenMissingTypes );
|
||||||
if(pNewNotes)
|
if(pNewNotes)
|
||||||
pNotes = pNewNotes;
|
pNotes = pNewNotes;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -314,10 +314,10 @@ void EditMenu::OnRowValueChanged( Row row )
|
|||||||
|
|
||||||
Steps* EditMenu::GetSelectedNotes()
|
Steps* EditMenu::GetSelectedNotes()
|
||||||
{
|
{
|
||||||
return GetSelectedSong()->GetNotes(GetSelectedNotesType(),GetSelectedDifficulty(), false);
|
return GetSelectedSong()->GetStepsByDifficulty(GetSelectedNotesType(),GetSelectedDifficulty(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Steps* EditMenu::GetSelectedSourceNotes()
|
Steps* EditMenu::GetSelectedSourceNotes()
|
||||||
{
|
{
|
||||||
return GetSelectedSong()->GetNotes(GetSelectedSourceNotesType(),GetSelectedSourceDifficulty(), false);
|
return GetSelectedSong()->GetStepsByDifficulty(GetSelectedSourceNotesType(),GetSelectedSourceDifficulty(), false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ void GrooveGraph::SetFromSong( Song* pSong )
|
|||||||
{
|
{
|
||||||
for( int i=0; i<NUM_DIFFICULTIES; i++ )
|
for( int i=0; i<NUM_DIFFICULTIES; i++ )
|
||||||
{
|
{
|
||||||
Steps* pNotes = pSong->GetNotes( GAMESTATE->GetCurrentStyleDef()->m_StepsType, (Difficulty)i );
|
Steps* pNotes = pSong->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, (Difficulty)i );
|
||||||
const float* fRadarValues = pNotes ? pNotes->GetRadarValues() : NULL;
|
const float* fRadarValues = pNotes ? pNotes->GetRadarValues() : NULL;
|
||||||
for( int j=0; j<NUM_RADAR_CATEGORIES; j++ )
|
for( int j=0; j<NUM_RADAR_CATEGORIES; j++ )
|
||||||
fValues[j][i] = fRadarValues ? fRadarValues[j] : 0;
|
fValues[j][i] = fRadarValues ? fRadarValues[j] : 0;
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ void MusicWheel::GetSongList(vector<Song*> &arraySongs, SongSortOrder so, CStrin
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
vector<Steps*> arraySteps;
|
vector<Steps*> 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() )
|
if( !arraySteps.empty() )
|
||||||
arraySongs.push_back( pSong );
|
arraySongs.push_back( pSong );
|
||||||
@@ -1429,21 +1429,21 @@ CString MusicWheel::GetSectionNameFromSongAndSort( const Song* pSong, SongSortOr
|
|||||||
}
|
}
|
||||||
case SORT_EASY_METER:
|
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 )
|
if( pNotes )
|
||||||
return ssprintf("%02d", pNotes->GetMeter() );
|
return ssprintf("%02d", pNotes->GetMeter() );
|
||||||
return "N/A";
|
return "N/A";
|
||||||
}
|
}
|
||||||
case SORT_MEDIUM_METER:
|
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 )
|
if( pNotes )
|
||||||
return ssprintf("%02d", pNotes->GetMeter() );
|
return ssprintf("%02d", pNotes->GetMeter() );
|
||||||
return "N/A";
|
return "N/A";
|
||||||
}
|
}
|
||||||
case SORT_HARD_METER:
|
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 )
|
if( pNotes )
|
||||||
return ssprintf("%02d", pNotes->GetMeter() );
|
return ssprintf("%02d", pNotes->GetMeter() );
|
||||||
return "N/A";
|
return "N/A";
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ CString NoteSkinManager::GetMetric( PlayerNumber pn, CString sButtonName, CStrin
|
|||||||
if( data.metrics.GetValue( sButtonName, sValue, sReturn ) )
|
if( data.metrics.GetValue( sButtonName, sValue, sReturn ) )
|
||||||
return sReturn;
|
return sReturn;
|
||||||
if( !data.metrics.GetValue( "NoteDisplay", sValue, 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() );
|
sButtonName.c_str(), sValue.c_str(), sValue.c_str(), sNoteSkinName.c_str() );
|
||||||
return sReturn;
|
return sReturn;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -610,7 +610,7 @@ void ScreenEz2SelectMusic::MusicChanged()
|
|||||||
|
|
||||||
for( pn = 0; pn < NUM_PLAYERS; ++pn)
|
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] );
|
SortNotesArrayByDifficulty( m_arrayNotes[pn] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,11 +49,11 @@ bool ScreenJukebox::SetSong()
|
|||||||
Difficulty dc = GAMESTATE->m_PreferredDifficulty[PLAYER_1];
|
Difficulty dc = GAMESTATE->m_PreferredDifficulty[PLAYER_1];
|
||||||
Steps* pNotes = NULL;
|
Steps* pNotes = NULL;
|
||||||
if( dc != DIFFICULTY_INVALID )
|
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"
|
else // "all difficulties"
|
||||||
{
|
{
|
||||||
vector<Steps*> vNotes;
|
vector<Steps*> vNotes;
|
||||||
pSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
pSong->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
||||||
if( vNotes.size() > 0 )
|
if( vNotes.size() > 0 )
|
||||||
pNotes = vNotes[rand()%vNotes.size()];
|
pNotes = vNotes[rand()%vNotes.size()];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ void ScreenPlayerOptions::ImportOptions()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
vector<Steps*> vNotes;
|
vector<Steps*> vNotes;
|
||||||
GAMESTATE->m_pCurSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
GAMESTATE->m_pCurSong->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
||||||
SortNotesArrayByDifficulty( vNotes );
|
SortNotesArrayByDifficulty( vNotes );
|
||||||
for( unsigned i=0; i<vNotes.size(); i++ )
|
for( unsigned i=0; i<vNotes.size(); i++ )
|
||||||
{
|
{
|
||||||
@@ -230,7 +230,7 @@ void ScreenPlayerOptions::ImportOptions()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
vector<Steps*> vNotes;
|
vector<Steps*> vNotes;
|
||||||
GAMESTATE->m_pCurSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
GAMESTATE->m_pCurSong->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
||||||
SortNotesArrayByDifficulty( vNotes );
|
SortNotesArrayByDifficulty( vNotes );
|
||||||
for( unsigned i=0; i<vNotes.size(); i++ )
|
for( unsigned i=0; i<vNotes.size(); i++ )
|
||||||
{
|
{
|
||||||
@@ -353,7 +353,7 @@ void ScreenPlayerOptions::ExportOptions()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
vector<Steps*> vNotes;
|
vector<Steps*> vNotes;
|
||||||
GAMESTATE->m_pCurSong->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
GAMESTATE->m_pCurSong->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
||||||
SortNotesArrayByDifficulty( vNotes );
|
SortNotesArrayByDifficulty( vNotes );
|
||||||
GAMESTATE->m_pCurNotes[p] = vNotes[ m_iSelectedOption[p][PO_STEP] ];
|
GAMESTATE->m_pCurNotes[p] = vNotes[ m_iSelectedOption[p][PO_STEP] ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -975,7 +975,7 @@ void ScreenSelectMusic::AfterMusicChange()
|
|||||||
m_fSampleStartSeconds = pSong->m_fMusicSampleStartSeconds;
|
m_fSampleStartSeconds = pSong->m_fMusicSampleStartSeconds;
|
||||||
m_fSampleLengthSeconds = pSong->m_fMusicSampleLengthSeconds;
|
m_fSampleLengthSeconds = pSong->m_fMusicSampleLengthSeconds;
|
||||||
|
|
||||||
pSong->GetNotes( m_arrayNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
pSong->GetSteps( m_arrayNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
||||||
SortNotesArrayByDifficulty( m_arrayNotes );
|
SortNotesArrayByDifficulty( m_arrayNotes );
|
||||||
|
|
||||||
m_Banner.LoadFromSong( pSong );
|
m_Banner.LoadFromSong( pSong );
|
||||||
|
|||||||
+21
-21
@@ -830,7 +830,7 @@ void Song::ReCalculateRadarValuesAndLastBeat()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Song::GetNotes( vector<Steps*>& arrayAddTo, StepsType nt, Difficulty dc, int iMeterLow, int iMeterHigh, CString sDescription, bool bIncludeAutoGen ) const
|
void Song::GetSteps( vector<Steps*>& arrayAddTo, StepsType nt, Difficulty dc, int iMeterLow, int iMeterHigh, CString sDescription, bool bIncludeAutoGen ) const
|
||||||
{
|
{
|
||||||
for( unsigned i=0; i<m_apNotes.size(); i++ ) // for each of the Song's Steps
|
for( unsigned i=0; i<m_apNotes.size(); i++ ) // for each of the Song's Steps
|
||||||
{
|
{
|
||||||
@@ -849,30 +849,30 @@ void Song::GetNotes( vector<Steps*>& 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<Steps*> vNotes;
|
vector<Steps*> vNotes;
|
||||||
GetNotes( vNotes, nt, dc, -1, -1, "", bIncludeAutoGen );
|
GetSteps( vNotes, nt, dc, -1, -1, "", bIncludeAutoGen );
|
||||||
if( vNotes.size() == 0 )
|
if( vNotes.size() == 0 )
|
||||||
return NULL;
|
return NULL;
|
||||||
else
|
else
|
||||||
return vNotes[0];
|
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<Steps*> vNotes;
|
vector<Steps*> vNotes;
|
||||||
GetNotes( vNotes, nt, DIFFICULTY_INVALID, iMeterLow, iMeterHigh, "", bIncludeAutoGen );
|
GetSteps( vNotes, nt, DIFFICULTY_INVALID, iMeterLow, iMeterHigh, "", bIncludeAutoGen );
|
||||||
if( vNotes.size() == 0 )
|
if( vNotes.size() == 0 )
|
||||||
return NULL;
|
return NULL;
|
||||||
else
|
else
|
||||||
return vNotes[0];
|
return vNotes[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
Steps* Song::GetNotes( StepsType nt, CString sDescription, bool bIncludeAutoGen ) const
|
Steps* Song::GetStepsByDescription( StepsType nt, CString sDescription, bool bIncludeAutoGen ) const
|
||||||
{
|
{
|
||||||
vector<Steps*> vNotes;
|
vector<Steps*> vNotes;
|
||||||
GetNotes( vNotes, nt, DIFFICULTY_INVALID, -1, -1, sDescription, bIncludeAutoGen );
|
GetSteps( vNotes, nt, DIFFICULTY_INVALID, -1, -1, sDescription, bIncludeAutoGen );
|
||||||
if( vNotes.size() == 0 )
|
if( vNotes.size() == 0 )
|
||||||
return NULL;
|
return NULL;
|
||||||
else
|
else
|
||||||
@@ -884,27 +884,27 @@ Steps* Song::GetClosestNotes( StepsType nt, Difficulty dc, bool bIncludeAutoGen
|
|||||||
{
|
{
|
||||||
Difficulty newDC = dc;
|
Difficulty newDC = dc;
|
||||||
Steps* pNotes;
|
Steps* pNotes;
|
||||||
pNotes = GetNotes( nt, newDC, bIncludeAutoGen );
|
pNotes = GetStepsByDifficulty( nt, newDC, bIncludeAutoGen );
|
||||||
if( pNotes )
|
if( pNotes )
|
||||||
return pNotes;
|
return pNotes;
|
||||||
newDC = (Difficulty)(dc-1);
|
newDC = (Difficulty)(dc-1);
|
||||||
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
|
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
|
||||||
pNotes = GetNotes( nt, newDC, bIncludeAutoGen );
|
pNotes = GetStepsByDifficulty( nt, newDC, bIncludeAutoGen );
|
||||||
if( pNotes )
|
if( pNotes )
|
||||||
return pNotes;
|
return pNotes;
|
||||||
newDC = (Difficulty)(dc+1);
|
newDC = (Difficulty)(dc+1);
|
||||||
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
|
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
|
||||||
pNotes = GetNotes( nt, newDC, bIncludeAutoGen );
|
pNotes = GetStepsByDifficulty( nt, newDC, bIncludeAutoGen );
|
||||||
if( pNotes )
|
if( pNotes )
|
||||||
return pNotes;
|
return pNotes;
|
||||||
newDC = (Difficulty)(dc-2);
|
newDC = (Difficulty)(dc-2);
|
||||||
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
|
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
|
||||||
pNotes = GetNotes( nt, newDC, bIncludeAutoGen );
|
pNotes = GetStepsByDifficulty( nt, newDC, bIncludeAutoGen );
|
||||||
if( pNotes )
|
if( pNotes )
|
||||||
return pNotes;
|
return pNotes;
|
||||||
newDC = (Difficulty)(dc+2);
|
newDC = (Difficulty)(dc+2);
|
||||||
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
|
CLAMP( (int&)newDC, 0, NUM_DIFFICULTIES-1 );
|
||||||
pNotes = GetNotes( nt, newDC, bIncludeAutoGen );
|
pNotes = GetStepsByDifficulty( nt, newDC, bIncludeAutoGen );
|
||||||
return pNotes;
|
return pNotes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1017,7 +1017,7 @@ void Song::AddAutoGenNotes()
|
|||||||
for( StepsType nt=(StepsType)0; nt<NUM_STEPS_TYPES; nt=(StepsType)(nt+1) )
|
for( StepsType nt=(StepsType)0; nt<NUM_STEPS_TYPES; nt=(StepsType)(nt+1) )
|
||||||
{
|
{
|
||||||
vector<Steps*> apNotes;
|
vector<Steps*> apNotes;
|
||||||
this->GetNotes( apNotes, nt );
|
this->GetSteps( apNotes, nt );
|
||||||
|
|
||||||
if(apNotes.empty() || apNotes[0]->IsAutogen())
|
if(apNotes.empty() || apNotes[0]->IsAutogen())
|
||||||
continue; /* can't autogen from other autogen */
|
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
|
// return max grade of notes in difficulty class
|
||||||
vector<Steps*> aNotes;
|
vector<Steps*> aNotes;
|
||||||
this->GetNotes( aNotes, st->m_StepsType );
|
this->GetSteps( aNotes, st->m_StepsType );
|
||||||
SortNotesArrayByDifficulty( aNotes );
|
SortNotesArrayByDifficulty( aNotes );
|
||||||
|
|
||||||
Grade grade = GRADE_NO_DATA;
|
Grade grade = GRADE_NO_DATA;
|
||||||
@@ -1091,9 +1091,9 @@ bool Song::IsNew() const
|
|||||||
|
|
||||||
bool Song::IsEasy( StepsType nt ) const
|
bool Song::IsEasy( StepsType nt ) const
|
||||||
{
|
{
|
||||||
Steps* pBeginnerNotes = GetNotes( nt, DIFFICULTY_BEGINNER );
|
Steps* pBeginnerNotes = GetStepsByDifficulty( nt, DIFFICULTY_BEGINNER );
|
||||||
Steps* pEasyNotes = GetNotes( nt, DIFFICULTY_EASY );
|
Steps* pEasyNotes = GetStepsByDifficulty( nt, DIFFICULTY_EASY );
|
||||||
Steps* pHardNotes = GetNotes( nt, DIFFICULTY_HARD );
|
Steps* pHardNotes = GetStepsByDifficulty( nt, DIFFICULTY_HARD );
|
||||||
|
|
||||||
// HACK: Looks bizarre to see the easy mark by Legend of MAX.
|
// HACK: Looks bizarre to see the easy mark by Legend of MAX.
|
||||||
if( pHardNotes && pHardNotes->GetMeter() > 9 )
|
if( pHardNotes && pHardNotes->GetMeter() > 9 )
|
||||||
@@ -1183,7 +1183,7 @@ void SortSongPointerArrayByTitle( vector<Song*> &arraySongPointers )
|
|||||||
static int GetSongSortDifficulty(const Song *pSong)
|
static int GetSongSortDifficulty(const Song *pSong)
|
||||||
{
|
{
|
||||||
vector<Steps*> aNotes;
|
vector<Steps*> aNotes;
|
||||||
pSong->GetNotes( aNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
pSong->GetSteps( aNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
||||||
|
|
||||||
// sort by anything but beginner
|
// sort by anything but beginner
|
||||||
/* This makes the sort a little odd; songs can end up in unintuitive places because,
|
/* 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) { }
|
CompareSongByMeter(Difficulty d): dc(d) { }
|
||||||
bool operator() (const Song* pSong1, const Song* pSong2)
|
bool operator() (const Song* pSong1, const Song* pSong2)
|
||||||
{
|
{
|
||||||
Steps* pNotes1 = pSong1->GetNotes( GAMESTATE->GetCurrentStyleDef()->m_StepsType, dc );
|
Steps* pNotes1 = pSong1->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, dc );
|
||||||
Steps* pNotes2 = pSong2->GetNotes( GAMESTATE->GetCurrentStyleDef()->m_StepsType, dc );
|
Steps* pNotes2 = pSong2->GetStepsByDifficulty( GAMESTATE->GetCurrentStyleDef()->m_StepsType, dc );
|
||||||
|
|
||||||
const int iMeter1 = pNotes1 ? pNotes1->GetMeter() : 0;
|
const int iMeter1 = pNotes1 ? pNotes1->GetMeter() : 0;
|
||||||
const int iMeter2 = pNotes2 ? pNotes2->GetMeter() : 0;
|
const int iMeter2 = pNotes2 ? pNotes2->GetMeter() : 0;
|
||||||
@@ -1579,7 +1579,7 @@ int Song::GetNumNotesWithGrade( Grade g ) const
|
|||||||
{
|
{
|
||||||
int iCount = 0;
|
int iCount = 0;
|
||||||
vector<Steps*> vNotes;
|
vector<Steps*> vNotes;
|
||||||
this->GetNotes( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
this->GetSteps( vNotes, GAMESTATE->GetCurrentStyleDef()->m_StepsType );
|
||||||
for( unsigned j=0; j<vNotes.size(); j++ )
|
for( unsigned j=0; j<vNotes.size(); j++ )
|
||||||
if( vNotes[j]->m_MemCardScores[MEMORY_CARD_MACHINE].grade == g )
|
if( vNotes[j]->m_MemCardScores[MEMORY_CARD_MACHINE].grade == g )
|
||||||
iCount++;
|
iCount++;
|
||||||
|
|||||||
@@ -305,9 +305,9 @@ void SongManager::ReadNoteScoresFromFile( CString fn, int c )
|
|||||||
if( pSong )
|
if( pSong )
|
||||||
{
|
{
|
||||||
if( dc==DIFFICULTY_INVALID )
|
if( dc==DIFFICULTY_INVALID )
|
||||||
pNotes = pSong->GetNotes( nt, sDescription );
|
pNotes = pSong->GetStepsByDescription( nt, sDescription );
|
||||||
else
|
else
|
||||||
pNotes = pSong->GetNotes( nt, dc );
|
pNotes = pSong->GetStepsByDifficulty( nt, dc );
|
||||||
}
|
}
|
||||||
|
|
||||||
getline(f, line);
|
getline(f, line);
|
||||||
@@ -985,7 +985,7 @@ void SongManager::GetExtraStageInfo( bool bExtra2, const StyleDef *sd,
|
|||||||
Song* pSong = apSongs[s];
|
Song* pSong = apSongs[s];
|
||||||
|
|
||||||
vector<Steps*> apNotes;
|
vector<Steps*> apNotes;
|
||||||
pSong->GetNotes( apNotes, sd->m_StepsType );
|
pSong->GetSteps( apNotes, sd->m_StepsType );
|
||||||
for( unsigned n=0; n<apNotes.size(); n++ ) // foreach Steps
|
for( unsigned n=0; n<apNotes.size(); n++ ) // foreach Steps
|
||||||
{
|
{
|
||||||
Steps* pNotes = apNotes[n];
|
Steps* pNotes = apNotes[n];
|
||||||
|
|||||||
@@ -243,10 +243,10 @@ public:
|
|||||||
bool SongCompleteForStyle( const StyleDef *st ) const;
|
bool SongCompleteForStyle( const StyleDef *st ) const;
|
||||||
bool SongHasNotesType( StepsType nt ) const;
|
bool SongHasNotesType( StepsType nt ) const;
|
||||||
bool SongHasNotesTypeAndDifficulty( StepsType nt, Difficulty dc ) const;
|
bool SongHasNotesTypeAndDifficulty( StepsType nt, Difficulty dc ) const;
|
||||||
void GetNotes( vector<Steps*>& arrayAddTo, StepsType nt, Difficulty dc = DIFFICULTY_INVALID, int iMeterLow = -1, int iMeterHigh = -1, CString sDescription = "", bool bIncludeAutoGen = true ) const;
|
void GetSteps( vector<Steps*>& 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* GetStepsByDifficulty( StepsType nt, Difficulty dc, bool bIncludeAutoGen = true ) const;
|
||||||
Steps* GetNotes( StepsType nt, int iMeterLow, int iMeterHigh, bool bIncludeAutoGen = true ) const;
|
Steps* GetStepsByMeter( StepsType nt, int iMeterLow, int iMeterHigh, bool bIncludeAutoGen = true ) const;
|
||||||
Steps* GetNotes( StepsType nt, CString sDescription, bool bIncludeAutoGen = true ) const;
|
Steps* GetStepsByDescription( StepsType nt, CString sDescription, bool bIncludeAutoGen = true ) const;
|
||||||
Steps* GetClosestNotes( StepsType nt, Difficulty dc, bool bIncludeAutoGen = true ) const;
|
Steps* GetClosestNotes( StepsType nt, Difficulty dc, bool bIncludeAutoGen = true ) const;
|
||||||
void GetEdits( vector<Steps*>& arrayAddTo, StepsType nt, bool bIncludeAutoGen = true ) const;
|
void GetEdits( vector<Steps*>& arrayAddTo, StepsType nt, bool bIncludeAutoGen = true ) const;
|
||||||
int GetNumTimesPlayed() const;
|
int GetNumTimesPlayed() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user