#9367 blend mode does not work with animated sprite

This commit is contained in:
urokuta 2016-05-26 09:34:18 +09:00
parent 4e92b82571
commit 785d02a818
1 changed files with 4 additions and 0 deletions

View File

@ -2501,7 +2501,9 @@ void Animate::stop()
{
if (_animation->getRestoreOriginalFrame() && _target)
{
auto blend = static_cast<Sprite*>(_target)->getBlendFunc();
static_cast<Sprite*>(_target)->setSpriteFrame(_origFrame);
static_cast<Sprite*>(_target)->setBlendFunc(blend);
}
ActionInterval::stop();
@ -2536,10 +2538,12 @@ void Animate::update(float t)
if( splitTime <= t )
{
auto blend = static_cast<Sprite*>(_target)->getBlendFunc();
_currFrameIndex = i;
AnimationFrame* frame = frames.at(_currFrameIndex);
frameToDisplay = frame->getSpriteFrame();
static_cast<Sprite*>(_target)->setSpriteFrame(frameToDisplay);
static_cast<Sprite*>(_target)->setBlendFunc(blend);
const ValueMap& dict = frame->getUserInfo();
if ( !dict.empty() )