Browse Source

Updated cocos2d-x v2 to latest spine-c.

NathanSweet 9 năm trước cách đây
mục cha
commit
fe55f6feee

+ 1 - 1
spine-cocos2dx/2/src/spine/PolygonBatch.cpp

@@ -67,7 +67,7 @@ PolygonBatch::~PolygonBatch () {
 
 void PolygonBatch::add (CCTexture2D* addTexture,
 		const float* addVertices, const float* uvs, int addVerticesCount,
-		const int* addTriangles, int addTrianglesCount,
+		const unsigned short* addTriangles, int addTrianglesCount,
 		ccColor4B* color) {
 
 	if (

+ 1 - 1
spine-cocos2dx/2/src/spine/PolygonBatch.h

@@ -50,7 +50,7 @@ public:
 	bool initWithCapacity (int capacity);
 	void add (cocos2d::CCTexture2D* texture,
 		const float* vertices, const float* uvs, int verticesCount,
-		const int* triangles, int trianglesCount,
+		const unsigned short* triangles, int trianglesCount,
 		cocos2d::ccColor4B* color);
 	void flush ();
 

+ 2 - 2
spine-cocos2dx/2/src/spine/SkeletonRenderer.cpp

@@ -41,7 +41,7 @@ using std::max;
 
 namespace spine {
 
-static const int quadTriangles[6] = {0, 1, 2, 2, 3, 0};
+static const unsigned short quadTriangles[6] = {0, 1, 2, 2, 3, 0};
 
 SkeletonRenderer* SkeletonRenderer::createWithData (spSkeletonData* skeletonData, bool ownsSkeletonData) {
 	SkeletonRenderer* node = new SkeletonRenderer(skeletonData, ownsSkeletonData);
@@ -148,7 +148,7 @@ void SkeletonRenderer::draw () {
 	ccColor4B color;
 	const float* uvs = nullptr;
 	int verticesCount = 0;
-	const int* triangles = nullptr;
+	const unsigned short* triangles = nullptr;
 	int trianglesCount = 0;
 	float r = 0, g = 0, b = 0, a = 0;
 	for (int i = 0, n = skeleton->slotsCount; i < n; i++) {