40 lines
616 B
C++
40 lines
616 B
C++
|
|
#include "..\eactions.h"
|
|||
|
|
#include "..\Win\winbase.h"
|
|||
|
|
|
|||
|
|
e2d::ActionDelay::ActionDelay(float duration)
|
|||
|
|
{
|
|||
|
|
setInterval(LONGLONG(duration * 1000));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
e2d::ActionDelay::~ActionDelay()
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
e2d::ActionDelay * e2d::ActionDelay::copy() const
|
|||
|
|
{
|
|||
|
|
return new ActionDelay(m_nAnimationInterval / 1000.0f);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void e2d::ActionDelay::_init()
|
|||
|
|
{
|
|||
|
|
EAction::_init();
|
|||
|
|
// <20><>¼<EFBFBD><C2BC>ǰʱ<C7B0><CAB1>
|
|||
|
|
m_nLast = GetNow();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void e2d::ActionDelay::_exec()
|
|||
|
|
{
|
|||
|
|
// <20>ж<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>㹻
|
|||
|
|
if (GetInterval(m_nLast) > m_nAnimationInterval)
|
|||
|
|
{
|
|||
|
|
this->stop();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void e2d::ActionDelay::_reset()
|
|||
|
|
{
|
|||
|
|
EAction::_reset();
|
|||
|
|
// <20><>¼<EFBFBD><C2BC>ǰʱ<C7B0><CAB1>
|
|||
|
|
m_nLast = GetNow();
|
|||
|
|
}
|