use deque in Actor for contant time delete of the head
This commit is contained in:
@@ -261,8 +261,8 @@ void Actor::UpdateTweening( float fDeltaTime )
|
||||
m_current = TS;
|
||||
|
||||
// delete the head tween
|
||||
m_TweenStates.erase( m_TweenStates.begin() );
|
||||
m_TweenInfo.erase( m_TweenInfo.begin() );
|
||||
m_TweenStates.pop_front();
|
||||
m_TweenInfo.pop_front();
|
||||
}
|
||||
else // in the middle of tweening. Recalcute the current position.
|
||||
{
|
||||
@@ -380,8 +380,6 @@ void Actor::StopTweening()
|
||||
{
|
||||
m_TweenStates.clear();
|
||||
m_TweenInfo.clear();
|
||||
ASSERT( m_TweenStates.empty() );
|
||||
ASSERT( m_TweenInfo.empty() );
|
||||
}
|
||||
|
||||
void Actor::FinishTweening()
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "RageTypes.h"
|
||||
#include "ActorCommands.h" // for ParsedCommand
|
||||
#include <deque>
|
||||
|
||||
class Actor
|
||||
{
|
||||
@@ -319,8 +320,8 @@ protected:
|
||||
RageVector2 m_size;
|
||||
TweenState m_current;
|
||||
TweenState m_start;
|
||||
vector<TweenState> m_TweenStates;
|
||||
vector<TweenInfo> m_TweenInfo;
|
||||
deque<TweenState> m_TweenStates; // use deque for contant time delete of the head
|
||||
deque<TweenInfo> m_TweenInfo;
|
||||
|
||||
TweenState& LatestTween() { ASSERT(m_TweenStates.size()>0); return m_TweenStates.back(); };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user