Wait...const did work? Have to fix the other.
This commit is contained in:
+2
-4
@@ -13,6 +13,7 @@
|
|||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
#include "LuaBinding.h"
|
#include "LuaBinding.h"
|
||||||
#include "LuaManager.h"
|
#include "LuaManager.h"
|
||||||
|
#include <numeric>
|
||||||
|
|
||||||
REGISTER_ACTOR_CLASS( Sprite );
|
REGISTER_ACTOR_CLASS( Sprite );
|
||||||
|
|
||||||
@@ -742,10 +743,7 @@ void Sprite::SetState( int iNewState )
|
|||||||
|
|
||||||
float Sprite::GetAnimationLengthSeconds() const
|
float Sprite::GetAnimationLengthSeconds() const
|
||||||
{
|
{
|
||||||
float fTotal = 0;
|
return std::accumulate(m_States.begin(), m_States.end(), 0.f, [](float total, State const &s) { return total += s.fDelay; });
|
||||||
FOREACH_CONST( State, m_States, s )
|
|
||||||
fTotal += s->fDelay;
|
|
||||||
return fTotal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sprite::SetSecondsIntoAnimation( float fSeconds )
|
void Sprite::SetSecondsIntoAnimation( float fSeconds )
|
||||||
|
|||||||
Reference in New Issue
Block a user