瀏覽代碼

[c] More 4.2 porting, SkeletonBinary, untested, probably broken

Mario Zechner 1 年之前
父節點
當前提交
cbf150b653

+ 1 - 1
spine-c/spine-c/include/spine/MeshAttachment.h

@@ -65,7 +65,7 @@ struct spMeshAttachment {
 
 
 	/* Nonessential. */
 	/* Nonessential. */
 	int edgesCount;
 	int edgesCount;
-	int *edges;
+	unsigned short *edges;
 	float width, height;
 	float width, height;
 };
 };
 
 

File diff suppressed because it is too large
+ 360 - 340
spine-c/spine-c/src/spine/SkeletonBinary.c


+ 4 - 4
spine-c/spine-c/src/spine/SkeletonJson.c

@@ -756,7 +756,7 @@ static spAnimation *_spSkeletonJson_readAnimation(spSkeletonJson *self, Json *ro
                 continue;
                 continue;
             }
             }
 
 
-            spCurveTimeline1 *timeline = NULL;
+            spPhysicsConstraintTimeline *timeline = NULL;
             if (strcmp(timelineName, "inertia") == 0) {
             if (strcmp(timelineName, "inertia") == 0) {
                 timeline = spPhysicsConstraintTimeline_create(frames, frames, index, SP_TIMELINE_PHYSICSCONSTRAINT_INERTIA);
                 timeline = spPhysicsConstraintTimeline_create(frames, frames, index, SP_TIMELINE_PHYSICSCONSTRAINT_INERTIA);
             } else if (strcmp(timelineName, "strength") == 0) {
             } else if (strcmp(timelineName, "strength") == 0) {
@@ -774,7 +774,7 @@ static spAnimation *_spSkeletonJson_readAnimation(spSkeletonJson *self, Json *ro
             } else {
             } else {
                 continue;
                 continue;
             }
             }
-            spTimelineArray_add(timelines, readTimeline(keyMap, timeline, 0, 1));
+            spTimelineArray_add(timelines, readTimeline(keyMap, SUPER(timeline), 0, 1));
         }
         }
     }
     }
 
 
@@ -1659,9 +1659,9 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
 									entry = Json_getItem(attachmentMap, "edges");
 									entry = Json_getItem(attachmentMap, "edges");
 									if (entry) {
 									if (entry) {
 										mesh->edgesCount = entry->size;
 										mesh->edgesCount = entry->size;
-										mesh->edges = MALLOC(int, entry->size);
+										mesh->edges = MALLOC(unsigned short, entry->size);
 										for (entry = entry->child, ii = 0; entry; entry = entry->next, ++ii)
 										for (entry = entry->child, ii = 0; entry; entry = entry->next, ++ii)
-											mesh->edges[ii] = entry->valueInt;
+											mesh->edges[ii] = (unsigned short)entry->valueInt;
 									}
 									}
 
 
 									spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);
 									spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);

+ 3 - 3
spine-sfml/c/example/main.cpp

@@ -99,9 +99,9 @@ void testcase(void func(spSkeletonData *skeletonData, spAtlas *atlas),
 	func(skeletonData, atlas);
 	func(skeletonData, atlas);
 	spSkeletonData_dispose(skeletonData);
 	spSkeletonData_dispose(skeletonData);
 
 
-	// skeletonData = readSkeletonBinaryData(binaryName, atlas, scale);
-	// func(skeletonData, atlas);
-	// spSkeletonData_dispose(skeletonData);
+	skeletonData = readSkeletonBinaryData(binaryName, atlas, scale);
+	func(skeletonData, atlas);
+	spSkeletonData_dispose(skeletonData);
 
 
 	spAtlas_dispose(atlas);
 	spAtlas_dispose(atlas);
 
 

Some files were not shown because too many files changed in this diff