diff --git a/spine-c/spine-c/include/spine/EventData.h b/spine-c/spine-c/include/spine/EventData.h index 70b955071..885f117cb 100644 --- a/spine-c/spine-c/include/spine/EventData.h +++ b/spine-c/spine-c/include/spine/EventData.h @@ -42,13 +42,15 @@ typedef struct spEventData { int intValue; float floatValue; const char* stringValue; + const char* audioPath; #ifdef __cplusplus spEventData() : name(0), intValue(0), floatValue(0), - stringValue(0) { + stringValue(0), + audioPath(0) { } #endif } spEventData; diff --git a/spine-c/spine-c/src/spine/EventData.c b/spine-c/spine-c/src/spine/EventData.c index 8b0014f78..9e564dc0b 100644 --- a/spine-c/spine-c/src/spine/EventData.c +++ b/spine-c/spine-c/src/spine/EventData.c @@ -38,6 +38,7 @@ spEventData* spEventData_create (const char* name) { } void spEventData_dispose (spEventData* self) { + FREE(self->audioPath); FREE(self->stringValue); FREE(self->name); FREE(self); diff --git a/spine-c/spine-c/src/spine/SkeletonBinary.c b/spine-c/spine-c/src/spine/SkeletonBinary.c index d4e06bc25..44db5455f 100644 --- a/spine-c/spine-c/src/spine/SkeletonBinary.c +++ b/spine-c/spine-c/src/spine/SkeletonBinary.c @@ -885,6 +885,7 @@ spSkeletonData* spSkeletonBinary_readSkeletonData (spSkeletonBinary* self, const /* Skip images path & fps */ readFloat(input); FREE(readString(input)); + FREE(readString(input)); } /* Bones. */ @@ -1072,6 +1073,7 @@ spSkeletonData* spSkeletonBinary_readSkeletonData (spSkeletonBinary* self, const eventData->intValue = readVarint(input, 0); eventData->floatValue = readFloat(input); eventData->stringValue = readString(input); + eventData->audioPath = readString(input); skeletonData->events[i] = eventData; } diff --git a/spine-sfml/example/main.cpp b/spine-sfml/example/main.cpp index ac06d58d0..66d2d9457 100644 --- a/spine-sfml/example/main.cpp +++ b/spine-sfml/example/main.cpp @@ -124,7 +124,7 @@ void spineboy (SkeletonData* skeletonData, Atlas* atlas) { Skeleton_setToSetupPose(skeleton); skeleton->x = 320; - skeleton->y = 460; + skeleton->y = 590; Skeleton_updateWorldTransform(skeleton); Slot* headSlot = Skeleton_findSlot(skeleton, "head"); @@ -134,7 +134,7 @@ void spineboy (SkeletonData* skeletonData, Atlas* atlas) { AnimationState_addAnimationByName(drawable->state, 0, "jump", false, 3); AnimationState_addAnimationByName(drawable->state, 0, "run", true, 0); - sf::RenderWindow window(sf::VideoMode(640, 480), "Spine SFML - spineboy"); + sf::RenderWindow window(sf::VideoMode(640, 640), "Spine SFML - spineboy"); window.setFramerateLimit(60); sf::Event event; sf::Clock deltaClock;