add support for texture coordinate animation in AnimatedTexture

This commit is contained in:
Chris Danford
2004-08-09 00:46:42 +00:00
parent 3f927e6280
commit 1d376f5795
14 changed files with 224 additions and 101 deletions
+14
View File
@@ -11,6 +11,7 @@
#include "RageTexture.h"
#include "ActorUtil.h"
#include "arch/Dialog/Dialog.h"
#include "Foreach.h"
Sprite::Sprite()
{
@@ -588,6 +589,11 @@ void Sprite::DrawPrimitives()
}
int Sprite::GetNumStates() const
{
return m_States.size();
}
void Sprite::SetState( int iNewState )
{
// This assert will likely trigger if the "missing" theme element graphic
@@ -610,6 +616,14 @@ void Sprite::SetState( int iNewState )
m_fSecsIntoState = 0.0;
}
float Sprite::GetAnimationLengthSeconds() const
{
float fTotal = 0;
FOREACH_CONST( State, m_States, s )
fTotal += s->fDelay;
return fTotal;
}
void Sprite::SetSecondsIntoAnimation( float fSeconds )
{
SetState( 0 ); // rewind to the first state