mirror of https://github.com/axmolengine/axmol.git
fix add display
This commit is contained in:
parent
dfc40d354e
commit
2d3df69982
|
@ -265,18 +265,12 @@ void Armature::addBone(Bone *bone, const char *parentName)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (_parentBone)
|
||||
_parentBone->addChildBone(bone);
|
||||
else
|
||||
_topBoneList->addObject(bone);
|
||||
_topBoneList->addObject(bone);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_parentBone)
|
||||
_parentBone->addChildBone(bone);
|
||||
else
|
||||
_topBoneList->addObject(bone);
|
||||
_topBoneList->addObject(bone);
|
||||
}
|
||||
|
||||
bone->setArmature(this);
|
||||
|
@ -527,6 +521,7 @@ void Armature::draw()
|
|||
}
|
||||
}
|
||||
armature->draw();
|
||||
_atlas = armature->getTextureAtlas();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -167,6 +167,12 @@ void Bone::update(float delta)
|
|||
if (_parentBone)
|
||||
_boneTransformDirty = _boneTransformDirty || _parentBone->isTransformDirty();
|
||||
|
||||
CCBone *armatureParentBone = _armature->getParentBone();
|
||||
if (armatureParentBone && !_boneTransformDirty)
|
||||
{
|
||||
_boneTransformDirty = armatureParentBone->isTransformDirty();
|
||||
}
|
||||
|
||||
if (_boneTransformDirty)
|
||||
{
|
||||
if (_armature->getArmatureData()->dataVersion >= VERSION_COMBINED)
|
||||
|
@ -184,6 +190,13 @@ void Bone::update(float delta)
|
|||
{
|
||||
_worldTransform = AffineTransformConcat(_worldTransform, _parentBone->_worldTransform);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (armatureParentBone)
|
||||
{
|
||||
_worldTransform = CCAffineTransformConcat(_worldTransform, armatureParentBone->getNodeToArmatureTransform());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DisplayFactory::updateDisplay(this, _displayManager->getCurrentDecorativeDisplay(), delta, _boneTransformDirty || _armature->getArmatureTransformDirty());
|
||||
|
|
|
@ -137,6 +137,7 @@ void DisplayManager::addDisplay(Node *display, int index)
|
|||
if (SpriteDisplayData *spriteDisplayData = (SpriteDisplayData *)decoDisplay->getDisplayData())
|
||||
{
|
||||
skin->setSkinData(spriteDisplayData->skinData);
|
||||
((CCSpriteDisplayData *)displayData)->skinData = spriteDisplayData->skinData;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -120,6 +120,7 @@ void Skin::setSkinData(const BaseData &var)
|
|||
setPosition(Point(_skinData.x, _skinData.y));
|
||||
|
||||
_skinTransform = getNodeToParentTransform();
|
||||
updateArmatureTransform();
|
||||
}
|
||||
|
||||
const BaseData &Skin::getSkinData() const
|
||||
|
|
Loading…
Reference in New Issue