Skip to content

Commit

Permalink
Merge branch 'v3.7.1' of https://github.com/cocos2d/cocos2d-x into v3
Browse files Browse the repository at this point in the history
# Conflicts:
#	web
  • Loading branch information
pandamicro committed Aug 3, 2015
2 parents 7802e40 + 6d3a00a commit 25cb0d2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 29 deletions.
30 changes: 15 additions & 15 deletions cocos/editor-support/cocostudio/ActionTimeline/CCBoneNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,24 @@ void BoneNode::removeChild(Node* child, bool cleanup /* = true */)

void BoneNode::removeFromBoneList(BoneNode* bone)
{
_childBones.eraseObject(bone);
auto skeletonNode = dynamic_cast<SkeletonNode*>(bone);
if (skeletonNode != nullptr) // nested skeleton
return;

bone->_rootSkeleton = nullptr;
auto subBones = bone->getAllSubBones();
subBones.pushBack(bone);
for (auto &subBone : subBones)
if (skeletonNode == nullptr) //not a nested skeleton
{
subBone->_rootSkeleton = nullptr;
_rootSkeleton->_subBonesMap.erase(subBone->getName());
if (bone->_isRackShow && bone->_visible)
bone->_rootSkeleton = nullptr;
auto subBones = bone->getAllSubBones();
subBones.pushBack(bone);
for (auto &subBone : subBones)
{
_rootSkeleton->_subDrawBonesDirty = true;
_rootSkeleton->_subDrawBonesOrderDirty = true;
subBone->_rootSkeleton = nullptr;
_rootSkeleton->_subBonesMap.erase(subBone->getName());
if (bone->_isRackShow && bone->_visible)
{
_rootSkeleton->_subDrawBonesDirty = true;
_rootSkeleton->_subDrawBonesOrderDirty = true;
}
}
}
_childBones.eraseObject(bone);
}

void BoneNode::addToBoneList(BoneNode* bone)
Expand Down Expand Up @@ -375,8 +375,8 @@ void BoneNode::onDraw(const cocos2d::Mat4 &transform, uint32_t flags)
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);

#ifdef CC_STUDIO_ENABLED_VIEW
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _noMVPVertices);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, _squareColors);
glVertexAttribPointer(cocos2d::GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _noMVPVertices);
glVertexAttribPointer(cocos2d::GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, _squareColors);

glEnable(GL_LINE_SMOOTH);
glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
Expand Down
11 changes: 0 additions & 11 deletions cocos/editor-support/cocostudio/ActionTimeline/CCSkeletonNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,20 +270,9 @@ void SkeletonNode::onDraw(const cocos2d::Mat4 &transform, uint32_t flags)

cocos2d::GL::enableVertexAttribs(cocos2d::GL::VERTEX_ATTRIB_FLAG_POSITION | cocos2d::GL::VERTEX_ATTRIB_FLAG_COLOR);

//
// Attributes
//
#ifdef EMSCRIPTEN
setGLBufferData(_noMVPVertices, 8 * sizeof(Vec3), 0);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, 0);

setGLBufferData(_squareColors, 8 * sizeof(Color4F), 1);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, 0);
#else
glBindBuffer(GL_ARRAY_BUFFER, 0);
glVertexAttribPointer(cocos2d::GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _noMVPVertices);
glVertexAttribPointer(cocos2d::GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, _squareColors);
#endif // EMSCRIPTEN

cocos2d::GL::blendFunc(_blendFunc.src, _blendFunc.dst);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ namespace cocostudio
node->setScaleZ(scale->z());
}

node->setCameraMask(cameraMask, false);
node->setCameraMask(cameraMask, true);

auto nodeReader = NodeReader::getInstance();
nodeReader->setPropsWithFlatBuffers(node, (Table*)(options->nodeOptions()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,6 @@ void TestActionTimelineSkeleton::onEnter()
{
nestSkeleton->removeFromParentAndCleanup(false);
}
// bug fixed while leftleg's child hide with leftleg's visible
});
}

Expand Down

0 comments on commit 25cb0d2

Please sign in to comment.