simplify Load3. (Most scrollers use one subdivision.)
This commit is contained in:
@@ -43,19 +43,17 @@ void ActorScroller::Load2(
|
||||
bool bLoop )
|
||||
{
|
||||
Load3( fNumItemsToDraw,
|
||||
ssprintf("function(self,offset,itemIndex,numItems) self:y(%f*offset) end",fItemHeight), 1, bLoop );
|
||||
ssprintf("function(self,offset,itemIndex,numItems) self:y(%f*offset) end",fItemHeight), bLoop );
|
||||
}
|
||||
|
||||
void ActorScroller::Load3(
|
||||
float fNumItemsToDraw,
|
||||
const CString &sTransformFunction,
|
||||
int iSubdivisions,
|
||||
bool bLoop
|
||||
)
|
||||
{
|
||||
m_fNumItemsToDraw = fNumItemsToDraw;
|
||||
m_exprTransformFunction.SetFromExpression( sTransformFunction );
|
||||
m_exprTransformFunction.SetNumSubdivisions( iSubdivisions );
|
||||
m_bLoop = bLoop;
|
||||
m_iNumItems = m_SubActors.size();
|
||||
}
|
||||
@@ -118,9 +116,9 @@ void ActorScroller::LoadFromNode( const CString &sDir, const XNode *pNode )
|
||||
Load3(
|
||||
fNumItemsToDraw,
|
||||
sTransformFunction,
|
||||
iSubdivisions,
|
||||
false );
|
||||
ActorScroller::SetSecondsPerItem( fSecondsPerItem );
|
||||
ActorScroller::SetNumSubdivisions( iSubdivisions );
|
||||
|
||||
if( bUseMask )
|
||||
EnableMask( 10, 10 ); // XXX
|
||||
|
||||
@@ -21,7 +21,6 @@ public:
|
||||
void Load3(
|
||||
float fNumItemsToDraw,
|
||||
const CString &sTransformFunction,
|
||||
int iSubdivisions,
|
||||
bool bLoop );
|
||||
|
||||
void EnableMask( float fWidth, float fHeight );
|
||||
|
||||
@@ -118,7 +118,6 @@ void HighScoreWheel::Load( const HighScoreList& hsl, int iIndexToFocus )
|
||||
ActorScroller::Load3(
|
||||
10.5,
|
||||
sTransformFunction,
|
||||
1,
|
||||
false );
|
||||
ActorScroller::SetSecondsPerItem( 0.2f );
|
||||
Scroll();
|
||||
|
||||
@@ -131,9 +131,9 @@ void ScreenSelectMaster::Init()
|
||||
m_Scroller[*p].Load3(
|
||||
SCROLLER_NUM_ITEMS_TO_DRAW,
|
||||
SCROLLER_TRANSFORM,
|
||||
SCROLLER_SUBDIVISIONS,
|
||||
LOOP_SCROLLER );
|
||||
m_Scroller[*p].SetSecondsPerItem( SCROLLER_SECONDS_PER_ITEM );
|
||||
m_Scroller[*p].SetNumSubdivisions( SCROLLER_SUBDIVISIONS );
|
||||
m_Scroller[*p].SetName( "Scroller"+PLAYER_APPEND_NO_SPACE(*p) );
|
||||
this->AddChild( &m_Scroller[*p] );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user