By default, don't use item numbers. On scrollers with lots of items, especially
with Subdivisions > 1, m_exprTransformFunction uses too much memory, and very few scrollers use this. Usually, per-item effects can be done better by using DynamicActorScroller and doing the effects on item load (but this can do some things that can't).
This commit is contained in:
@@ -29,6 +29,7 @@ ActorScroller::ActorScroller()
|
|||||||
m_iFirstSubActorIndex = 0;
|
m_iFirstSubActorIndex = 0;
|
||||||
m_bLoop = false;
|
m_bLoop = false;
|
||||||
m_bFastCatchup = false;
|
m_bFastCatchup = false;
|
||||||
|
m_bUseItemNumber = false;
|
||||||
m_fPauseCountdownSeconds = 0;
|
m_fPauseCountdownSeconds = 0;
|
||||||
m_fQuantizePixels = 0;
|
m_fQuantizePixels = 0;
|
||||||
|
|
||||||
@@ -145,6 +146,11 @@ void ActorScroller::LoadFromNode( const CString &sDir, const XNode *pNode )
|
|||||||
false );
|
false );
|
||||||
|
|
||||||
pNode->GetAttrValue( "QuantizePixels", m_fQuantizePixels );
|
pNode->GetAttrValue( "QuantizePixels", m_fQuantizePixels );
|
||||||
|
|
||||||
|
/* By default, don't use item numbers. On scrollers with lots of items,
|
||||||
|
* especially with Subdivisions > 1, m_exprTransformFunction uses too
|
||||||
|
* much memory, and very few scrollers use this. */
|
||||||
|
pNode->GetAttrValue( "UseItemNumber", m_bUseItemNumber );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActorScroller::UpdateInternal( float fDeltaTime )
|
void ActorScroller::UpdateInternal( float fDeltaTime )
|
||||||
@@ -268,6 +274,9 @@ void ActorScroller::PositionItemsAndDrawPrimitives( bool bDrawPrimitives )
|
|||||||
else if( iIndex < 0 || iIndex >= (int)m_SubActors.size() )
|
else if( iIndex < 0 || iIndex >= (int)m_SubActors.size() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if( !m_bUseItemNumber )
|
||||||
|
iItem = 0;
|
||||||
|
|
||||||
m_exprTransformFunction.PositionItem( m_SubActors[iIndex], fPosition, iItem, m_iNumItems );
|
m_exprTransformFunction.PositionItem( m_SubActors[iIndex], fPosition, iItem, m_iNumItems );
|
||||||
if( bDrawPrimitives )
|
if( bDrawPrimitives )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ protected:
|
|||||||
int m_iFirstSubActorIndex;
|
int m_iFirstSubActorIndex;
|
||||||
bool m_bLoop;
|
bool m_bLoop;
|
||||||
bool m_bFastCatchup;
|
bool m_bFastCatchup;
|
||||||
|
bool m_bUseItemNumber;
|
||||||
float m_fPauseCountdownSeconds;
|
float m_fPauseCountdownSeconds;
|
||||||
float m_fQuantizePixels;
|
float m_fQuantizePixels;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user