diff --git a/spine-cocos2dx/example/Classes/SpineboyExample.cpp b/spine-cocos2dx/example/Classes/SpineboyExample.cpp index b3554516c..42b3d0e90 100644 --- a/spine-cocos2dx/example/Classes/SpineboyExample.cpp +++ b/spine-cocos2dx/example/Classes/SpineboyExample.cpp @@ -29,7 +29,7 @@ *****************************************************************************/ #include "SpineboyExample.h" -#include "GoblinsExample.h" +#include "SkeletonRendererSeparatorExample.h" USING_NS_CC; using namespace spine; @@ -89,7 +89,7 @@ bool SpineboyExample::init () { else if (skeletonNode->getTimeScale() == 1) skeletonNode->setTimeScale(0.3f); else - Director::getInstance()->replaceScene(GoblinsExample::scene()); + Director::getInstance()->replaceScene(SkeletonRendererSeparatorExample::scene()); return true; }; _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); diff --git a/spine-cocos2dx/src/spine/SkeletonRenderer.cpp b/spine-cocos2dx/src/spine/SkeletonRenderer.cpp index 6351dea5f..2f95c8d83 100644 --- a/spine-cocos2dx/src/spine/SkeletonRenderer.cpp +++ b/spine-cocos2dx/src/spine/SkeletonRenderer.cpp @@ -266,11 +266,11 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t bool isTwoColorTint = this->isTwoColorTint(); // Early exit if the skeleton is invisible - if (getDisplayedOpacity() == 0 || _skeleton->color.a == 0){ + if (getDisplayedOpacity() == 0 || _skeleton->getColor().a == 0){ return; } - if (_effect) _effect->begin(_effect, _skeleton); + if (_effect) _effect->begin(*_skeleton); Color4F nodeColor; nodeColor.r = getDisplayedColor().r / (float)255; @@ -306,8 +306,8 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t } // Early exit if slot is invisible - if (slot->color.a == 0) { - spSkeletonClipping_clipEnd(_clipper, slot); + if (slot->getColor().a == 0) { + _clipper->clipEnd(*slot); continue; } @@ -319,8 +319,8 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t attachmentVertices = (AttachmentVertices*)attachment->getRendererObject(); // Early exit if attachment is invisible - if (attachment->color.a == 0) { - spSkeletonClipping_clipEnd(_clipper, slot); + if (attachment->getColor().a == 0) { + _clipper->clipEnd(*slot); continue; } @@ -352,8 +352,8 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t attachmentVertices = (AttachmentVertices*)attachment->getRendererObject(); // Early exit if attachment is invisible - if (attachment->color.a == 0) { - spSkeletonClipping_clipEnd(_clipper, slot); + if (attachment->getColor().a == 0) { + _clipper->clipEnd(*slot); continue; } diff --git a/spine-sfml/cpp/src/spine/spine-sfml.cpp b/spine-sfml/cpp/src/spine/spine-sfml.cpp index 60998cf0a..e3ee1ffed 100644 --- a/spine-sfml/cpp/src/spine/spine-sfml.cpp +++ b/spine-sfml/cpp/src/spine/spine-sfml.cpp @@ -91,7 +91,7 @@ void SkeletonDrawable::draw(RenderTarget &target, RenderStates states) const { vertexArray->clear(); states.texture = NULL; - // Early out if the skeleton alpha is 0 + // Early out if skeleton is invisible if (skeleton->getColor().a == 0) return; if (vertexEffect != NULL) vertexEffect->begin(*skeleton); @@ -120,7 +120,7 @@ void SkeletonDrawable::draw(RenderTarget &target, RenderStates states) const { RegionAttachment *regionAttachment = (RegionAttachment *) attachment; attachmentColor = ®ionAttachment->getColor(); - // Early out if the attachment color is 0 + // Early out if the slot color is 0 if (attachmentColor->a == 0) { clipper.clipEnd(slot); continue; @@ -132,13 +132,13 @@ void SkeletonDrawable::draw(RenderTarget &target, RenderStates states) const { uvs = ®ionAttachment->getUVs(); indices = &quadIndices; indicesCount = 6; - texture = (Texture *) ((AtlasRegion *) regionAttachment->getRendererObject())->page->rendererObject; + texture = (Texture *) ((AtlasRegion *) regionAttachment->getRendererObject())->page->getRendererObject(); } else if (attachment->getRTTI().isExactly(MeshAttachment::rtti)) { MeshAttachment *mesh = (MeshAttachment *) attachment; attachmentColor = &mesh->getColor(); - // Early out if the attachment color is 0 + // Early out if the slot color is 0 if (attachmentColor->a == 0) { clipper.clipEnd(slot); continue; @@ -151,6 +151,7 @@ void SkeletonDrawable::draw(RenderTarget &target, RenderStates states) const { uvs = &mesh->getUVs(); indices = &mesh->getTriangles(); indicesCount = mesh->getTriangles().size(); + } else if (attachment->getRTTI().isExactly(ClippingAttachment::rtti)) { ClippingAttachment *clip = (ClippingAttachment *) slot.getAttachment(); clipper.clipStart(slot, clip); @@ -304,4 +305,4 @@ void SFMLTextureLoader::unload(void *texture) { SpineExtension *getDefaultExtension() { return new DefaultSpineExtension(); } -} +} \ No newline at end of file