mirror of https://github.com/axmolengine/axmol.git
Merge pull request #13383 from geron-cn/3.7.1
add blendfunc cascade to its skin in BoneNode
This commit is contained in:
commit
d0580f09e8
|
@ -182,6 +182,11 @@ void BoneNode::addToBoneList(BoneNode* bone)
|
||||||
void BoneNode::addToSkinList(SkinNode* skin)
|
void BoneNode::addToSkinList(SkinNode* skin)
|
||||||
{
|
{
|
||||||
_boneSkins.pushBack(skin);
|
_boneSkins.pushBack(skin);
|
||||||
|
auto blendSkin = dynamic_cast<BlendProtocol*>(skin);
|
||||||
|
if (nullptr != blendSkin && _blendFunc != blendSkin->getBlendFunc())
|
||||||
|
{
|
||||||
|
blendSkin->setBlendFunc(_blendFunc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoneNode::removeFromSkinList(SkinNode* skin)
|
void BoneNode::removeFromSkinList(SkinNode* skin)
|
||||||
|
@ -281,7 +286,18 @@ cocos2d::Rect BoneNode::getVisibleSkinsRect() const
|
||||||
|
|
||||||
void BoneNode::setBlendFunc(const cocos2d::BlendFunc& blendFunc)
|
void BoneNode::setBlendFunc(const cocos2d::BlendFunc& blendFunc)
|
||||||
{
|
{
|
||||||
|
if (_blendFunc != blendFunc)
|
||||||
|
{
|
||||||
_blendFunc = blendFunc;
|
_blendFunc = blendFunc;
|
||||||
|
for (auto & skin : _boneSkins)
|
||||||
|
{
|
||||||
|
auto blendSkin = dynamic_cast<BlendProtocol*>(skin);
|
||||||
|
if (nullptr != blendSkin)
|
||||||
|
{
|
||||||
|
blendSkin->setBlendFunc(_blendFunc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoneNode::setDebugDrawLength(float length)
|
void BoneNode::setDebugDrawLength(float length)
|
||||||
|
|
Loading…
Reference in New Issue