diff --git a/stepmania/src/CourseContentsList.cpp b/stepmania/src/CourseContentsList.cpp index e078df8f73..61c0888e99 100644 --- a/stepmania/src/CourseContentsList.cpp +++ b/stepmania/src/CourseContentsList.cpp @@ -12,11 +12,6 @@ REGISTER_ACTOR_CLASS( CourseContentsList ) -CourseContentsList::CourseContentsList() -{ - m_iVisibleItems = 5; -} - CourseContentsList::~CourseContentsList() { FOREACH( Actor *, m_vpDisplay, d ) @@ -26,22 +21,21 @@ CourseContentsList::~CourseContentsList() void CourseContentsList::LoadFromNode( const XNode* pNode ) { - pNode->GetAttrValue( "VisibleItems", m_iVisibleItems ); - - ActorScroller::LoadFromNode( pNode ); + int iMaxSongs = 5; + pNode->GetAttrValue( "MaxSongs", iMaxSongs ); const XNode *pDisplayNode = pNode->GetChild( "Display" ); if( pDisplayNode == NULL ) RageException::Throw( "%s: CourseContentsList: missing the Display child", ActorUtil::GetWhere(pNode).c_str() ); - for( int i=0; iSetUseZBuffer( true ); m_vpDisplay.push_back( pDisplay ); } - this->SetNumItemsToDraw( (float)m_iVisibleItems ); + ActorScroller::LoadFromNode( pNode ); } void CourseContentsList::SetFromGameState() @@ -69,12 +63,8 @@ void CourseContentsList::SetFromGameState() this->SetLoop( bLoop ); this->Load2(); this->SetTransformFromHeight( m_vpDisplay[0]->GetUnzoomedHeight() ); - this->SetSecondsPerItem( 0.7f ); this->EnableMask( m_vpDisplay[0]->GetUnzoomedWidth(), m_vpDisplay[0]->GetUnzoomedHeight() ); - this->SetSecondsPauseBetweenItems( 0.7f ); - this->ScrollThroughAllItems(); - this->SetCurrentAndDestinationItem( (m_iVisibleItems-1)/2 ); if( bLoop ) { SetPauseCountdownSeconds( 1.5f ); @@ -86,31 +76,14 @@ void CourseContentsList::SetItemFromGameState( Actor *pActor, int iCourseEntryIn { const Course *pCourse = GAMESTATE->m_pCurCourse; - const TrailEntry *tes[NUM_PLAYERS]; - const CourseEntry *ces[NUM_PLAYERS]; - FOREACH_PlayerNumber( p ) - { - const Trail *pTrail = GAMESTATE->m_pCurTrail[p]; - if( pTrail && iCourseEntryIndex < (int) pTrail->m_vEntries.size() ) - { - tes[p] = &pTrail->m_vEntries[iCourseEntryIndex]; - ces[p] = &pCourse->m_vEntries[iCourseEntryIndex]; - } - else - { - tes[p] = NULL; - ces[p] = NULL; - } - } - - - const TrailEntry *te = tes[GAMESTATE->m_MasterPlayerNumber]; - if( te == NULL ) - return; - FOREACH_HumanPlayer(pn) { - const TrailEntry *te = tes[pn]; + const Trail *pTrail = GAMESTATE->m_pCurTrail[pn]; + if( pTrail == NULL || iCourseEntryIndex >= (int) pTrail->m_vEntries.size() ) + continue; + + const TrailEntry *te = &pTrail->m_vEntries[iCourseEntryIndex]; + const CourseEntry *ce = &pCourse->m_vEntries[iCourseEntryIndex]; if( te == NULL ) continue; @@ -118,7 +91,6 @@ void CourseContentsList::SetItemFromGameState( Actor *pActor, int iCourseEntryIn Difficulty dc; if( te->bSecret ) { - const CourseEntry *ce = ces[pn]; if( ce == NULL ) continue; diff --git a/stepmania/src/CourseContentsList.h b/stepmania/src/CourseContentsList.h index 59e6abc4c9..f86dbdb806 100644 --- a/stepmania/src/CourseContentsList.h +++ b/stepmania/src/CourseContentsList.h @@ -9,7 +9,6 @@ class CourseEntryDisplay; class CourseContentsList : public ActorScroller { public: - CourseContentsList(); ~CourseContentsList(); virtual CourseContentsList *Copy() const; @@ -23,7 +22,6 @@ public: protected: void SetItemFromGameState( Actor *pActor, int iCourseEntryIndex ); - int m_iVisibleItems; vector m_vpDisplay; };