So i pulled the runtimes from git, and imported the spine-c and spine-sfml files into a new project to get it working before i put it into my main project. I get the same error if i try using the spineboy() or goblins() methods, where it gives me the error:
Thread 1: EXC_BAD_ACCESS(code = 1, address = 0x38)
on this line in SkeletonData.c:
Animation* SkeletonData_findAnimation (const SkeletonData* self, const char* animationName) {
int i;
for (i = 0; i < self->animationCount; ++i)
if (strcmp(self->animations->name, animationName) == 0) return self->animations;
return 0;
}
called from here:
Atlas* atlas = Atlas_readAtlasFile("../data/goblins.atlas");
SkeletonJson* json = SkeletonJson_create(atlas);
json->scale = 2;
SkeletonData skeletonData = SkeletonJson_readSkeletonDataFile(json, "../data/goblins.json");
Animation walkAnimation = SkeletonData_findAnimation(skeletonData, "walk");
SkeletonJson_dispose(json);
SkeletonDrawable* drawable = new SkeletonDrawable(skeletonData);
drawable->timeScale = 1;
Skeleton* skeleton = drawable->skeleton;
skeleton->flipX = false;
skeleton->flipY = false;
Skeleton_setSkinByName(skeleton, "goblin");
Skeleton_setSlotsToSetupPose(skeleton);
// Skeleton_setAttachment(skeleton, "left hand item", "dagger");
skeleton->root->x = 320;
skeleton->root->y = 590;
Skeleton_updateWorldTransform(skeleton);
AnimationState_setAnimation(drawable->state, walkAnimation, true);
I believe that particular error is related to the pointer going out of scope, but what I posted above is all the Spine code the program is running through before it quits, so I'm really not sure how to approach this. I confirmed the json has the appropriate animation name and I believe it loads correctly, so I'm just really confused right now. Thanks for any help!
Robert