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

This commit is contained in:
Mario Zechner 2024-04-16 13:48:19 +02:00
parent dca79e4731
commit cbf150b653
4 changed files with 406 additions and 350 deletions

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -756,7 +756,7 @@ static spAnimation *_spSkeletonJson_readAnimation(spSkeletonJson *self, Json *ro
continue;
}
spCurveTimeline1 *timeline = NULL;
spPhysicsConstraintTimeline *timeline = NULL;
if (strcmp(timelineName, "inertia") == 0) {
timeline = spPhysicsConstraintTimeline_create(frames, frames, index, SP_TIMELINE_PHYSICSCONSTRAINT_INERTIA);
} else if (strcmp(timelineName, "strength") == 0) {
@ -774,7 +774,7 @@ static spAnimation *_spSkeletonJson_readAnimation(spSkeletonJson *self, Json *ro
} else {
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");
if (entry) {
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)
mesh->edges[ii] = entry->valueInt;
mesh->edges[ii] = (unsigned short)entry->valueInt;
}
spAttachmentLoader_configureAttachment(self->attachmentLoader, attachment);

View File

@ -99,9 +99,9 @@ void testcase(void func(spSkeletonData *skeletonData, spAtlas *atlas),
func(skeletonData, atlas);
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);