Merge pull request #15723 from urokuta/issue-9367

#9367 blend mode does not work with animated sprite
This commit is contained in:
minggo 2016-05-30 10:53:15 +08:00
commit 3521e605f8
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() )