simplify ActorScroller::Load3

This commit is contained in:
Glenn Maynard
2005-12-07 03:53:49 +00:00
parent 24dd9f52a5
commit 12ff6ff4da
4 changed files with 5 additions and 8 deletions
+3 -5
View File
@@ -42,19 +42,17 @@ void ActorScroller::Load2(
float fItemHeight,
bool bLoop )
{
Load3( 0, fNumItemsToDraw,
Load3( fNumItemsToDraw,
ssprintf("function(self,offset,itemIndex,numItems) self:y(%f*offset) end",fItemHeight), 1, bLoop );
}
void ActorScroller::Load3(
float fSecondsPerItem,
float fNumItemsToDraw,
const CString &sTransformFunction,
int iSubdivisions,
bool bLoop
)
{
m_fSecondsPerItem = fSecondsPerItem;
m_fNumItemsToDraw = fNumItemsToDraw;
m_exprTransformFunction.SetFromExpression( sTransformFunction, iSubdivisions );
m_bLoop = bLoop;
@@ -102,7 +100,7 @@ void ActorScroller::LoadFromNode( const CString &sDir, const XNode *pNode )
Dialog::OK( sError ); \
}
float fSecondsPerItem = 1;
float fSecondsPerItem = 0;
float fNumItemsToDraw = 0;
CString sTransformFunction;
int iSubdivisions = 1;
@@ -117,11 +115,11 @@ void ActorScroller::LoadFromNode( const CString &sDir, const XNode *pNode )
pNode->GetAttrValue( "UseMask", bUseMask );
Load3(
fSecondsPerItem,
fNumItemsToDraw,
sTransformFunction,
iSubdivisions,
false );
ActorScroller::SetSecondsPerItem( fSecondsPerItem );
if( bUseMask )
EnableMask( 10, 10 ); // XXX
-1
View File
@@ -19,7 +19,6 @@ public:
bool bLoop );
void Load3(
float fSecondsPerItem,
float fNumItemsToDraw,
const CString &sTransformFunction,
int iSubdivisions,
+1 -1
View File
@@ -116,11 +116,11 @@ void HighScoreWheel::Load( const HighScoreList& hsl, int iIndexToFocus )
" self:z(math.cos(radians)*90); "
"end";
ActorScroller::Load3(
0.2f,
10.5,
sTransformFunction,
1,
false );
ActorScroller::SetSecondsPerItem( 0.2f );
Scroll();
}
+1 -1
View File
@@ -129,11 +129,11 @@ void ScreenSelectMaster::Init()
FOREACH( PlayerNumber, vpns, p )
{
m_Scroller[*p].Load3(
SCROLLER_SECONDS_PER_ITEM,
SCROLLER_NUM_ITEMS_TO_DRAW,
SCROLLER_TRANSFORM,
SCROLLER_SUBDIVISIONS,
LOOP_SCROLLER );
m_Scroller[*p].SetSecondsPerItem( SCROLLER_SECONDS_PER_ITEM );
m_Scroller[*p].SetName( "Scroller"+PLAYER_APPEND_NO_SPACE(*p) );
this->AddChild( &m_Scroller[*p] );
}