2004-06-08 00:47:53 +00:00
|
|
|
#include "global.h"
|
2003-04-03 22:10:40 +00:00
|
|
|
#include "ActorScroller.h"
|
2005-09-27 07:34:45 +00:00
|
|
|
#include "Foreach.h"
|
2003-04-03 22:10:40 +00:00
|
|
|
#include "RageUtil.h"
|
2005-09-26 19:53:11 +00:00
|
|
|
#include "XmlFile.h"
|
2005-01-06 18:34:34 +00:00
|
|
|
#include "arch/Dialog/Dialog.h"
|
2005-01-17 00:40:43 +00:00
|
|
|
#include "RageLog.h"
|
2005-03-01 16:59:29 +00:00
|
|
|
#include "ActorUtil.h"
|
2005-12-08 19:38:44 +00:00
|
|
|
#include "LuaBinding.h"
|
2005-03-01 16:59:29 +00:00
|
|
|
|
|
|
|
|
/* Tricky: We need ActorFrames created in XML to auto delete their children.
|
|
|
|
|
* We don't want classes that derive from ActorFrame to auto delete their
|
|
|
|
|
* children. The name "ActorFrame" is widely used in XML, so we'll have
|
|
|
|
|
* that string instead create an ActorFrameAutoDeleteChildren object.
|
|
|
|
|
*/
|
|
|
|
|
//REGISTER_ACTOR_CLASS( ActorScroller )
|
|
|
|
|
REGISTER_ACTOR_CLASS_WITH_NAME( ActorScrollerAutoDeleteChildren, ActorScroller )
|
2005-07-18 22:00:19 +00:00
|
|
|
Actor *ActorScroller::Copy() const { return new ActorScroller(*this); }
|
2005-03-01 16:59:29 +00:00
|
|
|
|
2003-04-03 22:10:40 +00:00
|
|
|
|
|
|
|
|
ActorScroller::ActorScroller()
|
|
|
|
|
{
|
2005-09-27 07:49:12 +00:00
|
|
|
m_iNumItems = 0;
|
2004-01-17 23:14:56 +00:00
|
|
|
m_fCurrentItem = 0;
|
|
|
|
|
m_fDestinationItem = 0;
|
2005-12-07 03:43:47 +00:00
|
|
|
m_fSecondsPerItem = 0;
|
2005-04-10 23:42:47 +00:00
|
|
|
m_fSecondsPauseBetweenItems = 0;
|
|
|
|
|
m_fNumItemsToDraw = 7;
|
2005-09-27 07:49:12 +00:00
|
|
|
m_iFirstSubActorIndex = 0;
|
2005-05-04 18:57:05 +00:00
|
|
|
m_bLoop = false;
|
|
|
|
|
m_bFastCatchup = false;
|
2006-01-30 00:50:00 +00:00
|
|
|
m_bFunctionDependsOnPositionOffset = true;
|
|
|
|
|
m_bFunctionDependsOnItemIndex = true;
|
2005-04-10 23:42:47 +00:00
|
|
|
m_fPauseCountdownSeconds = 0;
|
2005-04-25 06:02:47 +00:00
|
|
|
m_fQuantizePixels = 0;
|
|
|
|
|
|
2005-04-12 12:39:39 +00:00
|
|
|
m_quadMask.SetBlendMode( BLEND_NO_EFFECT ); // don't change color values
|
|
|
|
|
m_quadMask.SetUseZBuffer( true ); // we want to write to the Zbuffer
|
2005-10-17 23:18:49 +00:00
|
|
|
DisableMask();
|
2003-04-03 22:10:40 +00:00
|
|
|
}
|
|
|
|
|
|
2005-04-10 23:42:47 +00:00
|
|
|
void ActorScroller::Load2(
|
|
|
|
|
float fNumItemsToDraw,
|
2005-07-26 19:55:00 +00:00
|
|
|
bool bLoop
|
2005-05-03 09:29:54 +00:00
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
m_fNumItemsToDraw = fNumItemsToDraw;
|
2005-07-26 19:55:00 +00:00
|
|
|
m_bLoop = bLoop;
|
2005-09-27 07:49:12 +00:00
|
|
|
m_iNumItems = m_SubActors.size();
|
2005-12-08 19:38:44 +00:00
|
|
|
|
|
|
|
|
Lua *L = LUA->Get();
|
|
|
|
|
for( unsigned i = 0; i < m_SubActors.size(); ++i )
|
|
|
|
|
{
|
|
|
|
|
lua_pushnumber( L, i );
|
|
|
|
|
this->m_SubActors[i]->m_pLuaInstance->Set( L, "ItemIndex" );
|
|
|
|
|
}
|
|
|
|
|
LUA->Release( L );
|
2005-05-03 09:29:54 +00:00
|
|
|
}
|
|
|
|
|
|
2006-01-22 01:00:06 +00:00
|
|
|
void ActorScroller::SetTransformFromExpression( const RString &sTransformFunction )
|
2005-12-07 05:43:49 +00:00
|
|
|
{
|
|
|
|
|
m_exprTransformFunction.SetFromExpression( sTransformFunction );
|
2006-01-30 00:50:00 +00:00
|
|
|
|
|
|
|
|
// Probe to find which of the parameters are used.
|
|
|
|
|
#define GP(a,b) m_exprTransformFunction.GetPosition( a, b, 2 )
|
|
|
|
|
m_bFunctionDependsOnPositionOffset = (GP(0,0) != GP(1,0)) && (GP(0,1) != GP(1,1));
|
|
|
|
|
m_bFunctionDependsOnItemIndex = (GP(0,0) != GP(0,1)) && (GP(1,0) != GP(1,1));
|
|
|
|
|
m_exprTransformFunction.ClearCache();
|
2005-12-07 05:43:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ActorScroller::SetTransformFromHeight( float fItemHeight )
|
|
|
|
|
{
|
|
|
|
|
SetTransformFromExpression( ssprintf("function(self,offset,itemIndex,numItems) self:y(%f*offset) end",fItemHeight) );
|
|
|
|
|
}
|
|
|
|
|
|
2005-10-17 23:17:58 +00:00
|
|
|
void ActorScroller::EnableMask( float fWidth, float fHeight )
|
|
|
|
|
{
|
|
|
|
|
m_quadMask.SetHidden( false );
|
|
|
|
|
m_quadMask.SetWidth( fWidth );
|
|
|
|
|
m_quadMask.SetHeight( fHeight );
|
|
|
|
|
}
|
|
|
|
|
|
2005-10-17 23:18:49 +00:00
|
|
|
void ActorScroller::DisableMask()
|
2005-10-17 23:17:58 +00:00
|
|
|
{
|
|
|
|
|
m_quadMask.SetHidden( true );
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-22 00:08:59 +00:00
|
|
|
void ActorScroller::ScrollThroughAllItems()
|
|
|
|
|
{
|
2005-09-27 07:49:12 +00:00
|
|
|
m_fCurrentItem = m_bLoop ? +m_fNumItemsToDraw/2.0f : -(m_fNumItemsToDraw/2.0f)-1;
|
|
|
|
|
m_fDestinationItem = (float)(m_iNumItems+m_fNumItemsToDraw/2.0f+1);
|
2005-09-22 00:08:59 +00:00
|
|
|
}
|
|
|
|
|
|
2005-09-27 03:18:57 +00:00
|
|
|
void ActorScroller::ScrollWithPadding( float fItemPaddingStart, float fItemPaddingEnd )
|
|
|
|
|
{
|
|
|
|
|
m_fCurrentItem = -fItemPaddingStart;
|
2005-09-27 07:49:12 +00:00
|
|
|
m_fDestinationItem = m_iNumItems-1+fItemPaddingEnd;
|
2005-09-27 03:18:57 +00:00
|
|
|
}
|
|
|
|
|
|
2005-09-24 00:51:35 +00:00
|
|
|
float ActorScroller::GetSecondsForCompleteScrollThrough() const
|
2005-04-10 23:42:47 +00:00
|
|
|
{
|
2005-09-27 07:49:12 +00:00
|
|
|
float fTotalItems = m_fNumItemsToDraw + m_iNumItems;
|
2005-04-10 23:42:47 +00:00
|
|
|
return fTotalItems * (m_fSecondsPerItem + m_fSecondsPauseBetweenItems );
|
|
|
|
|
}
|
|
|
|
|
|
2006-02-24 01:57:10 +00:00
|
|
|
float ActorScroller::GetSecondsToDestination() const
|
|
|
|
|
{
|
|
|
|
|
float fTotalItemsToMove = fabsf(m_fCurrentItem - m_fDestinationItem);
|
|
|
|
|
return fTotalItemsToMove * m_fSecondsPerItem;
|
|
|
|
|
}
|
|
|
|
|
|
2006-01-22 01:00:06 +00:00
|
|
|
void ActorScroller::LoadFromNode( const RString &sDir, const XNode *pNode )
|
2005-01-06 18:34:34 +00:00
|
|
|
{
|
2005-01-16 23:40:21 +00:00
|
|
|
ActorFrame::LoadFromNode( sDir, pNode );
|
|
|
|
|
|
2005-01-17 00:40:43 +00:00
|
|
|
#define GET_VALUE( szName, valueOut ) \
|
2005-03-18 04:05:23 +00:00
|
|
|
if( !pNode->GetAttrValue( szName, valueOut ) ) { \
|
2006-01-22 01:00:06 +00:00
|
|
|
RString sError = ssprintf("ActorScroller in '%s' is missing the value Scroller::%s", sDir.c_str(), szName); \
|
2005-03-18 04:05:23 +00:00
|
|
|
LOG->Warn( sError ); \
|
|
|
|
|
Dialog::OK( sError ); \
|
|
|
|
|
}
|
2005-01-06 18:34:34 +00:00
|
|
|
|
2005-12-07 03:53:49 +00:00
|
|
|
float fSecondsPerItem = 0;
|
2005-03-18 04:05:23 +00:00
|
|
|
float fNumItemsToDraw = 0;
|
2006-01-22 01:00:06 +00:00
|
|
|
RString sTransformFunction;
|
2005-09-24 03:29:02 +00:00
|
|
|
int iSubdivisions = 1;
|
2005-01-06 18:34:34 +00:00
|
|
|
|
2005-01-17 00:40:43 +00:00
|
|
|
GET_VALUE( "SecondsPerItem", fSecondsPerItem );
|
|
|
|
|
GET_VALUE( "NumItemsToDraw", fNumItemsToDraw );
|
2005-05-05 00:22:36 +00:00
|
|
|
GET_VALUE( "TransformFunction", sTransformFunction );
|
2005-09-03 17:37:42 +00:00
|
|
|
pNode->GetAttrValue( "Subdivisions", iSubdivisions );
|
2005-01-17 00:40:43 +00:00
|
|
|
#undef GET_VALUE
|
2005-01-06 18:34:34 +00:00
|
|
|
|
2005-09-24 02:18:09 +00:00
|
|
|
bool bUseMask = false;
|
|
|
|
|
pNode->GetAttrValue( "UseMask", bUseMask );
|
|
|
|
|
|
2005-12-07 05:43:49 +00:00
|
|
|
Load2(
|
2005-01-06 21:24:32 +00:00
|
|
|
fNumItemsToDraw,
|
2005-05-05 00:22:36 +00:00
|
|
|
false );
|
2005-12-07 05:43:49 +00:00
|
|
|
ActorScroller::SetTransformFromExpression( sTransformFunction );
|
2005-12-07 03:53:49 +00:00
|
|
|
ActorScroller::SetSecondsPerItem( fSecondsPerItem );
|
2005-12-07 04:22:47 +00:00
|
|
|
ActorScroller::SetNumSubdivisions( iSubdivisions );
|
2005-04-19 19:17:03 +00:00
|
|
|
|
2005-10-17 23:21:16 +00:00
|
|
|
if( bUseMask )
|
|
|
|
|
EnableMask( 10, 10 ); // XXX
|
|
|
|
|
|
2005-04-19 19:17:03 +00:00
|
|
|
pNode->GetAttrValue( "QuantizePixels", m_fQuantizePixels );
|
2005-01-06 18:34:34 +00:00
|
|
|
}
|
|
|
|
|
|
2005-06-11 10:32:58 +00:00
|
|
|
void ActorScroller::UpdateInternal( float fDeltaTime )
|
2003-04-03 22:10:40 +00:00
|
|
|
{
|
2005-06-11 10:32:58 +00:00
|
|
|
ActorFrame::UpdateInternal( fDeltaTime );
|
2004-02-02 01:10:56 +00:00
|
|
|
|
2005-04-10 23:42:47 +00:00
|
|
|
/* If we have no children, the code below will busy loop. */
|
|
|
|
|
if( !m_SubActors.size() )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// handle pause
|
|
|
|
|
if( fDeltaTime > m_fPauseCountdownSeconds )
|
|
|
|
|
{
|
|
|
|
|
fDeltaTime -= m_fPauseCountdownSeconds;
|
|
|
|
|
m_fPauseCountdownSeconds = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_fPauseCountdownSeconds -= fDeltaTime;
|
|
|
|
|
fDeltaTime = 0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( m_fCurrentItem == m_fDestinationItem )
|
|
|
|
|
return; // done scrolling
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float fOldItemAtTop = m_fCurrentItem;
|
2005-01-06 01:51:55 +00:00
|
|
|
if( m_fSecondsPerItem > 0 )
|
2005-05-03 23:12:29 +00:00
|
|
|
{
|
|
|
|
|
float fApproachSpeed = fDeltaTime/m_fSecondsPerItem;
|
|
|
|
|
if( m_bFastCatchup )
|
|
|
|
|
{
|
|
|
|
|
float fDistanceToMove = fabsf(m_fCurrentItem - m_fDestinationItem);
|
|
|
|
|
if( fDistanceToMove > 1 )
|
|
|
|
|
fApproachSpeed *= fDistanceToMove*fDistanceToMove;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fapproach( m_fCurrentItem, m_fDestinationItem, fApproachSpeed );
|
|
|
|
|
}
|
2005-04-10 23:42:47 +00:00
|
|
|
|
|
|
|
|
// if items changed, then pause
|
|
|
|
|
if( (int)fOldItemAtTop != (int)m_fCurrentItem )
|
|
|
|
|
m_fPauseCountdownSeconds = m_fSecondsPauseBetweenItems;
|
|
|
|
|
|
|
|
|
|
if( m_bLoop )
|
2005-09-27 07:49:12 +00:00
|
|
|
m_fCurrentItem = fmodf( m_fCurrentItem, (float) m_iNumItems );
|
2004-02-01 03:14:37 +00:00
|
|
|
}
|
|
|
|
|
|
2005-09-03 17:37:42 +00:00
|
|
|
void ActorScroller::DrawPrimitives()
|
2005-05-03 09:29:54 +00:00
|
|
|
{
|
2005-09-24 02:35:53 +00:00
|
|
|
PositionItemsAndDrawPrimitives( true );
|
2005-09-02 21:42:34 +00:00
|
|
|
}
|
|
|
|
|
|
2005-09-03 17:37:42 +00:00
|
|
|
void ActorScroller::PositionItems()
|
2005-09-02 21:42:34 +00:00
|
|
|
{
|
2005-09-24 02:35:53 +00:00
|
|
|
PositionItemsAndDrawPrimitives( false );
|
2005-05-03 09:29:54 +00:00
|
|
|
}
|
2005-04-10 23:42:47 +00:00
|
|
|
|
2005-09-27 07:49:12 +00:00
|
|
|
/*
|
|
|
|
|
* Shift m_SubActors forward by iDist. This will place item m_iFirstSubActorIndex
|
|
|
|
|
* in m_SubActors[0].
|
|
|
|
|
*/
|
|
|
|
|
void ActorScroller::ShiftSubActors( int iDist )
|
|
|
|
|
{
|
|
|
|
|
if( iDist != INT_MAX )
|
|
|
|
|
CircularShift( m_SubActors, iDist );
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-24 02:35:53 +00:00
|
|
|
void ActorScroller::PositionItemsAndDrawPrimitives( bool bDrawPrimitives )
|
2004-02-01 03:14:37 +00:00
|
|
|
{
|
2005-05-03 09:29:54 +00:00
|
|
|
if( m_SubActors.empty() )
|
|
|
|
|
return;
|
|
|
|
|
|
2005-09-26 23:01:24 +00:00
|
|
|
float fNumItemsToDraw = m_fNumItemsToDraw;
|
2005-09-24 02:18:09 +00:00
|
|
|
if( !m_quadMask.GetHidden() )
|
2005-05-03 09:29:54 +00:00
|
|
|
{
|
2005-09-24 00:54:31 +00:00
|
|
|
// write to z buffer so that top and bottom are clipped
|
2005-09-26 21:03:09 +00:00
|
|
|
// Draw an extra item; this is the one that will be masked.
|
2005-09-26 23:01:24 +00:00
|
|
|
fNumItemsToDraw++;
|
2005-09-26 21:04:02 +00:00
|
|
|
float fPositionFullyOffScreenTop = -(fNumItemsToDraw)/2.f;
|
|
|
|
|
float fPositionFullyOffScreenBottom = (fNumItemsToDraw)/2.f;
|
2005-09-24 00:54:31 +00:00
|
|
|
|
2005-09-27 07:49:12 +00:00
|
|
|
m_exprTransformFunction.PositionItem( &m_quadMask, fPositionFullyOffScreenTop, -1, m_iNumItems );
|
2005-09-03 17:37:42 +00:00
|
|
|
if( bDrawPrimitives ) m_quadMask.Draw();
|
2005-05-03 09:29:54 +00:00
|
|
|
|
2005-09-27 07:49:12 +00:00
|
|
|
m_exprTransformFunction.PositionItem( &m_quadMask, fPositionFullyOffScreenBottom, m_iNumItems, m_iNumItems );
|
2005-09-03 17:37:42 +00:00
|
|
|
if( bDrawPrimitives ) m_quadMask.Draw();
|
2005-05-03 09:29:54 +00:00
|
|
|
}
|
|
|
|
|
|
2005-09-26 23:01:24 +00:00
|
|
|
float fFirstItemToDraw = m_fCurrentItem - fNumItemsToDraw/2.f;
|
|
|
|
|
float fLastItemToDraw = m_fCurrentItem + fNumItemsToDraw/2.f;
|
2005-09-27 07:49:12 +00:00
|
|
|
int iFirstItemToDraw = (int) ceilf( fFirstItemToDraw );
|
|
|
|
|
int iLastItemToDraw = (int) ceilf( fLastItemToDraw );
|
|
|
|
|
if( !m_bLoop )
|
|
|
|
|
{
|
|
|
|
|
iFirstItemToDraw = clamp( iFirstItemToDraw, 0, m_iNumItems );
|
|
|
|
|
iLastItemToDraw = clamp( iLastItemToDraw, 0, m_iNumItems );
|
|
|
|
|
}
|
2005-09-26 23:01:24 +00:00
|
|
|
|
2005-05-03 09:29:54 +00:00
|
|
|
bool bDelayedDraw = m_bDrawByZPosition && !m_bLoop;
|
|
|
|
|
vector<Actor*> subs;
|
|
|
|
|
|
|
|
|
|
{
|
2005-09-27 07:49:12 +00:00
|
|
|
/* Shift m_SubActors so iFirstItemToDraw is at the beginning. */
|
|
|
|
|
int iNewFirstIndex = iFirstItemToDraw;
|
|
|
|
|
int iDist = iNewFirstIndex - m_iFirstSubActorIndex;
|
|
|
|
|
m_iFirstSubActorIndex = iNewFirstIndex;
|
|
|
|
|
ShiftSubActors( iDist );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int iNumToDraw = iLastItemToDraw - iFirstItemToDraw;
|
|
|
|
|
for( int i = 0; i < iNumToDraw; ++i )
|
|
|
|
|
{
|
|
|
|
|
int iItem = i + iFirstItemToDraw;
|
2005-05-03 09:29:54 +00:00
|
|
|
float fPosition = iItem - m_fCurrentItem;
|
2005-09-27 07:49:12 +00:00
|
|
|
int iIndex = i; // index into m_SubActors
|
2005-05-03 09:29:54 +00:00
|
|
|
if( m_bLoop )
|
2005-07-26 19:55:00 +00:00
|
|
|
wrap( iIndex, m_SubActors.size() );
|
2005-05-03 09:29:54 +00:00
|
|
|
else if( iIndex < 0 || iIndex >= (int)m_SubActors.size() )
|
|
|
|
|
continue;
|
|
|
|
|
|
2006-01-30 00:50:00 +00:00
|
|
|
// Optimization: Zero out unused parameters so that they don't create new, unnecessary
|
|
|
|
|
// entries in the position cache. On scrollers with lots of items,
|
|
|
|
|
// especially with Subdivisions > 1, m_exprTransformFunction uses too much memory.
|
|
|
|
|
if( !m_bFunctionDependsOnPositionOffset )
|
|
|
|
|
fPosition = 0;
|
|
|
|
|
if( !m_bFunctionDependsOnItemIndex )
|
2005-10-03 00:02:41 +00:00
|
|
|
iItem = 0;
|
|
|
|
|
|
2005-09-27 07:49:12 +00:00
|
|
|
m_exprTransformFunction.PositionItem( m_SubActors[iIndex], fPosition, iItem, m_iNumItems );
|
2005-09-03 17:37:42 +00:00
|
|
|
if( bDrawPrimitives )
|
|
|
|
|
{
|
|
|
|
|
if( bDelayedDraw )
|
|
|
|
|
subs.push_back( m_SubActors[iIndex] );
|
|
|
|
|
else
|
|
|
|
|
m_SubActors[iIndex]->Draw();
|
|
|
|
|
}
|
2005-05-03 09:29:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( bDelayedDraw )
|
|
|
|
|
{
|
|
|
|
|
ActorUtil::SortByZPosition( subs );
|
|
|
|
|
FOREACH( Actor*, subs, a )
|
|
|
|
|
(*a)->Draw();
|
2004-02-01 03:14:37 +00:00
|
|
|
}
|
2003-04-03 22:10:40 +00:00
|
|
|
}
|
2004-06-08 00:47:53 +00:00
|
|
|
|
2005-06-20 04:17:02 +00:00
|
|
|
// lua start
|
|
|
|
|
#include "LuaBinding.h"
|
|
|
|
|
|
2005-06-20 05:02:03 +00:00
|
|
|
class LunaActorScroller: public Luna<ActorScroller>
|
2005-06-20 04:17:02 +00:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
LunaActorScroller() { LUA->Register( Register ); }
|
|
|
|
|
|
2005-12-07 05:11:40 +00:00
|
|
|
static int PositionItems( T* p, lua_State *L ) { p->PositionItems(); return 0; }
|
2005-12-07 05:48:04 +00:00
|
|
|
static int SetTransformFromExpression( T* p, lua_State *L ) { p->SetTransformFromExpression(SArg(1)); return 0; }
|
|
|
|
|
static int SetTransformFromHeight( T* p, lua_State *L ) { p->SetTransformFromHeight(FArg(1)); return 0; }
|
2005-06-20 04:17:02 +00:00
|
|
|
static int SetCurrentAndDestinationItem( T* p, lua_State *L ) { p->SetCurrentAndDestinationItem( FArg(1) ); return 0; }
|
2006-02-24 01:57:10 +00:00
|
|
|
static int getsecondtodestination( T* p, lua_State *L ) { lua_pushnumber( L, p->GetSecondsToDestination() ); return 1; }
|
2005-12-07 04:19:32 +00:00
|
|
|
static int setsecondsperitem( T* p, lua_State *L ) { p->SetSecondsPerItem(FArg(1)); return 0; }
|
|
|
|
|
static int setnumsubdivisions( T* p, lua_State *L ) { p->SetNumSubdivisions(IArg(1)); return 0; }
|
2005-09-27 03:18:57 +00:00
|
|
|
static int scrollthroughallitems( T* p, lua_State *L ) { p->ScrollThroughAllItems(); return 0; }
|
|
|
|
|
static int scrollwithpadding( T* p, lua_State *L ) { p->ScrollWithPadding(FArg(1),FArg(2)); return 0; }
|
2005-12-06 03:17:32 +00:00
|
|
|
static int setfastcatchup( T* p, lua_State *L ) { p->SetFastCatchup(BArg(1)); return 0; }
|
2005-06-20 04:17:02 +00:00
|
|
|
|
|
|
|
|
static void Register(lua_State *L)
|
|
|
|
|
{
|
2005-12-07 05:11:40 +00:00
|
|
|
ADD_METHOD( PositionItems );
|
2005-12-07 05:48:04 +00:00
|
|
|
ADD_METHOD( SetTransformFromExpression );
|
|
|
|
|
ADD_METHOD( SetTransformFromHeight );
|
2005-09-10 02:47:04 +00:00
|
|
|
ADD_METHOD( SetCurrentAndDestinationItem );
|
2006-02-24 01:57:10 +00:00
|
|
|
ADD_METHOD( getsecondtodestination );
|
2005-12-07 04:19:32 +00:00
|
|
|
ADD_METHOD( setsecondsperitem );
|
|
|
|
|
ADD_METHOD( setnumsubdivisions );
|
2005-09-27 03:18:57 +00:00
|
|
|
ADD_METHOD( scrollthroughallitems );
|
|
|
|
|
ADD_METHOD( scrollwithpadding );
|
2005-12-06 03:17:32 +00:00
|
|
|
ADD_METHOD( setfastcatchup );
|
2005-06-20 04:17:02 +00:00
|
|
|
Luna<T>::Register( L );
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
LUA_REGISTER_DERIVED_CLASS( ActorScroller, ActorFrame )
|
|
|
|
|
// lua end
|
|
|
|
|
|
2004-06-08 00:47:53 +00:00
|
|
|
/*
|
|
|
|
|
* (c) 2003-2004 Chris Danford
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the
|
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
* distribute, and/or sell copies of the Software, and to permit persons to
|
|
|
|
|
* whom the Software is furnished to do so, provided that the above
|
|
|
|
|
* copyright notice(s) and this permission notice appear in all copies of
|
|
|
|
|
* the Software and that both the above copyright notice(s) and this
|
|
|
|
|
* permission notice appear in supporting documentation.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
|
|
|
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
|
|
|
|
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
|
|
|
|
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
|
|
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
|
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
*/
|