Explorar el Código

fix clipping issue (#966)

* modify for clip

* fix clipping issue
zzya hace 8 años
padre
commit
5947520c9b
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      spine-cocos2dx/src/spine/SkeletonRenderer.cpp

+ 5 - 1
spine-cocos2dx/src/spine/SkeletonRenderer.cpp

@@ -199,7 +199,10 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t
 	TwoColorTrianglesCommand* lastTwoColorTrianglesCommand = nullptr;
 	for (int i = 0, n = _skeleton->slotsCount; i < n; ++i) {
 		spSlot* slot = _skeleton->drawOrder[i];
-		if (!slot->attachment) continue;
+		if (!slot->attachment) {
+			spSkeletonClipping_clipEnd(_clipper, slot);
+			continue;
+		}
 		
 		cocos2d::TrianglesCommand::Triangles triangles;
 		TwoColorTriangles trianglesTwoColor;
@@ -268,6 +271,7 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t
 			spSkeletonClipping_clipStart(_clipper, slot, clip);
 		}
 		default:
+			spSkeletonClipping_clipEnd(_clipper, slot);
 			continue;
 		}