review uses of GetTrail
This commit is contained in:
@@ -203,7 +203,8 @@ void BPMDisplay::SetBPM( const Course* pCourse )
|
||||
{
|
||||
ASSERT( pCourse );
|
||||
|
||||
Trail *pTrail = pCourse->GetTrail( GAMESTATE->GetCurrentStyleDef()->m_StepsType, COURSE_DIFFICULTY_REGULAR );
|
||||
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
|
||||
Trail *pTrail = pCourse->GetTrail( st, COURSE_DIFFICULTY_REGULAR );
|
||||
|
||||
ASSERT( pTrail->m_vEntries.size() );
|
||||
|
||||
|
||||
@@ -151,17 +151,6 @@ void PaneDisplay::SetContent( PaneContents c )
|
||||
if( (g_Contents[c].req&NEED_PROFILE) && !PROFILEMAN->IsUsingProfile( m_PlayerNumber ) )
|
||||
return;
|
||||
|
||||
RadarValues rv;
|
||||
|
||||
if( g_Contents[c].req&NEED_NOTES )
|
||||
rv = GAMESTATE->m_pCurNotes[m_PlayerNumber]->GetRadarValues();
|
||||
else if( g_Contents[c].req&NEED_COURSE )
|
||||
{
|
||||
CourseDifficulty cd = GAMESTATE->m_PreferredCourseDifficulty[m_PlayerNumber];
|
||||
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
|
||||
rv = GAMESTATE->m_pCurCourse->GetTrail(st,cd)->GetRadarValues();
|
||||
}
|
||||
|
||||
const Song *pSong = GAMESTATE->m_pCurSong;
|
||||
const Steps *pSteps = GAMESTATE->m_pCurNotes[m_PlayerNumber];
|
||||
StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
|
||||
@@ -169,6 +158,16 @@ void PaneDisplay::SetContent( PaneContents c )
|
||||
const CourseDifficulty cd = GAMESTATE->m_PreferredCourseDifficulty[m_PlayerNumber];
|
||||
const Trail *pTrail = pCourse ? pCourse->GetTrail(st,cd) : NULL;
|
||||
|
||||
RadarValues rv;
|
||||
|
||||
if( g_Contents[c].req&NEED_NOTES )
|
||||
rv = GAMESTATE->m_pCurNotes[m_PlayerNumber]->GetRadarValues();
|
||||
else if( g_Contents[c].req&NEED_COURSE )
|
||||
{
|
||||
ASSERT( pCourse );
|
||||
rv = pTrail->GetRadarValues();
|
||||
}
|
||||
|
||||
float val = 0;
|
||||
CString str;
|
||||
switch( c )
|
||||
|
||||
@@ -574,6 +574,7 @@ bool PlayerOptions::IsEasierForSongAndSteps( Song* pSong, Steps* pSteps )
|
||||
|
||||
bool PlayerOptions::IsEasierForCourse( Course* pCourse, StepsType st, CourseDifficulty cd )
|
||||
{
|
||||
ASSERT( pCourse );
|
||||
Trail *pTrail = pCourse->GetTrail( st, cd );
|
||||
|
||||
FOREACH_CONST( TrailEntry, pTrail->m_vEntries, e )
|
||||
|
||||
@@ -308,7 +308,8 @@ int Profile::GetPossibleCourseDancePointsForStepsType( StepsType st ) const
|
||||
if( !pCourse->HasCourseDifficulty(st,cd) )
|
||||
continue;
|
||||
|
||||
const RadarValues& fRadars = pCourse->GetTrail(st,cd)->GetRadarValues();
|
||||
Trail* pTrail = pCourse->GetTrail(st,cd);
|
||||
const RadarValues& fRadars = pTrail->GetRadarValues();
|
||||
iTotal += ScoreKeeperMAX2::GetPossibleDancePoints( fRadars );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -733,7 +733,7 @@ bool PrintHighScoresForCourse( RageFile &f, const Profile *pProfile, Course* pCo
|
||||
{
|
||||
bool bPrintedAny = false;
|
||||
|
||||
for( StepsType st=(StepsType)0; st<NUM_STEPS_TYPES; st=(StepsType)(st+1) )
|
||||
FOREACH_StepsType( st )
|
||||
{
|
||||
FOREACH_ShownCourseDifficulty( cd )
|
||||
{
|
||||
|
||||
@@ -986,9 +986,9 @@ void ScreenEvaluation::CommitScores(
|
||||
case course:
|
||||
{
|
||||
Course* pCourse = GAMESTATE->m_pCurCourse;
|
||||
ASSERT( pCourse );
|
||||
CourseDifficulty cd = GAMESTATE->m_PreferredCourseDifficulty[p];
|
||||
Trail *pTrail = pCourse->GetTrail( st, cd );
|
||||
ASSERT( pCourse );
|
||||
ASSERT( pTrail );
|
||||
pHSL = &pProfile->GetCourseHighScoreList( pCourse, pTrail );
|
||||
}
|
||||
|
||||
@@ -184,6 +184,7 @@ void ScreenGameplay::Init()
|
||||
if( GAMESTATE->IsCourseMode() )
|
||||
{
|
||||
Course* pCourse = GAMESTATE->m_pCurCourse;
|
||||
ASSERT( pCourse );
|
||||
const StepsType st = GAMESTATE->GetCurrentStyleDef()->m_StepsType;
|
||||
|
||||
/* Increment the play count. */
|
||||
|
||||
@@ -33,6 +33,8 @@ void TrailID::FromTrail( const Trail *p )
|
||||
|
||||
Trail *TrailID::ToTrail( const Course *p, bool bAllowNull ) const
|
||||
{
|
||||
ASSERT( p );
|
||||
|
||||
if( st == STEPS_TYPE_INVALID || cd == COURSE_DIFFICULTY_INVALID )
|
||||
return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user