Wait...const did work? Have to fix the other.

This commit is contained in:
Jason Felds
2013-04-28 17:23:38 -04:00
parent 83dee17d2a
commit b1b55a42f6
+2 -4
View File
@@ -13,6 +13,7 @@
#include "Foreach.h"
#include "LuaBinding.h"
#include "LuaManager.h"
#include <numeric>
REGISTER_ACTOR_CLASS( Sprite );
@@ -742,10 +743,7 @@ void Sprite::SetState( int iNewState )
float Sprite::GetAnimationLengthSeconds() const
{
float fTotal = 0;
FOREACH_CONST( State, m_States, s )
fTotal += s->fDelay;
return fTotal;
return std::accumulate(m_States.begin(), m_States.end(), 0.f, [](float total, State const &s) { return total += s.fDelay; });
}
void Sprite::SetSecondsIntoAnimation( float fSeconds )