Action类重命名;去除Action构造器

This commit is contained in:
Nomango 2018-05-08 20:03:29 +08:00
parent f9181a2080
commit 83a90fcb0e
48 changed files with 1098 additions and 1305 deletions

View File

@ -1,133 +1,102 @@
#include "..\e2daction.h"
#include "..\e2dmanager.h"
e2d::ActionMoveBy * e2d::Action::MoveBy(double duration, Vector vector)
e2d::Action::Action()
: _running(false)
, _done(false)
, _initialized(false)
, _target(nullptr)
, _fLast(0)
{
return new (std::nothrow) ActionMoveBy(duration, vector);
ActionManager::__add(this);
}
e2d::ActionMoveTo * e2d::Action::MoveTo(double duration, Point pos)
e2d::Action::~Action()
{
return new (std::nothrow) ActionMoveTo(duration, pos);
}
e2d::ActionScaleBy * e2d::Action::ScaleBy(double duration, double scale)
bool e2d::Action::_isDone()
{
return new (std::nothrow) ActionScaleBy(duration, scale);
return _done;
}
e2d::ActionScaleBy * e2d::Action::ScaleBy(double duration, double scaleX, double scaleY)
void e2d::Action::_startWithTarget(Node* target)
{
return new (std::nothrow) ActionScaleBy(duration, scaleX, scaleY);
_target = target;
_running = true;
this->reset();
}
e2d::ActionScaleTo * e2d::Action::ScaleTo(double duration, double scale)
bool e2d::Action::isRunning()
{
return new (std::nothrow) ActionScaleTo(duration, scale);
return _running;
}
e2d::ActionScaleTo * e2d::Action::ScaleTo(double duration, double scaleX, double scaleY)
void e2d::Action::resume()
{
return new (std::nothrow) ActionScaleTo(duration, scaleX, scaleY);
_running = true;
_fLast = Time::getTotalTime();
}
e2d::ActionOpacityBy * e2d::Action::OpacityBy(double duration, double opacity)
void e2d::Action::pause()
{
return new (std::nothrow) ActionOpacityBy(duration, opacity);
_running = false;
}
e2d::ActionOpacityTo * e2d::Action::OpacityTo(double duration, double opacity)
void e2d::Action::stop()
{
return new (std::nothrow) ActionOpacityTo(duration, opacity);
_done = true;
}
e2d::ActionFadeIn * e2d::Action::FadeIn(double duration)
e2d::String e2d::Action::getName() const
{
return new (std::nothrow) ActionFadeIn(duration);
return _name;
}
e2d::ActionFadeOut * e2d::Action::FadeOut(double duration)
void e2d::Action::setName(const String& name)
{
return new (std::nothrow) ActionFadeOut(duration);
_name = name;
}
e2d::ActionRotateBy * e2d::Action::RotateBy(double duration, double rotation)
e2d::Action * e2d::Action::reverse() const
{
return new (std::nothrow) ActionRotateBy(duration, rotation);
WARN_IF(true, "Action cannot be reversed!");
return nullptr;
}
e2d::ActionRotateTo * e2d::Action::RotateTo(double duration, double rotation)
e2d::Node * e2d::Action::getTarget()
{
return new (std::nothrow) ActionRotateTo(duration, rotation);
return _target;
}
e2d::ActionTwo * e2d::Action::Two(ActionBase * pActionFirst, ActionBase * pActionSecond, bool bAtSameTime)
void e2d::Action::onDestroy()
{
return new (std::nothrow) ActionTwo(pActionFirst, pActionSecond, bAtSameTime);
ActionManager::__remove(this);
}
e2d::ActionDelay * e2d::Action::Delay(double duration)
void e2d::Action::_init()
{
return new (std::nothrow) ActionDelay(duration);
_initialized = true;
// ¼Ç¼µ±Ç°Ê±¼ä
_fLast = Time::getTotalTime();
}
e2d::ActionLoop * e2d::Action::Loop(ActionBase * action, int times)
void e2d::Action::_update()
{
return new (std::nothrow) ActionLoop(action, times);
}
e2d::ActionFunc * e2d::Action::Func(const Function& func)
{
return new (std::nothrow) ActionFunc(func);
}
#ifdef HIGHER_THAN_VS2012
e2d::ActionSequence * e2d::Action::Sequence(const std::initializer_list<ActionBase*>& vActions)
{
return new (std::nothrow) ActionSequence(vActions);
}
e2d::Animation * e2d::Action::Animation(double interval, const std::initializer_list<Image*>& vFrames)
{
return new (std::nothrow) e2d::Animation(interval, vFrames);
}
#else
e2d::ActionSequence * e2d::Action::Sequence(int number, ActionBase * action1, ...)
{
auto action = new (std::nothrow) ActionSequence();
if (action)
if (!_initialized)
{
ActionBase ** ppAction = &action1;
while (number > 0)
{
WARN_IF((*ppAction) == nullptr, "ActionSequence NULL pointer exception!");
action->add(*ppAction);
ppAction++;
number--;
}
_init();
}
return action;
}
e2d::Animation * e2d::Action::Animation(double interval, int number, Image * frame, ...)
void e2d::Action::reset()
{
auto animation = new (std::nothrow) e2d::Animation(interval);
if (animation)
{
Image ** ppImage = &frame;
while (number > 0)
{
WARN_IF((*ppImage) == nullptr, "Animation NULL pointer exception!");
animation->add(*ppImage);
ppImage++;
number--;
}
}
return animation;
_initialized = false;
_done = false;
_fLast = Time::getTotalTime();
}
#endif
void e2d::Action::_resetTime()
{
_fLast = Time::getTotalTime();
}

View File

@ -1,103 +0,0 @@
#include "..\e2daction.h"
#include "..\e2dmanager.h"
e2d::ActionBase::ActionBase()
: _bRunning(false)
, _bEnding(false)
, _bInit(false)
, _pTarget(nullptr)
, _pParentScene(nullptr)
, _fLast(0)
{
ActionManager::__add(this);
}
e2d::ActionBase::~ActionBase()
{
}
bool e2d::ActionBase::_isDone()
{
return _bEnding;
}
void e2d::ActionBase::_startWithTarget(Node* target)
{
_pTarget = target;
_bRunning = true;
this->reset();
}
bool e2d::ActionBase::isRunning()
{
return _bRunning;
}
void e2d::ActionBase::resume()
{
_bRunning = true;
_fLast = Time::getTotalTime();
}
void e2d::ActionBase::pause()
{
_bRunning = false;
}
void e2d::ActionBase::stop()
{
_bEnding = true;
}
e2d::String e2d::ActionBase::getName() const
{
return _sName;
}
void e2d::ActionBase::setName(const String& name)
{
_sName = name;
}
e2d::ActionBase * e2d::ActionBase::reverse() const
{
WARN_IF(true, "ActionBase cannot be reversed!");
return nullptr;
}
e2d::Node * e2d::ActionBase::getTarget()
{
return _pTarget;
}
void e2d::ActionBase::destroy()
{
ActionManager::__remove(this);
}
void e2d::ActionBase::_init()
{
_bInit = true;
// ¼Ç¼µ±Ç°Ê±¼ä
_fLast = Time::getTotalTime();
}
void e2d::ActionBase::_update()
{
if (!_bInit)
{
_init();
}
}
void e2d::ActionBase::reset()
{
_bInit = false;
_bEnding = false;
_fLast = Time::getTotalTime();
}
void e2d::ActionBase::_resetTime()
{
_fLast = Time::getTotalTime();
}

View File

@ -1,26 +0,0 @@
#include "..\e2daction.h"
e2d::ActionDelay::ActionDelay(double duration)
{
_fDelayTime = max(duration, 0);
}
e2d::ActionDelay * e2d::ActionDelay::clone() const
{
return new ActionDelay(_fDelayTime);
}
void e2d::ActionDelay::_init()
{
ActionBase::_init();
}
void e2d::ActionDelay::_update()
{
ActionBase::_update();
// 判断时间间隔是否足够
if ((Time::getTotalTime() - _fLast) >= _fDelayTime)
{
this->stop();
}
}

View File

@ -1,22 +0,0 @@
#include "..\e2daction.h"
e2d::ActionFunc::ActionFunc(const Function& func) :
_Callback(func)
{
}
e2d::ActionFunc * e2d::ActionFunc::clone() const
{
return new ActionFunc(_Callback);
}
void e2d::ActionFunc::_init()
{
// 执行函数对象的动作不需要初始化
}
void e2d::ActionFunc::_update()
{
_Callback();
this->stop();
}

View File

@ -1,30 +1,30 @@
#include "..\e2daction.h"
e2d::ActionGradual::ActionGradual(double duration)
: _fRateOfProgress(0)
: _delta(0)
{
_fDuration = max(duration, 0);
_duration = max(duration, 0);
}
void e2d::ActionGradual::_init()
{
ActionBase::_init();
Action::_init();
}
void e2d::ActionGradual::_update()
{
ActionBase::_update();
Action::_update();
// 判断时间间隔是否足够
if (_fDuration == 0)
if (_duration == 0)
{
_fRateOfProgress = 1;
_delta = 1;
this->stop();
return;
}
// 计算动画进度
_fRateOfProgress = min((Time::getTotalTime() - _fLast) / _fDuration, 1);
_delta = min((Time::getTotalTime() - _fLast) / _duration, 1);
// 判断动作是否结束
if (_fRateOfProgress >= 1)
if (_delta >= 1)
{
this->stop();
}

View File

@ -1,67 +0,0 @@
#include "..\e2daction.h"
#include "..\e2dmanager.h"
e2d::ActionLoop::ActionLoop(ActionBase * action, int times /* = -1 */)
: _pAction(action)
, _nTimes(0)
, _nTotalTimes(times)
{
ASSERT(_pAction, "ActionLoop NULL pointer exception!");
_pAction->retain();
}
e2d::ActionLoop::~ActionLoop()
{
}
e2d::ActionLoop * e2d::ActionLoop::clone() const
{
return new ActionLoop(_pAction->clone());
}
void e2d::ActionLoop::_init()
{
ActionBase::_init();
_pAction->_pTarget = _pTarget;
_pAction->_init();
}
void e2d::ActionLoop::_update()
{
ActionBase::_update();
if (_nTimes == _nTotalTimes)
{
this->stop();
return;
}
_pAction->_update();
if (_pAction->_isDone())
{
_nTimes++;
ActionBase::reset();
_pAction->reset();
}
}
void e2d::ActionLoop::reset()
{
ActionBase::reset();
_pAction->reset();
_nTimes = 0;
}
void e2d::ActionLoop::destroy()
{
ActionBase::destroy();
SafeRelease(&_pAction);
}
void e2d::ActionLoop::_resetTime()
{
_pAction->_resetTime();
}

View File

@ -1,41 +0,0 @@
#include "..\e2daction.h"
e2d::ActionMoveBy::ActionMoveBy(double duration, Vector vector) :
ActionGradual(duration)
{
_MoveVec = vector;
}
void e2d::ActionMoveBy::_init()
{
ActionGradual::_init();
if (_pTarget)
{
_BeginPos = _pTarget->getPos();
}
}
void e2d::ActionMoveBy::_update()
{
ActionGradual::_update();
if (_pTarget == nullptr)
{
this->stop();
return;
}
// ÒÆ¶¯½Úµã
_pTarget->setPos(_BeginPos + _MoveVec * _fRateOfProgress);
}
e2d::ActionMoveBy * e2d::ActionMoveBy::clone() const
{
return new ActionMoveBy(_fDuration, _MoveVec);
}
e2d::ActionMoveBy * e2d::ActionMoveBy::reverse() const
{
return new ActionMoveBy(_fDuration, -_MoveVec);
}

View File

@ -1,18 +0,0 @@
#include "..\e2daction.h"
e2d::ActionMoveTo::ActionMoveTo(double duration, Point pos) :
ActionMoveBy(duration, Vector())
{
_EndPos = pos;
}
e2d::ActionMoveTo * e2d::ActionMoveTo::clone() const
{
return new ActionMoveTo(_fDuration, _EndPos);
}
void e2d::ActionMoveTo::_init()
{
ActionMoveBy::_init();
_MoveVec = _EndPos - _BeginPos;
}

View File

@ -1,40 +0,0 @@
#include "..\e2daction.h"
e2d::ActionOpacityBy::ActionOpacityBy(double duration, double opacity) :
ActionGradual(duration)
{
_nVariation = opacity;
}
void e2d::ActionOpacityBy::_init()
{
ActionGradual::_init();
if (_pTarget)
{
_nBeginVal = _pTarget->getOpacity();
}
}
void e2d::ActionOpacityBy::_update()
{
ActionGradual::_update();
if (_pTarget == nullptr)
{
this->stop();
return;
}
// ÉèÖýڵã͸Ã÷¶È
_pTarget->setOpacity(_nBeginVal + _nVariation * _fRateOfProgress);
}
e2d::ActionOpacityBy * e2d::ActionOpacityBy::clone() const
{
return new ActionOpacityBy(_fDuration, _nVariation);
}
e2d::ActionOpacityBy * e2d::ActionOpacityBy::reverse() const
{
return new ActionOpacityBy(_fDuration, -_nVariation);
}

View File

@ -1,19 +0,0 @@
#include "..\e2daction.h"
e2d::ActionOpacityTo::ActionOpacityTo(double duration, double opacity) :
ActionOpacityBy(duration, 0)
{
_nEndVal = opacity;
}
e2d::ActionOpacityTo * e2d::ActionOpacityTo::clone() const
{
return new ActionOpacityTo(_fDuration, _nEndVal);
}
void e2d::ActionOpacityTo::_init()
{
ActionOpacityBy::_init();
_nVariation = _nEndVal - _nBeginVal;
}

View File

@ -1,41 +0,0 @@
#include "..\e2daction.h"
e2d::ActionRotateBy::ActionRotateBy(double duration, double rotation) :
ActionGradual(duration)
{
_nVariation = rotation;
}
void e2d::ActionRotateBy::_init()
{
ActionGradual::_init();
if (_pTarget)
{
_nBeginVal = _pTarget->getRotation();
}
}
void e2d::ActionRotateBy::_update()
{
ActionGradual::_update();
if (_pTarget == nullptr)
{
this->stop();
return;
}
// Ðýת½Úµã
_pTarget->setRotation(_nBeginVal + _nVariation * _fRateOfProgress);
}
e2d::ActionRotateBy * e2d::ActionRotateBy::clone() const
{
return new ActionRotateBy(_fDuration, _nVariation);
}
e2d::ActionRotateBy * e2d::ActionRotateBy::reverse() const
{
return new ActionRotateBy(_fDuration, -_nVariation);
}

View File

@ -1,19 +0,0 @@
#include "..\e2daction.h"
e2d::ActionRotateTo::ActionRotateTo(double duration, double rotation) :
ActionRotateBy(duration, 0)
{
_nEndVal = rotation;
}
e2d::ActionRotateTo * e2d::ActionRotateTo::clone() const
{
return new ActionRotateTo(_fDuration, _nEndVal);
}
void e2d::ActionRotateTo::_init()
{
ActionRotateBy::_init();
_nVariation = _nEndVal - _nBeginVal;
}

View File

@ -1,52 +0,0 @@
#include "..\e2daction.h"
e2d::ActionScaleBy::ActionScaleBy(double duration, double scale)
: ActionGradual(duration)
{
_nVariationX = scale;
_nVariationY = scale;
}
e2d::ActionScaleBy::ActionScaleBy(double duration, double scaleX, double scaleY)
: ActionGradual(duration)
{
_nVariationX = scaleX;
_nVariationY = scaleY;
}
void e2d::ActionScaleBy::_init()
{
ActionGradual::_init();
if (_pTarget)
{
_nBeginScaleX = _pTarget->getScaleX();
_nBeginScaleY = _pTarget->getScaleY();
}
}
void e2d::ActionScaleBy::_update()
{
ActionGradual::_update();
if (_pTarget == nullptr)
{
this->stop();
return;
}
// Ëõ·Å½Úµã
_pTarget->setScale(
_nBeginScaleX + _nVariationX * _fRateOfProgress,
_nBeginScaleY + _nVariationY * _fRateOfProgress);
}
e2d::ActionScaleBy * e2d::ActionScaleBy::clone() const
{
return new ActionScaleBy(_fDuration, _nVariationX, _nVariationY);
}
e2d::ActionScaleBy * e2d::ActionScaleBy::reverse() const
{
return new ActionScaleBy(_fDuration, -_nVariationX, -_nVariationY);
}

View File

@ -1,27 +0,0 @@
#include "..\e2daction.h"
e2d::ActionScaleTo::ActionScaleTo(double duration, double scale)
: ActionScaleBy(duration, 0, 0)
{
_nEndScaleX = scale;
_nEndScaleY = scale;
}
e2d::ActionScaleTo::ActionScaleTo(double duration, double scaleX, double scaleY)
: ActionScaleBy(duration, 0, 0)
{
_nEndScaleX = scaleX;
_nEndScaleY = scaleY;
}
e2d::ActionScaleTo * e2d::ActionScaleTo::clone() const
{
return new ActionScaleTo(_fDuration, _nEndScaleX, _nEndScaleY);
}
void e2d::ActionScaleTo::_init()
{
ActionScaleBy::_init();
_nVariationX = _nEndScaleX - _nBeginScaleX;
_nVariationY = _nEndScaleY - _nBeginScaleY;
}

View File

@ -1,156 +0,0 @@
#include "..\e2daction.h"
e2d::ActionSequence::ActionSequence()
: _nActionIndex(0)
{
}
#ifdef HIGHER_THAN_VS2012
e2d::ActionSequence::ActionSequence(const std::initializer_list<ActionBase*>& vActions)
: _nActionIndex(0)
{
this->add(vActions);
}
#else
e2d::ActionSequence::ActionSequence(int number, ActionBase * action1, ...) :
_nActionIndex(0)
{
ActionBase ** ppAction = &action1;
while (number > 0)
{
WARN_IF((*ppAction) == nullptr, "ActionSequence NULL pointer exception!");
this->add(*ppAction);
ppAction++;
number--;
}
}
#endif
e2d::ActionSequence::~ActionSequence()
{
}
void e2d::ActionSequence::_init()
{
ActionBase::_init();
// 将所有动作与目标绑定
if (_pTarget)
{
for (auto action : _vActions)
{
action->_pTarget = _pTarget;
}
}
// 初始化第一个动作
_vActions[0]->_init();
}
void e2d::ActionSequence::destroy()
{
ActionBase::destroy();
for (auto action : _vActions)
{
SafeRelease(&action);
}
}
void e2d::ActionSequence::_update()
{
ActionBase::_update();
auto &action = _vActions[_nActionIndex];
action->_update();
if (action->_isDone())
{
_nActionIndex++;
if (_nActionIndex == _vActions.size())
{
this->stop();
}
else
{
_vActions[_nActionIndex]->_init();
}
}
}
void e2d::ActionSequence::reset()
{
ActionBase::reset();
for (auto action : _vActions)
{
action->reset();
}
_nActionIndex = 0;
}
void e2d::ActionSequence::_resetTime()
{
for (auto action : _vActions)
{
action->_resetTime();
}
}
void e2d::ActionSequence::add(ActionBase * action)
{
if (action)
{
_vActions.push_back(action);
action->retain();
}
}
#ifdef HIGHER_THAN_VS2012
void e2d::ActionSequence::add(const std::initializer_list<ActionBase*>& vActions)
{
for (const auto &action : vActions)
{
this->add(action);
}
}
#else
void e2d::ActionSequence::add(int number, ActionBase * action, ...)
{
ActionBase ** ppAction = &action;
while (number > 0)
{
WARN_IF((*ppAction) == nullptr, "ActionSequence NULL pointer exception!");
this->add(*ppAction);
ppAction++;
number--;
}
}
#endif
e2d::ActionSequence * e2d::ActionSequence::clone() const
{
auto a = new ActionSequence();
for (auto action : _vActions)
{
a->add(action->clone());
}
return a;
}
e2d::ActionSequence * e2d::ActionSequence::reverse(bool actionReverse) const
{
auto a = new ActionSequence();
for (auto action : _vActions)
{
if (actionReverse)
{
a->add(action->reverse());
}
else
{
a->add(action->clone());
}
}
// 将动作顺序逆序排列
a->_vActions.reserve(_vActions.size());
return a;
}

View File

@ -1,95 +0,0 @@
#include "..\e2daction.h"
e2d::ActionTwo::ActionTwo(ActionBase * pActionFirst, ActionBase * pActionSecond, bool bAtSameTime/* = false*/)
: _pFirstAction(pActionFirst)
, _pSecondAction(pActionSecond)
, _bAtSameTime(bAtSameTime)
{
ASSERT(_pFirstAction && _pSecondAction, "ActionTwo NULL pointer exception!");
_pFirstAction->retain();
_pSecondAction->retain();
}
e2d::ActionTwo::~ActionTwo()
{
}
e2d::ActionTwo * e2d::ActionTwo::clone() const
{
return new ActionTwo(_pFirstAction->clone(), _pSecondAction->clone());
}
e2d::ActionTwo * e2d::ActionTwo::reverse(bool actionReverse) const
{
if (actionReverse)
{
return new ActionTwo(_pSecondAction->reverse(), _pFirstAction->reverse());
}
else
{
return new ActionTwo(_pSecondAction->clone(), _pFirstAction->clone());
}
}
void e2d::ActionTwo::_init()
{
ActionBase::_init();
_pFirstAction->_pTarget = _pTarget;
_pSecondAction->_pTarget = _pTarget;
_pFirstAction->_init();
if (_bAtSameTime) _pSecondAction->_init();
}
void e2d::ActionTwo::_update()
{
ActionBase::_update();
if (!_pFirstAction->_isDone())
{
_pFirstAction->_update();
if (!_bAtSameTime && _pFirstAction->_isDone())
{
_pSecondAction->_init();
}
}
if (_bAtSameTime)
{
if (!_pSecondAction->_isDone())
{
_pSecondAction->_update();
}
}
else if (_pFirstAction->_isDone())
{
_pSecondAction->_update();
}
if (_pFirstAction->_isDone() && _pSecondAction->_isDone())
{
this->stop();
}
}
void e2d::ActionTwo::reset()
{
ActionBase::reset();
_pFirstAction->reset();
_pSecondAction->reset();
}
void e2d::ActionTwo::destroy()
{
ActionBase::destroy();
SafeRelease(&_pFirstAction);
SafeRelease(&_pSecondAction);
}
void e2d::ActionTwo::_resetTime()
{
_pFirstAction->_resetTime();
_pSecondAction->_resetTime();
}

View File

@ -1,29 +1,29 @@
#include "..\e2daction.h"
e2d::Animation::Animation()
: _nFrameIndex(0)
, _fInterval(1)
: _frameIndex(0)
, _interval(1)
{
}
e2d::Animation::Animation(double interval)
: _nFrameIndex(0)
, _fInterval(interval)
: _frameIndex(0)
, _interval(interval)
{
}
#ifdef HIGHER_THAN_VS2012
e2d::Animation::Animation(const std::initializer_list<Image*>& vImages)
: _nFrameIndex(0)
, _fInterval(1)
: _frameIndex(0)
, _interval(1)
{
this->add(vImages);
}
e2d::Animation::Animation(double interval, const std::initializer_list<Image*>& vImages)
: _nFrameIndex(0)
, _fInterval(interval)
: _frameIndex(0)
, _interval(interval)
{
this->add(vImages);
}
@ -31,8 +31,8 @@ e2d::Animation::Animation(double interval, const std::initializer_list<Image*>&
#else
e2d::Animation::Animation(int number, Image * frame, ...)
: _nFrameIndex(0)
, _fInterval(1)
: _frameIndex(0)
, _interval(1)
{
Image ** ppImage = &frame;
@ -46,8 +46,8 @@ e2d::Animation::Animation(int number, Image * frame, ...)
}
e2d::Animation::Animation(double interval, int number, Image * frame, ...)
: _nFrameIndex(0)
, _fInterval(interval)
: _frameIndex(0)
, _interval(interval)
{
Image ** ppImage = &frame;
@ -68,34 +68,34 @@ e2d::Animation::~Animation()
void e2d::Animation::setInterval(double interval)
{
_fInterval = max(interval, 0);
_interval = max(interval, 0);
}
void e2d::Animation::_init()
{
ActionBase::_init();
Action::_init();
}
void e2d::Animation::_update()
{
ActionBase::_update();
Action::_update();
if (_pTarget == nullptr)
if (_target == nullptr)
{
this->stop();
return;
}
// 判断时间间隔是否足够
while ((Time::getTotalTime() - _fLast) >= _fInterval)
while ((Time::getTotalTime() - _fLast) >= _interval)
{
// 重新记录时间
_fLast += _fInterval;
_fLast += _interval;
// 加载关键帧
static_cast<Sprite*>(_pTarget)->open(_vFrames[_nFrameIndex]);
_nFrameIndex++;
static_cast<Sprite*>(_target)->open(_frames[_frameIndex]);
_frameIndex++;
// 判断动作是否结束
if (_nFrameIndex == _vFrames.size())
if (_frameIndex == _frames.size())
{
this->stop();
break;
@ -105,14 +105,14 @@ void e2d::Animation::_update()
void e2d::Animation::reset()
{
ActionBase::reset();
_nFrameIndex = 0;
Action::reset();
_frameIndex = 0;
}
void e2d::Animation::destroy()
void e2d::Animation::onDestroy()
{
ActionBase::destroy();
for (auto frame : _vFrames)
Action::onDestroy();
for (auto frame : _frames)
{
SafeRelease(&frame);
}
@ -122,7 +122,7 @@ void e2d::Animation::add(Image * frame)
{
if (frame)
{
_vFrames.push_back(frame);
_frames.push_back(frame);
frame->retain();
}
}
@ -152,8 +152,8 @@ void e2d::Animation::add(int number, Image * frame, ...)
e2d::Animation * e2d::Animation::clone() const
{
auto a = new Animation(_fInterval);
for (auto frame : _vFrames)
auto a = new Animation(_interval);
for (auto frame : _frames)
{
a->add(frame);
}
@ -163,6 +163,6 @@ e2d::Animation * e2d::Animation::clone() const
e2d::Animation * e2d::Animation::reverse() const
{
auto a = this->clone();
a->_vFrames.reserve(_vFrames.size());
a->_frames.reserve(_frames.size());
return a;
}

21
core/Action/CallFunc.cpp Normal file
View File

@ -0,0 +1,21 @@
#include "..\e2daction.h"
e2d::CallFunc::CallFunc(const Function& func) :
_func(func)
{
}
e2d::CallFunc * e2d::CallFunc::clone() const
{
return new CallFunc(_func);
}
void e2d::CallFunc::_init()
{
}
void e2d::CallFunc::_update()
{
_func();
this->stop();
}

26
core/Action/Delay.cpp Normal file
View File

@ -0,0 +1,26 @@
#include "..\e2daction.h"
e2d::Delay::Delay(double duration)
{
_delay = max(duration, 0);
}
e2d::Delay * e2d::Delay::clone() const
{
return new Delay(_delay);
}
void e2d::Delay::_init()
{
Action::_init();
}
void e2d::Delay::_update()
{
Action::_update();
// 判断时间间隔是否足够
if ((Time::getTotalTime() - _fLast) >= _delay)
{
this->stop();
}
}

67
core/Action/Loop.cpp Normal file
View File

@ -0,0 +1,67 @@
#include "..\e2daction.h"
#include "..\e2dmanager.h"
e2d::Loop::Loop(Action * action, int times /* = -1 */)
: _action(action)
, _times(0)
, _totalTimes(times)
{
ASSERT(_action, "Loop NULL pointer exception!");
_action->retain();
}
e2d::Loop::~Loop()
{
}
e2d::Loop * e2d::Loop::clone() const
{
return new Loop(_action->clone());
}
void e2d::Loop::_init()
{
Action::_init();
_action->_target = _target;
_action->_init();
}
void e2d::Loop::_update()
{
Action::_update();
if (_times == _totalTimes)
{
this->stop();
return;
}
_action->_update();
if (_action->_isDone())
{
_times++;
Action::reset();
_action->reset();
}
}
void e2d::Loop::reset()
{
Action::reset();
_action->reset();
_times = 0;
}
void e2d::Loop::onDestroy()
{
Action::onDestroy();
SafeRelease(&_action);
}
void e2d::Loop::_resetTime()
{
_action->_resetTime();
}

40
core/Action/MoveBy.cpp Normal file
View File

@ -0,0 +1,40 @@
#include "..\e2daction.h"
e2d::MoveBy::MoveBy(double duration, Vector vector) :
ActionGradual(duration)
{
_deltaPos = vector;
}
void e2d::MoveBy::_init()
{
ActionGradual::_init();
if (_target)
{
_startPos = _target->getPos();
}
}
void e2d::MoveBy::_update()
{
ActionGradual::_update();
if (_target == nullptr)
{
this->stop();
return;
}
_target->setPos(_startPos + _deltaPos * _delta);
}
e2d::MoveBy * e2d::MoveBy::clone() const
{
return new MoveBy(_duration, _deltaPos);
}
e2d::MoveBy * e2d::MoveBy::reverse() const
{
return new MoveBy(_duration, -_deltaPos);
}

18
core/Action/MoveTo.cpp Normal file
View File

@ -0,0 +1,18 @@
#include "..\e2daction.h"
e2d::MoveTo::MoveTo(double duration, Point pos) :
MoveBy(duration, Vector())
{
_endPos = pos;
}
e2d::MoveTo * e2d::MoveTo::clone() const
{
return new MoveTo(_duration, _endPos);
}
void e2d::MoveTo::_init()
{
MoveBy::_init();
_deltaPos = _endPos - _startPos;
}

40
core/Action/OpacityBy.cpp Normal file
View File

@ -0,0 +1,40 @@
#include "..\e2daction.h"
e2d::OpacityBy::OpacityBy(double duration, double opacity) :
ActionGradual(duration)
{
_deltaVal = opacity;
}
void e2d::OpacityBy::_init()
{
ActionGradual::_init();
if (_target)
{
_startVal = _target->getOpacity();
}
}
void e2d::OpacityBy::_update()
{
ActionGradual::_update();
if (_target == nullptr)
{
this->stop();
return;
}
_target->setOpacity(_startVal + _deltaVal * _delta);
}
e2d::OpacityBy * e2d::OpacityBy::clone() const
{
return new OpacityBy(_duration, _deltaVal);
}
e2d::OpacityBy * e2d::OpacityBy::reverse() const
{
return new OpacityBy(_duration, -_deltaVal);
}

19
core/Action/OpacityTo.cpp Normal file
View File

@ -0,0 +1,19 @@
#include "..\e2daction.h"
e2d::OpacityTo::OpacityTo(double duration, double opacity) :
OpacityBy(duration, 0)
{
_endVal = opacity;
}
e2d::OpacityTo * e2d::OpacityTo::clone() const
{
return new OpacityTo(_duration, _endVal);
}
void e2d::OpacityTo::_init()
{
OpacityBy::_init();
_deltaVal = _endVal - _startVal;
}

40
core/Action/RotateBy.cpp Normal file
View File

@ -0,0 +1,40 @@
#include "..\e2daction.h"
e2d::RotateBy::RotateBy(double duration, double rotation) :
ActionGradual(duration)
{
_deltaVal = rotation;
}
void e2d::RotateBy::_init()
{
ActionGradual::_init();
if (_target)
{
_startVal = _target->getRotation();
}
}
void e2d::RotateBy::_update()
{
ActionGradual::_update();
if (_target == nullptr)
{
this->stop();
return;
}
_target->setRotation(_startVal + _deltaVal * _delta);
}
e2d::RotateBy * e2d::RotateBy::clone() const
{
return new RotateBy(_duration, _deltaVal);
}
e2d::RotateBy * e2d::RotateBy::reverse() const
{
return new RotateBy(_duration, -_deltaVal);
}

19
core/Action/RotateTo.cpp Normal file
View File

@ -0,0 +1,19 @@
#include "..\e2daction.h"
e2d::RotateTo::RotateTo(double duration, double rotation) :
RotateBy(duration, 0)
{
_endVal = rotation;
}
e2d::RotateTo * e2d::RotateTo::clone() const
{
return new RotateTo(_duration, _endVal);
}
void e2d::RotateTo::_init()
{
RotateBy::_init();
_deltaVal = _endVal - _startVal;
}

49
core/Action/ScaleBy.cpp Normal file
View File

@ -0,0 +1,49 @@
#include "..\e2daction.h"
e2d::ScaleBy::ScaleBy(double duration, double scale)
: ActionGradual(duration)
{
_deltaX = scale;
_deltaY = scale;
}
e2d::ScaleBy::ScaleBy(double duration, double scaleX, double scaleY)
: ActionGradual(duration)
{
_deltaX = scaleX;
_deltaY = scaleY;
}
void e2d::ScaleBy::_init()
{
ActionGradual::_init();
if (_target)
{
_startScaleX = _target->getScaleX();
_startScaleY = _target->getScaleY();
}
}
void e2d::ScaleBy::_update()
{
ActionGradual::_update();
if (_target == nullptr)
{
this->stop();
return;
}
_target->setScale(_startScaleX + _deltaX * _delta, _startScaleY + _deltaY * _delta);
}
e2d::ScaleBy * e2d::ScaleBy::clone() const
{
return new ScaleBy(_duration, _deltaX, _deltaY);
}
e2d::ScaleBy * e2d::ScaleBy::reverse() const
{
return new ScaleBy(_duration, -_deltaX, -_deltaY);
}

27
core/Action/ScaleTo.cpp Normal file
View File

@ -0,0 +1,27 @@
#include "..\e2daction.h"
e2d::ScaleTo::ScaleTo(double duration, double scale)
: ScaleBy(duration, 0, 0)
{
_endScaleX = scale;
_endScaleY = scale;
}
e2d::ScaleTo::ScaleTo(double duration, double scaleX, double scaleY)
: ScaleBy(duration, 0, 0)
{
_endScaleX = scaleX;
_endScaleY = scaleY;
}
e2d::ScaleTo * e2d::ScaleTo::clone() const
{
return new ScaleTo(_duration, _endScaleX, _endScaleY);
}
void e2d::ScaleTo::_init()
{
ScaleBy::_init();
_deltaX = _endScaleX - _startScaleX;
_deltaY = _endScaleY - _startScaleY;
}

149
core/Action/Sequence.cpp Normal file
View File

@ -0,0 +1,149 @@
#include "..\e2daction.h"
e2d::Sequence::Sequence()
: _currIndex(0)
{
}
#ifdef HIGHER_THAN_VS2012
e2d::Sequence::Sequence(const std::initializer_list<Action*>& vActions)
: _currIndex(0)
{
this->add(vActions);
}
#else
e2d::Sequence::Sequence(int number, Action * action1, ...) :
_currIndex(0)
{
Action ** ppAction = &action1;
while (number > 0)
{
WARN_IF((*ppAction) == nullptr, "Sequence NULL pointer exception!");
this->add(*ppAction);
ppAction++;
number--;
}
}
#endif
e2d::Sequence::~Sequence()
{
}
void e2d::Sequence::_init()
{
Action::_init();
// 将所有动作与目标绑定
if (_target)
{
for (auto action : _actions)
{
action->_target = _target;
}
}
// 初始化第一个动作
_actions[0]->_init();
}
void e2d::Sequence::onDestroy()
{
Action::onDestroy();
for (auto action : _actions)
{
SafeRelease(&action);
}
}
void e2d::Sequence::_update()
{
Action::_update();
auto &action = _actions[_currIndex];
action->_update();
if (action->_isDone())
{
_currIndex++;
if (_currIndex == _actions.size())
{
this->stop();
}
else
{
_actions[_currIndex]->_init();
}
}
}
void e2d::Sequence::reset()
{
Action::reset();
for (auto action : _actions)
{
action->reset();
}
_currIndex = 0;
}
void e2d::Sequence::_resetTime()
{
for (auto action : _actions)
{
action->_resetTime();
}
}
void e2d::Sequence::add(Action * action)
{
if (action)
{
_actions.push_back(action);
action->retain();
}
}
#ifdef HIGHER_THAN_VS2012
void e2d::Sequence::add(const std::initializer_list<Action*>& vActions)
{
for (const auto &action : vActions)
{
this->add(action);
}
}
#else
void e2d::Sequence::add(int number, Action * action, ...)
{
Action ** ppAction = &action;
while (number > 0)
{
WARN_IF((*ppAction) == nullptr, "Sequence NULL pointer exception!");
this->add(*ppAction);
ppAction++;
number--;
}
}
#endif
e2d::Sequence * e2d::Sequence::clone() const
{
auto a = new Sequence();
for (auto action : _actions)
{
a->add(action->clone());
}
return a;
}
e2d::Sequence * e2d::Sequence::reverse() const
{
auto a = new Sequence();
for (auto action : _actions)
{
a->add(action->reverse());
}
// 将动作顺序逆序排列
a->_actions.reserve(_actions.size());
return a;
}

147
core/Action/Spawn.cpp Normal file
View File

@ -0,0 +1,147 @@
#include "..\e2daction.h"
e2d::Spawn::Spawn()
{
}
#ifdef HIGHER_THAN_VS2012
e2d::Spawn::Spawn(const std::initializer_list<Action*>& vActions)
{
this->add(vActions);
}
#else
e2d::Spawn::Spawn(int number, Action * action1, ...) :
_currIndex(0)
{
Action ** ppAction = &action1;
while (number > 0)
{
WARN_IF((*ppAction) == nullptr, "Spawn NULL pointer exception!");
this->add(*ppAction);
ppAction++;
number--;
}
}
#endif
e2d::Spawn::~Spawn()
{
}
void e2d::Spawn::_init()
{
Action::_init();
if (_target)
{
for (auto action : _actions)
{
action->_target = _target;
action->_init();
}
}
}
void e2d::Spawn::onDestroy()
{
Action::onDestroy();
for (auto action : _actions)
{
SafeRelease(&action);
}
}
void e2d::Spawn::_update()
{
Action::_update();
size_t doneNum = 0;
for (auto action : _actions)
{
if (action->_isDone())
{
doneNum++;
}
else
{
action->_update();
}
}
if (doneNum == _actions.size())
{
this->stop();
}
}
void e2d::Spawn::reset()
{
Action::reset();
for (auto action : _actions)
{
action->reset();
}
}
void e2d::Spawn::_resetTime()
{
for (auto action : _actions)
{
action->_resetTime();
}
}
void e2d::Spawn::add(Action * action)
{
if (action)
{
_actions.push_back(action);
action->retain();
}
}
#ifdef HIGHER_THAN_VS2012
void e2d::Spawn::add(const std::initializer_list<Action*>& vActions)
{
for (const auto &action : vActions)
{
this->add(action);
}
}
#else
void e2d::Spawn::add(int number, Action * action, ...)
{
Action ** ppAction = &action;
while (number > 0)
{
WARN_IF((*ppAction) == nullptr, "Spawn NULL pointer exception!");
this->add(*ppAction);
ppAction++;
number--;
}
}
#endif
e2d::Spawn * e2d::Spawn::clone() const
{
auto a = new Spawn();
for (auto action : _actions)
{
a->add(action->clone());
}
return a;
}
e2d::Spawn * e2d::Spawn::reverse() const
{
auto a = new Spawn();
for (auto action : _actions)
{
a->add(action->reverse());
}
// ½«¶¯×÷˳ÐòÄæÐòÅÅÁÐ
a->_actions.reserve(_actions.size());
return a;
}

View File

@ -91,7 +91,7 @@ void e2d::Scene::showCollider(bool visiable)
_bColliderVisiable = visiable;
}
void e2d::Scene::destroy()
void e2d::Scene::onDestroy()
{
SafeRelease(&_pRoot);
}

View File

@ -1,8 +1,8 @@
#include "..\e2dmanager.h"
#include "..\e2daction.h"
static std::vector<e2d::ActionBase*> s_vActions;
static std::vector<e2d::ActionBase*> s_vRunningActions;
static std::vector<e2d::Action*> s_vActions;
static std::vector<e2d::Action*> s_vRunningActions;
void e2d::ActionManager::__update()
@ -19,7 +19,7 @@ void e2d::ActionManager::__update()
{
// ¶¯×÷ÒѾ­½áÊø
action->release();
action->_pTarget = nullptr;
action->_target = nullptr;
s_vRunningActions.erase(s_vRunningActions.begin() + i);
}
else
@ -33,7 +33,7 @@ void e2d::ActionManager::__update()
}
}
void e2d::ActionManager::__add(ActionBase * action)
void e2d::ActionManager::__add(Action * action)
{
if (action)
{
@ -41,7 +41,7 @@ void e2d::ActionManager::__add(ActionBase * action)
}
}
void e2d::ActionManager::__remove(ActionBase * action)
void e2d::ActionManager::__remove(Action * action)
{
for (size_t i = 0; i < s_vActions.size();)
{
@ -98,16 +98,28 @@ void e2d::ActionManager::__stopAllBindedWith(Node * target)
}
}
void e2d::ActionManager::start(ActionBase * action, Node * target, bool paused)
void e2d::ActionManager::start(Action * action, Node * target, bool paused)
{
WARN_IF(action == nullptr, "ActionBase NULL pointer exception!");
WARN_IF(action == nullptr, "Action NULL pointer exception!");
WARN_IF(target == nullptr, "Target node NULL pointer exception!");
if (action && target)
{
ASSERT([](Action * newAction)
{
for (const auto& action : s_vRunningActions)
{
if (newAction == action)
{
return false;
}
}
return true;
}(action), "action already be added!");
action->_startWithTarget(target);
action->retain();
action->_bRunning = !paused;
action->_running = !paused;
s_vRunningActions.push_back(action);
}
}
@ -199,9 +211,9 @@ void e2d::ActionManager::stopAll()
}
}
std::vector<e2d::ActionBase*> e2d::ActionManager::get(const String& strActionName)
std::vector<e2d::Action*> e2d::ActionManager::get(const String& strActionName)
{
std::vector<ActionBase*> vActions;
std::vector<Action*> vActions;
for (auto action : s_vActions)
{
if (action->getName() == strActionName)
@ -212,7 +224,7 @@ std::vector<e2d::ActionBase*> e2d::ActionManager::get(const String& strActionNam
return std::move(vActions);
}
std::vector<e2d::ActionBase*> e2d::ActionManager::getAll()
std::vector<e2d::Action*> e2d::ActionManager::getAll()
{
return s_vActions;
}

View File

@ -21,7 +21,7 @@ void e2d::ObjectManager::__update()
{
if ((*iter)->getRefCount() <= 0)
{
(*iter)->destroy();
(*iter)->onDestroy();
delete (*iter);
iter = s_vObjectPool.erase(iter);
}

View File

@ -5,7 +5,7 @@
e2d::Button::Button()
: _Callback(nullptr)
: _func(nullptr)
, _eBtnState(ButtonState::NORMAL)
, _bEnable(true)
, _bIsSelected(false)
@ -17,7 +17,7 @@ e2d::Button::Button()
}
e2d::Button::Button(Node * normal, const Function& func)
: _Callback(nullptr)
: _func(nullptr)
, _eBtnState(ButtonState::NORMAL)
, _bEnable(true)
, _bIsSelected(false)
@ -31,7 +31,7 @@ e2d::Button::Button(Node * normal, const Function& func)
}
e2d::Button::Button(Node * normal, Node * selected, const Function& func)
: _Callback(nullptr)
: _func(nullptr)
, _eBtnState(ButtonState::NORMAL)
, _bEnable(true)
, _bIsSelected(false)
@ -46,7 +46,7 @@ e2d::Button::Button(Node * normal, Node * selected, const Function& func)
}
e2d::Button::Button(Node * normal, Node * mouseover, Node * selected, const Function& func)
: _Callback(nullptr)
: _func(nullptr)
, _eBtnState(ButtonState::NORMAL)
, _bEnable(true)
, _bIsSelected(false)
@ -62,7 +62,7 @@ e2d::Button::Button(Node * normal, Node * mouseover, Node * selected, const Func
}
e2d::Button::Button(Node * normal, Node * mouseover, Node * selected, Node * disabled, const Function& func)
: _Callback(nullptr)
: _func(nullptr)
, _eBtnState(ButtonState::NORMAL)
, _bEnable(true)
, _bIsSelected(false)
@ -174,7 +174,7 @@ void e2d::Button::setClickFunc(const Function& func)
{
WARN_IF(_pNormal == nullptr, "Button cannot work without anything to show. Please set its normal displayed.");
_Callback = func;
_func = func;
}
void e2d::Button::onFixedUpdate()
@ -277,8 +277,8 @@ void e2d::Button::_updateVisiable()
void e2d::Button::_runCallback()
{
if (_Callback)
if (_func)
{
_Callback();
_func();
}
}

View File

@ -311,8 +311,8 @@ void e2d::ButtonToggle::_runCallback()
_bState = !_bState;
_updateState();
if (_Callback)
if (_func)
{
_Callback();
_func();
}
}

View File

@ -240,7 +240,7 @@ bool e2d::Node::isVisiable() const
e2d::String e2d::Node::getName() const
{
return _sName;
return _name;
}
unsigned int e2d::Node::getHashName() const
@ -676,7 +676,7 @@ std::vector<e2d::Node*> e2d::Node::getChildren(const String& name) const
for (auto child : _vChildren)
{
// 不同的名称可能会有相同的 Hash 值,但是先比较 Hash 可以提升搜索速度
if (child->_nHashName == hash && child->_sName == name)
if (child->_nHashName == hash && child->_name == name)
{
vChildren.push_back(child);
}
@ -691,7 +691,7 @@ e2d::Node * e2d::Node::getChild(const String& name) const
for (auto child : _vChildren)
{
// 不同的名称可能会有相同的 Hash 值,但是先比较 Hash 可以提升搜索速度
if (child->_nHashName == hash && child->_sName == name)
if (child->_nHashName == hash && child->_name == name)
{
return child;
}
@ -765,7 +765,7 @@ void e2d::Node::removeChildren(const String& childName)
for (size_t i = 0; i < size; i++)
{
auto child = _vChildren[i];
if (child->_nHashName == hash && child->_sName == childName)
if (child->_nHashName == hash && child->_name == childName)
{
_vChildren.erase(_vChildren.begin() + i);
child->_pParent = nullptr;
@ -789,7 +789,7 @@ void e2d::Node::clearAllChildren()
_vChildren.clear();
}
void e2d::Node::runAction(ActionBase * action)
void e2d::Node::runAction(Action * action)
{
if (this != action->getTarget())
{
@ -838,7 +838,7 @@ void e2d::Node::stopAction(const String& strActionName)
}
}
e2d::ActionBase * e2d::Node::getAction(const String& strActionName)
e2d::Action * e2d::Node::getAction(const String& strActionName)
{
auto actions = ActionManager::get(strActionName);
for (auto action : actions)
@ -851,9 +851,9 @@ e2d::ActionBase * e2d::Node::getAction(const String& strActionName)
return nullptr;
}
std::vector<e2d::ActionBase*> e2d::Node::getActions(const String& strActionName)
std::vector<e2d::Action*> e2d::Node::getActions(const String& strActionName)
{
std::vector<ActionBase*>::iterator iter;
std::vector<Action*>::iterator iter;
auto actions = ActionManager::get(strActionName);
for (iter = actions.begin(); iter != actions.end();)
{
@ -983,7 +983,7 @@ void e2d::Node::setDefaultColliderEnable(bool enable)
s_fDefaultColliderEnabled = enable;
}
void e2d::Node::destroy()
void e2d::Node::onDestroy()
{
ActionManager::__clearAllBindedWith(this);
ColliderManager::__removeCollider(_pCollider);
@ -1017,10 +1017,10 @@ void e2d::Node::setName(const String& name)
{
WARN_IF(name.isEmpty(), "Invalid Node name.");
if (!name.isEmpty() && _sName != name)
if (!name.isEmpty() && _name != name)
{
// 保存节点名
_sName = name;
_name = name;
// 保存节点 Hash 名
_nHashName = name.getHashCode();
}

View File

@ -125,8 +125,8 @@ void e2d::Sprite::onRender()
}
}
void e2d::Sprite::destroy()
void e2d::Sprite::onDestroy()
{
Node::destroy();
Node::onDestroy();
SafeRelease(&_pImage);
}

View File

@ -5,7 +5,7 @@
e2d::TransitionBase::TransitionBase(double duration)
: _bEnd(false)
, _fLast(0)
, _fRateOfProgress(0)
, _delta(0)
, _pPrevScene(nullptr)
, _pNextScene(nullptr)
, _pPrevLayer(nullptr)
@ -13,7 +13,7 @@ e2d::TransitionBase::TransitionBase(double duration)
, _sPrevLayerParam()
, _sNextLayerParam()
{
_fDuration = max(duration, 0);
_duration = max(duration, 0);
}
e2d::TransitionBase::~TransitionBase()
@ -27,7 +27,7 @@ bool e2d::TransitionBase::isDone()
return _bEnd;
}
void e2d::TransitionBase::destroy()
void e2d::TransitionBase::onDestroy()
{
SafeRelease(&_pPrevScene);
SafeRelease(&_pNextScene);
@ -61,13 +61,13 @@ void e2d::TransitionBase::_init(Scene * prev, Scene * next)
void e2d::TransitionBase::_update()
{
// 计算动画进度
if (_fDuration == 0)
if (_duration == 0)
{
_fRateOfProgress = 1;
_delta = 1;
}
else
{
_fRateOfProgress = min((Time::getTotalTime() - _fLast) / _fDuration, 1);
_delta = min((Time::getTotalTime() - _fLast) / _duration, 1);
}
this->_updateCustom();

View File

@ -15,10 +15,10 @@ void e2d::TransitionEmerge::_init(Scene * prev, Scene * next)
void e2d::TransitionEmerge::_updateCustom()
{
_sPrevLayerParam.opacity = float(1 - _fRateOfProgress);
_sNextLayerParam.opacity = float(_fRateOfProgress);
_sPrevLayerParam.opacity = float(1 - _delta);
_sNextLayerParam.opacity = float(_delta);
if (_fRateOfProgress >= 1)
if (_delta >= 1)
{
this->_stop();
}

View File

@ -23,12 +23,12 @@ void e2d::TransitionFade::_init(Scene * prev, Scene * next)
if (_pPrevScene)
{
_bFadeOutTransioning = true;
_fDuration = _fFadeOutDuration;
_duration = _fFadeOutDuration;
}
else
{
_bFadeOutTransioning = false;
_fDuration = _fFadeInDuration;
_duration = _fFadeInDuration;
}
_sPrevLayerParam.opacity = 1;
_sNextLayerParam.opacity = 0;
@ -38,18 +38,18 @@ void e2d::TransitionFade::_updateCustom()
{
if (_bFadeOutTransioning)
{
_sPrevLayerParam.opacity = float(1 - _fRateOfProgress);
if (_fRateOfProgress >= 1)
_sPrevLayerParam.opacity = float(1 - _delta);
if (_delta >= 1)
{
_bFadeOutTransioning = false;
_fDuration = _fFadeInDuration;
_duration = _fFadeInDuration;
_fLast = Time::getTotalTime();
}
}
else
{
_sNextLayerParam.opacity = float(_fRateOfProgress);
if (_fRateOfProgress >= 1)
_sNextLayerParam.opacity = float(_delta);
if (_delta >= 1)
{
this->_stop();
}

View File

@ -42,14 +42,14 @@ void e2d::TransitionMove::_updateCustom()
{
if (_pPrevScene)
{
_pPrevScene->getRoot()->setPos(_Vector * _fRateOfProgress);
_pPrevScene->getRoot()->setPos(_Vector * _delta);
}
if (_pNextScene)
{
_pNextScene->getRoot()->setPos(_NextPos + _Vector * _fRateOfProgress);
_pNextScene->getRoot()->setPos(_NextPos + _Vector * _delta);
}
if (_fRateOfProgress >= 1)
if (_delta >= 1)
{
this->_stop();
}

View File

@ -6,166 +6,24 @@ namespace e2d
class ActionManager;
class ActionBase;
class ActionMoveBy;
class ActionMoveTo;
class ActionScaleBy;
class ActionScaleTo;
class ActionOpacityBy;
class ActionOpacityTo;
class ActionFadeIn;
class ActionFadeOut;
class ActionRotateBy;
class ActionRotateTo;
class ActionTwo;
class ActionDelay;
class ActionLoop;
class ActionFunc;
class ActionSequence;
class Animation;
// 动作生成器
class Action
{
public:
// 创建相对位移动画
static e2d::ActionMoveBy* MoveBy(
double duration, /* 动画持续时长 */
Vector vector /* 位移向量 */
);
// 创建位移动画
static e2d::ActionMoveTo* MoveTo(
double duration, /* 动画持续时长 */
Point pos /* 位移至目标点的坐标 */
);
// 创建相对缩放动画
static e2d::ActionScaleBy* ScaleBy(
double duration, /* 动画持续时长 */
double scale /* 缩放比例变化 */
);
// 创建相对缩放动画
static e2d::ActionScaleBy* ScaleBy(
double duration, /* 动画持续时长 */
double scaleX, /* 横向缩放比例变化 */
double scaleY /* 纵向缩放比例变化 */
);
// 创建缩放动画
static e2d::ActionScaleTo* ScaleTo(
double duration, /* 动画持续时长 */
double scale /* 缩放至目标比例 */
);
// 创建缩放动画
static e2d::ActionScaleTo* ScaleTo(
double duration, /* 动画持续时长 */
double scaleX, /* 横向缩放至目标比例 */
double scaleY /* 纵向缩放至目标比例 */
);
// 创建透明度相对渐变动画
static e2d::ActionOpacityBy* OpacityBy(
double duration, /* 动画持续时长 */
double opacity /* 透明度相对变化值 */
);
// 创建透明度渐变动画
static e2d::ActionOpacityTo* OpacityTo(
double duration, /* 动画持续时长 */
double opacity /* 透明度渐变至目标值 */
);
// 创建淡入动画
static e2d::ActionFadeIn* FadeIn(
double duration /* 动画持续时长 */
);
// 创建淡出动画
static e2d::ActionFadeOut* FadeOut(
double duration /* 动画持续时长 */
);
// 创建相对旋转动画
static e2d::ActionRotateBy* RotateBy(
double duration, /* 动画持续时长 */
double rotation /* 旋转角度变化值 */
);
// 创建旋转动画
static e2d::ActionRotateTo* RotateTo(
double duration, /* 动画持续时长 */
double rotation /* 旋转角度至目标值 */
);
// 创建两个动作的连续动作
static e2d::ActionTwo* Two(
ActionBase * pActionFirst, /* 第一个动作 */
ActionBase * pActionSecond, /* 第二个动作 */
bool bAtSameTime = false /* 同时开始 */
);
// 创建延时动作
static e2d::ActionDelay* Delay(
double duration /* 延迟时长(秒) */
);
// 创建循环动作
static e2d::ActionLoop* Loop(
ActionBase * action, /* 执行循环的动作 */
int times = -1 /* 循环次数 */
);
// 创建执行函数对象的动作
static e2d::ActionFunc* Func(
const Function& func /* 函数对象 */
);
#ifdef HIGHER_THAN_VS2012
// 创建顺序动作
static e2d::ActionSequence* Sequence(
const std::initializer_list<ActionBase*>& vActions /* 动作列表 */
);
// 创建特定帧间隔的帧动画
static e2d::Animation* Animation(
double interval, /* 帧间隔(秒) */
const std::initializer_list<Image*>& vFrames /* 关键帧列表 */
);
#else
// 创建顺序动作
static e2d::ActionSequence* Sequence(
int number, /* 动作数量 */
ActionBase * action1, /* 第一个动作 */
...
);
// 创建特定帧间隔的帧动画
static e2d::Animation* Animation(
double interval, /* 帧间隔(秒) */
int number, /* 帧数量 */
Image * frame, /* 第一帧 */
...
);
#endif
};
class Loop;
class Sequence;
class Spawn;
// 基础动作
class ActionBase :
class Action :
public Object
{
friend ActionManager;
friend ActionTwo;
friend ActionLoop;
friend ActionSequence;
friend Loop;
friend Sequence;
friend Spawn;
public:
ActionBase();
Action();
virtual ~ActionBase();
virtual ~Action();
// 获取动作运行状态
virtual bool isRunning();
@ -188,10 +46,10 @@ public:
);
// 获取动作的拷贝
virtual ActionBase * clone() const = 0;
virtual Action * clone() const = 0;
// 获取动作的倒转
virtual ActionBase * reverse() const;
virtual Action * reverse() const;
// 重置动作
virtual void reset();
@ -200,7 +58,7 @@ public:
virtual Node * getTarget();
// 销毁对象
virtual void destroy() override;
virtual void onDestroy() override;
protected:
// 初始化动作
@ -221,19 +79,18 @@ protected:
);
protected:
String _sName;
bool _bRunning;
bool _bEnding;
bool _bInit;
Node * _pTarget;
Scene * _pParentScene;
String _name;
bool _running;
bool _done;
bool _initialized;
Node * _target;
double _fLast;
};
// 持续动作
class ActionGradual :
public ActionBase
public Action
{
public:
// 创建特定时长的持续动画
@ -249,27 +106,27 @@ protected:
virtual void _update() override;
protected:
double _fDuration;
double _fRateOfProgress;
double _duration;
double _delta;
};
// 相对位移动画
class ActionMoveBy :
class MoveBy :
public ActionGradual
{
public:
// 创建相对位移动画
ActionMoveBy(
MoveBy(
double duration, /* 动画持续时长 */
Vector vector /* 位移向量 */
);
// 获取该动画的拷贝对象
virtual ActionMoveBy * clone() const override;
virtual MoveBy * clone() const override;
// 获取该动画的倒转
virtual ActionMoveBy * reverse() const override;
virtual MoveBy * reverse() const override;
protected:
// 初始化动画
@ -279,57 +136,57 @@ protected:
virtual void _update() override;
protected:
Point _BeginPos;
Vector _MoveVec;
Point _startPos;
Vector _deltaPos;
};
// 位移动画
class ActionMoveTo :
public ActionMoveBy
class MoveTo :
public MoveBy
{
public:
// 创建位移动画
ActionMoveTo(
MoveTo(
double duration, /* 动画持续时长 */
Point pos /* 位移至目标点的坐标 */
);
// 获取该动画的拷贝对象
virtual ActionMoveTo * clone() const override;
virtual MoveTo * clone() const override;
protected:
// 初始化动画
virtual void _init() override;
protected:
Point _EndPos;
Point _endPos;
};
// 相对缩放动画
class ActionScaleBy :
class ScaleBy :
public ActionGradual
{
public:
// 创建相对缩放动画
ActionScaleBy(
ScaleBy(
double duration, /* 动画持续时长 */
double scale /* 缩放比例变化 */
);
// 创建相对缩放动画
ActionScaleBy(
ScaleBy(
double duration, /* 动画持续时长 */
double scaleX, /* 横向缩放比例变化 */
double scaleY /* 纵向缩放比例变化 */
);
// 获取该动画的拷贝对象
virtual ActionScaleBy * clone() const override;
virtual ScaleBy * clone() const override;
// 获取该动画的倒转
virtual ActionScaleBy * reverse() const override;
virtual ScaleBy * reverse() const override;
protected:
// 初始化动画
@ -339,60 +196,60 @@ protected:
virtual void _update() override;
protected:
double _nBeginScaleX;
double _nBeginScaleY;
double _nVariationX;
double _nVariationY;
double _startScaleX;
double _startScaleY;
double _deltaX;
double _deltaY;
};
// 缩放动画
class ActionScaleTo :
public ActionScaleBy
class ScaleTo :
public ScaleBy
{
public:
// 创建缩放动画
ActionScaleTo(
ScaleTo(
double duration, /* 动画持续时长 */
double scale /* 缩放至目标比例 */
);
// 创建缩放动画
ActionScaleTo(
ScaleTo(
double duration, /* 动画持续时长 */
double scaleX, /* 横向缩放至目标比例 */
double scaleY /* 纵向缩放至目标比例 */
);
// 获取该动画的拷贝对象
virtual ActionScaleTo * clone() const override;
virtual ScaleTo * clone() const override;
protected:
// 初始化动画
virtual void _init() override;
protected:
double _nEndScaleX;
double _nEndScaleY;
double _endScaleX;
double _endScaleY;
};
// 透明度相对渐变动画
class ActionOpacityBy :
class OpacityBy :
public ActionGradual
{
public:
// 创建透明度相对渐变动画
ActionOpacityBy(
OpacityBy(
double duration, /* 动画持续时长 */
double opacity /* 透明度相对变化值 */
);
// 获取该动画的拷贝对象
virtual ActionOpacityBy * clone() const override;
virtual OpacityBy * clone() const override;
// 获取该动画的倒转
virtual ActionOpacityBy * reverse() const override;
virtual OpacityBy * reverse() const override;
protected:
// 初始化动画
@ -402,80 +259,80 @@ protected:
virtual void _update() override;
protected:
double _nBeginVal;
double _nVariation;
double _startVal;
double _deltaVal;
};
// 透明度渐变动画
class ActionOpacityTo :
public ActionOpacityBy
class OpacityTo :
public OpacityBy
{
public:
// 创建透明度渐变动画
ActionOpacityTo(
OpacityTo(
double duration, /* 动画持续时长 */
double opacity /* 透明度渐变至目标值 */
);
// 获取该动画的拷贝对象
virtual ActionOpacityTo * clone() const override;
virtual OpacityTo * clone() const override;
protected:
// 初始化动画
virtual void _init() override;
protected:
double _nEndVal;
double _endVal;
};
// 淡入动画
class ActionFadeIn :
public ActionOpacityTo
class FadeIn :
public OpacityTo
{
public:
// 创建淡入动画
ActionFadeIn(
FadeIn(
double duration /* 动画持续时长 */
)
: ActionOpacityTo(duration, 1)
)
: OpacityTo(duration, 1)
{
}
};
// 淡出动画
class ActionFadeOut :
public ActionOpacityTo
class FadeOut :
public OpacityTo
{
public:
// 创建淡出动画
ActionFadeOut(
FadeOut(
double duration /* 动画持续时长 */
)
: ActionOpacityTo(duration, 0)
)
: OpacityTo(duration, 0)
{
}
};
// 相对旋转动作
class ActionRotateBy :
class RotateBy :
public ActionGradual
{
public:
// 创建相对旋转动画
ActionRotateBy(
RotateBy(
double duration, /* 动画持续时长 */
double rotation /* 旋转角度变化值 */
);
// 获取该动画的拷贝对象
virtual ActionRotateBy * clone() const override;
virtual RotateBy * clone() const override;
// 获取该动画的倒转
virtual ActionRotateBy * reverse() const override;
virtual RotateBy * reverse() const override;
protected:
// 初始化动画
@ -485,61 +342,80 @@ protected:
virtual void _update() override;
protected:
double _nBeginVal;
double _nVariation;
double _startVal;
double _deltaVal;
};
// 旋转动作
class ActionRotateTo :
public ActionRotateBy
class RotateTo :
public RotateBy
{
public:
// 创建旋转动画
ActionRotateTo(
RotateTo(
double duration, /* 动画持续时长 */
double rotation /* 旋转角度至目标值 */
);
// 获取该动画的拷贝对象
virtual ActionRotateTo * clone() const override;
virtual RotateTo * clone() const override;
protected:
// 初始化动画
virtual void _init() override;
protected:
double _nEndVal;
double _endVal;
};
// 组合动作
class ActionTwo :
public ActionBase
// 延时动作
class Delay :
public Action
{
public:
// 创建两个动作的连续动作
ActionTwo(
ActionBase * pActionFirst, /* 第一个动作 */
ActionBase * pActionSecond, /* 第二个动作 */
bool bAtSameTime = false /* 同时开始 */
// 创建延时动作
Delay(
double duration /* 延迟时长(秒) */
);
virtual ~ActionTwo();
// 获取该动作的拷贝对象
virtual Delay * clone() const override;
protected:
// 初始化动作
virtual void _init() override;
// 执行动作
virtual void _update() override;
protected:
double _delay;
};
// 循环动作
class Loop :
public Action
{
public:
// 创建循环动作
Loop(
Action * action, /* 执行循环的动作 */
int times = -1 /* 循环次数 */
);
virtual ~Loop();
// 获取该动作的拷贝对象
virtual ActionTwo * clone() const override;
// 获取该动作的倒转
virtual ActionTwo * reverse(
bool actionReverse = true /* 子动作是否倒转 */
) const;
virtual Loop * clone() const override;
// 重置动作
virtual void reset() override;
// 销毁对象
virtual void destroy() override;
virtual void onDestroy() override;
protected:
// 初始化动作
@ -552,68 +428,91 @@ protected:
virtual void _resetTime() override;
protected:
ActionBase* _pFirstAction;
ActionBase* _pSecondAction;
bool _bAtSameTime;
Action * _action;
int _times;
int _totalTimes;
};
// 回调动作
class CallFunc :
public Action
{
public:
// 创建执行函数对象的动作
CallFunc(
const Function& func /* 函数对象 */
);
// 获取该动作的拷贝对象
virtual CallFunc * clone() const override;
protected:
// 初始化动作
virtual void _init() override;
// 执行动作
virtual void _update() override;
protected:
Function _func;
};
// 顺序动作
class ActionSequence :
public ActionBase
class Sequence :
public Action
{
public:
// 创建顺序动作
ActionSequence();
Sequence();
#ifdef HIGHER_THAN_VS2012
// 创建顺序动作
ActionSequence(
const std::initializer_list<ActionBase*>& vActions /* 动作列表 */
Sequence(
const std::initializer_list<Action*>& vActions /* 动作列表 */
);
#else
// 创建顺序动作
ActionSequence(
Sequence(
int number, /* 动作数量 */
ActionBase * action, /* 第一个动作 */
Action * action, /* 第一个动作 */
...
);
#endif
virtual ~ActionSequence();
virtual ~Sequence();
// 在结尾添加动作
void add(
ActionBase * action
Action * action
);
#ifdef HIGHER_THAN_VS2012
// 在结尾添加多个动作
void add(
const std::initializer_list<ActionBase*>& vActions /* 动作列表 */
const std::initializer_list<Action*>& vActions /* 动作列表 */
);
#else
// 在结尾添加多个动作
void add(
int number, /* 动作数量 */
ActionBase * action, /* 第一个动作 */
Action * action, /* 第一个动作 */
...
);
#endif
// 获取该动作的拷贝对象
virtual ActionSequence * clone() const override;
virtual Sequence * clone() const override;
// 获取该动作的倒转
virtual ActionSequence * reverse(
bool actionReverse = true /* 子动作是否倒转 */
) const;
virtual Sequence * reverse() const;
// 重置动作
virtual void reset() override;
// 销毁对象
virtual void destroy() override;
virtual void onDestroy() override;
protected:
// 初始化动作
@ -626,57 +525,65 @@ protected:
virtual void _resetTime() override;
protected:
UINT _nActionIndex;
std::vector<ActionBase*> _vActions;
UINT _currIndex;
std::vector<Action*> _actions;
};
// 延时动作
class ActionDelay :
public ActionBase
// 同步动作
class Spawn :
public Action
{
public:
// 创建延时动作
ActionDelay(
double duration /* 延迟时长(秒) */
// 创建同步动作
Spawn();
#ifdef HIGHER_THAN_VS2012
// 创建同步动作
Spawn(
const std::initializer_list<Action*>& vActions /* 动作列表 */
);
#else
// 创建同步动作
Spawn(
int number, /* 动作数量 */
Action * action, /* 第一个动作 */
...
);
#endif
virtual ~Spawn();
// 在结尾添加动作
void add(
Action * action
);
// 获取该动作的拷贝对象
virtual ActionDelay * clone() const override;
protected:
// 初始化动作
virtual void _init() override;
// 执行动作
virtual void _update() override;
protected:
double _fDelayTime;
};
// 循环动作
class ActionLoop :
public ActionBase
{
public:
// 创建循环动作
ActionLoop(
ActionBase * action, /* 执行循环的动作 */
int times = -1 /* 循环次数 */
#ifdef HIGHER_THAN_VS2012
// 在结尾添加多个动作
void add(
const std::initializer_list<Action*>& vActions /* 动作列表 */
);
virtual ~ActionLoop();
#else
// 在结尾添加多个动作
void add(
int number, /* 动作数量 */
Action * action, /* 第一个动作 */
...
);
#endif
// 获取该动作的拷贝对象
virtual ActionLoop * clone() const override;
virtual Spawn * clone() const override;
// 获取该动作的倒转
virtual Spawn * reverse() const;
// 重置动作
virtual void reset() override;
// 销毁对象
virtual void destroy() override;
virtual void onDestroy() override;
protected:
// 初始化动作
@ -689,15 +596,13 @@ protected:
virtual void _resetTime() override;
protected:
ActionBase * _pAction;
int _nTimes;
int _nTotalTimes;
std::vector<Action*> _actions;
};
// 帧动画
class Animation :
public ActionBase
public Action
{
public:
// 创建帧动画
@ -772,7 +677,7 @@ public:
virtual void reset() override;
// 销毁对象
virtual void destroy() override;
virtual void onDestroy() override;
protected:
// 初始化动作
@ -782,34 +687,9 @@ protected:
virtual void _update() override;
protected:
double _fInterval;
UINT _nFrameIndex;
std::vector<Image*> _vFrames;
};
// 回调动作
class ActionFunc :
public ActionBase
{
public:
// 创建执行函数对象的动作
ActionFunc(
const Function& func /* 函数对象 */
);
// 获取该动作的拷贝对象
virtual ActionFunc * clone() const override;
protected:
// 初始化动作
virtual void _init() override;
// 执行动作
virtual void _update() override;
protected:
Function _Callback;
double _interval;
UINT _frameIndex;
std::vector<Image*> _frames;
};

View File

@ -590,7 +590,7 @@ public:
int getRefCount() const;
// 销毁对象
virtual void destroy() {}
virtual void onDestroy() {}
private:
int _nRefCount;
@ -789,7 +789,7 @@ public:
);
// 销毁对象
virtual void destroy() override;
virtual void onDestroy() override;
protected:
// 渲染场景画面

View File

@ -10,7 +10,7 @@ class Input;
class Renderer;
class Node;
class Timer;
class ActionBase;
class Action;
class Music;
class Collider;
class TransitionBase;
@ -90,12 +90,12 @@ class ActionManager
{
friend Game;
friend Node;
friend ActionBase;
friend Action;
public:
// 执行动作
static void start(
ActionBase * action,
Action * action,
Node * target,
bool paused
);
@ -125,12 +125,12 @@ public:
static void stopAll();
// 获取所有名称相同的动作
static std::vector<ActionBase *> get(
static std::vector<Action *> get(
const String& strActionName
);
// 获取所有动作
static std::vector<ActionBase*> getAll();
static std::vector<Action*> getAll();
private:
// 更新动画状态
@ -138,12 +138,12 @@ private:
// 添加动作
static void __add(
ActionBase * action
Action * action
);
// 删除动作
static void __remove(
ActionBase * action
Action * action
);
// 继续绑定在节点上的所有动作

View File

@ -5,7 +5,7 @@ namespace e2d
{
class ActionBase;
class Action;
class TransitionBase;
class Collider;
class ColliderManager;
@ -366,7 +366,7 @@ public:
// 执行动画
virtual void runAction(
ActionBase * action
Action * action
);
// 继续动画
@ -385,12 +385,12 @@ public:
);
// 获取名称相同的动画
virtual ActionBase * getAction(
virtual Action * getAction(
const String& strActionName
);
// 获取所有名称相同的动画
virtual std::vector<ActionBase*> getActions(
virtual std::vector<Action*> getActions(
const String& strActionName
);
@ -415,7 +415,7 @@ public:
);
// 销毁对象
virtual void destroy() override;
virtual void onDestroy() override;
protected:
// 更新节点
@ -442,7 +442,7 @@ protected:
void _updateOpacity();
protected:
String _sName;
String _name;
unsigned _nHashName;
float _fPosX;
float _fPosY;
@ -548,7 +548,7 @@ public:
virtual void onRender() override;
// 销毁对象
virtual void destroy() override;
virtual void onDestroy() override;
protected:
Image * _pImage;
@ -836,7 +836,7 @@ protected:
bool _bEnable;
bool _bIsSelected;
ButtonState _eBtnState;
Function _Callback;
Function _func;
};

View File

@ -54,7 +54,7 @@ public:
bool isDone();
// 销毁对象
virtual void destroy() override;
virtual void onDestroy() override;
protected:
// 初始化场景动画
@ -81,8 +81,8 @@ protected:
protected:
bool _bEnd;
double _fLast;
double _fDuration;
double _fRateOfProgress;
double _duration;
double _delta;
Size _WindowSize;
Scene * _pPrevScene;
Scene * _pNextScene;

View File

@ -197,22 +197,21 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\core\Action\Action.cpp" />
<ClCompile Include="..\..\core\Action\ActionBase.cpp" />
<ClCompile Include="..\..\core\Action\ActionFunc.cpp" />
<ClCompile Include="..\..\core\Action\ActionDelay.cpp" />
<ClCompile Include="..\..\core\Action\ActionMoveBy.cpp" />
<ClCompile Include="..\..\core\Action\CallFunc.cpp" />
<ClCompile Include="..\..\core\Action\Delay.cpp" />
<ClCompile Include="..\..\core\Action\MoveBy.cpp" />
<ClCompile Include="..\..\core\Action\Animation.cpp" />
<ClCompile Include="..\..\core\Action\ActionMoveTo.cpp" />
<ClCompile Include="..\..\core\Action\ActionLoop.cpp" />
<ClCompile Include="..\..\core\Action\ActionOpacityBy.cpp" />
<ClCompile Include="..\..\core\Action\ActionOpacityTo.cpp" />
<ClCompile Include="..\..\core\Action\ActionRotateBy.cpp" />
<ClCompile Include="..\..\core\Action\ActionRotateTo.cpp" />
<ClCompile Include="..\..\core\Action\ActionScaleBy.cpp" />
<ClCompile Include="..\..\core\Action\ActionScaleTo.cpp" />
<ClCompile Include="..\..\core\Action\ActionSequence.cpp" />
<ClCompile Include="..\..\core\Action\ActionTwo.cpp" />
<ClCompile Include="..\..\core\Action\MoveTo.cpp" />
<ClCompile Include="..\..\core\Action\Loop.cpp" />
<ClCompile Include="..\..\core\Action\OpacityBy.cpp" />
<ClCompile Include="..\..\core\Action\OpacityTo.cpp" />
<ClCompile Include="..\..\core\Action\RotateBy.cpp" />
<ClCompile Include="..\..\core\Action\RotateTo.cpp" />
<ClCompile Include="..\..\core\Action\ScaleBy.cpp" />
<ClCompile Include="..\..\core\Action\ScaleTo.cpp" />
<ClCompile Include="..\..\core\Action\Sequence.cpp" />
<ClCompile Include="..\..\core\Action\ActionGradual.cpp" />
<ClCompile Include="..\..\core\Action\Spawn.cpp" />
<ClCompile Include="..\..\core\Base\Game.cpp" />
<ClCompile Include="..\..\core\Base\Input.cpp" />
<ClCompile Include="..\..\core\Base\Renderer.cpp" />

View File

@ -36,45 +36,9 @@
<ClCompile Include="..\..\core\Base\Input.cpp">
<Filter>Base</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionDelay.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionGradual.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionLoop.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionMoveBy.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionMoveTo.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionOpacityBy.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionOpacityTo.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionRotateBy.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionRotateTo.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionScaleBy.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionScaleTo.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionSequence.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionTwo.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\Animation.cpp">
<Filter>Action</Filter>
</ClCompile>
@ -162,9 +126,6 @@
<ClCompile Include="..\..\core\Manager\InputManager.cpp">
<Filter>Manager</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionFunc.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Collider\Collider.cpp">
<Filter>Collider</Filter>
</ClCompile>
@ -207,18 +168,54 @@
<ClCompile Include="..\..\core\Common\Function.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ActionBase.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\Action.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Transition\TransitionBase.cpp">
<Filter>Transition</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Transition\Transition.cpp">
<Filter>Transition</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\Action.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\Sequence.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ScaleTo.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\ScaleBy.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\RotateTo.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\RotateBy.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\OpacityTo.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\OpacityBy.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\MoveTo.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\MoveBy.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\Loop.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\CallFunc.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\Delay.cpp">
<Filter>Action</Filter>
</ClCompile>
<ClCompile Include="..\..\core\Action\Spawn.cpp">
<Filter>Action</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\core\easy2d.h" />