From f59e884ede1df312e7466ea663a9d452b2f1d83a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 6 Dec 2005 03:05:57 +0000 Subject: [PATCH] simplify rarely-used Load2 --- stepmania/src/ActorScroller.cpp | 12 ++---------- stepmania/src/ActorScroller.h | 7 +++---- stepmania/src/CourseContentsList.cpp | 11 ++++++----- stepmania/src/ScreenRanking.cpp | 3 ++- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/stepmania/src/ActorScroller.cpp b/stepmania/src/ActorScroller.cpp index 0704c01b5b..202bf88f99 100644 --- a/stepmania/src/ActorScroller.cpp +++ b/stepmania/src/ActorScroller.cpp @@ -39,21 +39,13 @@ ActorScroller::ActorScroller() } void ActorScroller::Load2( + float fSecondsPerItem, float fNumItemsToDraw, - float fItemWidth, float fItemHeight, - bool bLoop, - float fSecondsPerItem, - float fSecondsPauseBetweenItems ) + bool bLoop ) { Load3( fSecondsPerItem, fNumItemsToDraw, false, ssprintf("function(self,offset,itemIndex,numItems) self:y(%f*offset) end",fItemHeight), 1, bLoop ); - - m_fSecondsPauseBetweenItems = fSecondsPauseBetweenItems; - - ScrollThroughAllItems(); - - EnableMask( fItemWidth, fItemHeight ); } void ActorScroller::Load3( diff --git a/stepmania/src/ActorScroller.h b/stepmania/src/ActorScroller.h index e465f56323..0bbbe50fbb 100644 --- a/stepmania/src/ActorScroller.h +++ b/stepmania/src/ActorScroller.h @@ -14,12 +14,10 @@ public: ActorScroller(); void Load2( + float fSecondsPerItem, float fNumItemsToDraw, - float fItemWidth, float fItemHeight, - bool bLoop, - float fSecondsPerItem, - float fSecondsPauseBetweenItems ); + bool bLoop ); void Load3( float fSecondsPerItem, @@ -47,6 +45,7 @@ public: void ScrollThroughAllItems(); void ScrollWithPadding( float fItemPaddingStart, float fItemPaddingEnd ); void SetPauseCountdownSeconds( float fSecs ) { m_fPauseCountdownSeconds = fSecs; } + void SetSecondsPauseBetweenItems( float fSeconds ) { m_fSecondsPauseBetweenItems = fSeconds; } float GetSecondsForCompleteScrollThrough() const; // diff --git a/stepmania/src/CourseContentsList.cpp b/stepmania/src/CourseContentsList.cpp index 2424fa5c1f..27c9d22cc3 100644 --- a/stepmania/src/CourseContentsList.cpp +++ b/stepmania/src/CourseContentsList.cpp @@ -78,12 +78,13 @@ void CourseContentsList::SetFromGameState() bool bLoop = pMasterTrail->m_vEntries.size() > uNumEntriesToShow; this->Load2( - (float)MAX_VISIBLE_ITEMS, - m_vpDisplay[0]->GetUnzoomedWidth(), - m_vpDisplay[0]->GetUnzoomedHeight(), - bLoop, 0.7f, - 0.7f ); + (float)MAX_VISIBLE_ITEMS, + m_vpDisplay[0]->GetUnzoomedHeight(), + bLoop ); + this->EnableMask( m_vpDisplay[0]->GetUnzoomedWidth(), m_vpDisplay[0]->GetUnzoomedHeight() ); + this->SetSecondsPauseBetweenItems( 0.7f ); + this->ScrollThroughAllItems(); this->SetCurrentAndDestinationItem( (MAX_VISIBLE_ITEMS-1)/2 ); if( bLoop ) diff --git a/stepmania/src/ScreenRanking.cpp b/stepmania/src/ScreenRanking.cpp index 221f8c334d..ccf5419165 100644 --- a/stepmania/src/ScreenRanking.cpp +++ b/stepmania/src/ScreenRanking.cpp @@ -365,8 +365,9 @@ void ScoreScroller::Load( for( int i=0; iAddChild( new ScoreRowItem(ItemTemplate) ); - DynamicActorScroller::Load2( (float) m_metricSongScoreRowsToDraw, SCREEN_WIDTH, fItemHeight, false, SONG_SCORE_SECONDS_PER_ROW, 0 ); + DynamicActorScroller::Load2( SONG_SCORE_SECONDS_PER_ROW, (float) m_metricSongScoreRowsToDraw, fItemHeight, false ); DynamicActorScroller::EnableMask( SCREEN_WIDTH, fItemHeight ); + DynamicActorScroller::ScrollThroughAllItems(); m_iNumItems = m_vScoreRowItemData.size(); }