From e844ff7c32b9ed9794135ef312e8825317cf6752 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 3 Oct 2005 00:02:41 +0000 Subject: [PATCH] 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). --- stepmania/src/ActorScroller.cpp | 9 +++++++++ stepmania/src/ActorScroller.h | 1 + 2 files changed, 10 insertions(+) diff --git a/stepmania/src/ActorScroller.cpp b/stepmania/src/ActorScroller.cpp index e246e640bf..ac274c6b66 100644 --- a/stepmania/src/ActorScroller.cpp +++ b/stepmania/src/ActorScroller.cpp @@ -29,6 +29,7 @@ ActorScroller::ActorScroller() m_iFirstSubActorIndex = 0; m_bLoop = false; m_bFastCatchup = false; + m_bUseItemNumber = false; m_fPauseCountdownSeconds = 0; m_fQuantizePixels = 0; @@ -145,6 +146,11 @@ void ActorScroller::LoadFromNode( const CString &sDir, const XNode *pNode ) false ); 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 ) @@ -268,6 +274,9 @@ void ActorScroller::PositionItemsAndDrawPrimitives( bool bDrawPrimitives ) else if( iIndex < 0 || iIndex >= (int)m_SubActors.size() ) continue; + if( !m_bUseItemNumber ) + iItem = 0; + m_exprTransformFunction.PositionItem( m_SubActors[iIndex], fPosition, iItem, m_iNumItems ); if( bDrawPrimitives ) { diff --git a/stepmania/src/ActorScroller.h b/stepmania/src/ActorScroller.h index 749114b422..3d56d4a2ef 100644 --- a/stepmania/src/ActorScroller.h +++ b/stepmania/src/ActorScroller.h @@ -65,6 +65,7 @@ protected: int m_iFirstSubActorIndex; bool m_bLoop; bool m_bFastCatchup; + bool m_bUseItemNumber; float m_fPauseCountdownSeconds; float m_fQuantizePixels;