diff --git a/stepmania/src/CourseContentsList.cpp b/stepmania/src/CourseContentsList.cpp index 0c543cfd3b..ddd1a0063f 100644 --- a/stepmania/src/CourseContentsList.cpp +++ b/stepmania/src/CourseContentsList.cpp @@ -49,7 +49,7 @@ CourseContentsList::CourseContentsList() } -void CourseContentsList::SetFromCourse( Course* pCourse ) +void CourseContentsList::SetFromCourse( const Course* pCourse ) { if( pCourse == NULL ) { @@ -66,23 +66,9 @@ void CourseContentsList::SetFromCourse( Course* pCourse ) { CourseEntryDisplay& display = m_CourseContentDisplays[m_iNumContents]; - if( ci[i].Mystery ) - { - Difficulty dc = pCourse->GetDifficulty( ci[i] ); - int iMeterLow, iMeterHigh; - pCourse->GetMeterRange(ci[i], iMeterLow, iMeterHigh); - - if( dc == DIFFICULTY_INVALID ) - display.LoadFromMeterRange( m_iNumContents+1, iMeterLow, iMeterHigh, ci[i].Modifiers ); - else - display.LoadFromDifficulty( m_iNumContents+1, dc, ci[i].Modifiers ); - } - else - { - display.LoadFromSongAndNotes( m_iNumContents+1, ci[i].pSong, ci[i].pNotes, ci[i].Modifiers ); - } + display.LoadFromCourseInfo( m_iNumContents+1, pCourse, ci[i] ); - m_iNumContents ++; + m_iNumContents++; } } diff --git a/stepmania/src/CourseContentsList.h b/stepmania/src/CourseContentsList.h index 70306d26a0..65619a6e4d 100644 --- a/stepmania/src/CourseContentsList.h +++ b/stepmania/src/CourseContentsList.h @@ -34,7 +34,7 @@ public: virtual void Update( float fDeltaTime ); virtual void DrawPrimitives(); - void SetFromCourse( Course* pCourse ); + void SetFromCourse( const Course* pCourse ); void TweenInAfterChangedCourse(); protected: diff --git a/stepmania/src/CourseEntryDisplay.cpp b/stepmania/src/CourseEntryDisplay.cpp index 3721b13c63..77b2b49c20 100644 --- a/stepmania/src/CourseEntryDisplay.cpp +++ b/stepmania/src/CourseEntryDisplay.cpp @@ -61,61 +61,45 @@ void CourseEntryDisplay::Load() this->AddChild( &m_textModifiers ); } - -void CourseEntryDisplay::LoadFromSongAndNotes( int iNum, Song* pSong, Steps* pNotes, CString sModifiers ) +void CourseEntryDisplay::LoadFromCourseInfo( int iNum, const Course *pCourse, const Course::Info &ci ) { + RageColor colorNotes; + if( ci.Mystery ) + { + Difficulty dc = pCourse->GetDifficulty( ci ); + + if( dc == DIFFICULTY_INVALID ) + { + int iLow, iHigh; + pCourse->GetMeterRange(ci, iLow, iHigh); + + colorNotes = RageColor(1,1,1,1); + m_textDifficultyNumber.SetText( ssprintf(iLow==iHigh?"%d":"%d-%d", iLow, iHigh) ); + } + else + { + colorNotes = SONGMAN->GetDifficultyColor( dc ); + m_textDifficultyNumber.SetText( "?" ); + } + + m_TextBanner.LoadFromString( "??????????", "??????????", "", "", "", "" ); + m_TextBanner.SetDiffuse( RageColor(1,1,1,1) ); // TODO: What should this be? + } + else + { + colorNotes = SONGMAN->GetDifficultyColor( ci.pNotes->GetDifficulty() ); + m_textDifficultyNumber.SetText( ssprintf("%d", ci.pNotes->GetMeter()) ); + + m_TextBanner.LoadFromSong( ci.pSong ); + m_TextBanner.SetDiffuse( SONGMAN->GetSongColor( ci.pSong ) ); + } + m_textNumber.SetText( ssprintf("%d", iNum) ); - RageColor colorGroup = SONGMAN->GetSongColor( pSong ); - RageColor colorNotes = SONGMAN->GetDifficultyColor( pNotes->GetDifficulty() ); - - m_TextBanner.LoadFromSong( pSong ); - m_TextBanner.SetDiffuse( colorGroup ); - m_textFoot.SetText( "1" ); m_textFoot.SetDiffuse( colorNotes ); - m_textDifficultyNumber.SetText( ssprintf("%d", pNotes->GetMeter()) ); + m_textModifiers.SetText( ci.Modifiers ); + m_textDifficultyNumber.SetDiffuse( colorNotes ); - - m_textModifiers.SetText( sModifiers ); } - -void CourseEntryDisplay::LoadFromDifficulty( int iNum, Difficulty dc, CString sModifiers ) -{ - m_textNumber.SetText( ssprintf("%d", iNum) ); - - RageColor colorGroup = RageColor(1,1,1,1); // TODO: What should this be? - RageColor colorNotes = SONGMAN->GetDifficultyColor( dc ); - - m_TextBanner.LoadFromString( "??????????", "??????????", "", "", "", "" ); - m_TextBanner.SetDiffuse( colorGroup ); - - m_textFoot.SetText( "1" ); - m_textFoot.SetDiffuse( colorNotes ); - - m_textDifficultyNumber.SetText( "?" ); - m_textDifficultyNumber.SetDiffuse( colorNotes ); - - m_textModifiers.SetText( sModifiers ); -} - -void CourseEntryDisplay::LoadFromMeterRange( int iNum, int iLow, int iHigh, CString sModifiers ) -{ - m_textNumber.SetText( ssprintf("%d", iNum) ); - - RageColor colorGroup = RageColor(1,1,1,1); // TODO: What should this be? - RageColor colorNotes = RageColor(1,1,1,1); - - m_TextBanner.LoadFromString( "??????????", "??????????", "", "", "", "" ); - m_TextBanner.SetDiffuse( colorGroup ); - - m_textFoot.SetText( "1" ); - m_textFoot.SetDiffuse( colorNotes ); - - m_textDifficultyNumber.SetText( ssprintf(iLow==iHigh?"%d":"%d-%d", iLow, iHigh) ); - m_textDifficultyNumber.SetDiffuse( colorNotes ); - - m_textModifiers.SetText( sModifiers ); -} - diff --git a/stepmania/src/CourseEntryDisplay.h b/stepmania/src/CourseEntryDisplay.h index ab6a00ea2b..4d77c53a11 100644 --- a/stepmania/src/CourseEntryDisplay.h +++ b/stepmania/src/CourseEntryDisplay.h @@ -17,6 +17,7 @@ #include "Sprite.h" #include "Quad.h" #include "GameConstantsAndTypes.h" +#include "Course.h" class Course; class Song; class Steps; @@ -27,9 +28,7 @@ class CourseEntryDisplay : public ActorFrame public: void Load(); - void LoadFromSongAndNotes( int iNum, Song* pSong, Steps* pNotes, CString sModifiers ); - void LoadFromDifficulty( int iNum, Difficulty dc, CString sModifiers ); - void LoadFromMeterRange( int iNum, int iLow, int iHigh, CString sModifiers ); + void LoadFromCourseInfo( int iNum, const Course *pCourse, const Course::Info &ci ); private: Sprite m_sprFrame;