From 7fc9d1a26a4efa11a7f3ffec2fedb74637f78c76 Mon Sep 17 00:00:00 2001 From: badlogic Date: Thu, 24 Nov 2016 15:01:23 +0100 Subject: [PATCH] [c] fixed bug in spAnimationState_addPropertyID, didn't keep track of #properties. Closes #774 --- spine-c/src/spine/AnimationState.c | 1 + spine-cocos2dx/example/Classes/SpineboyExample.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spine-c/src/spine/AnimationState.c b/spine-c/src/spine/AnimationState.c index f8b9bc95b..0df584f1d 100644 --- a/spine-c/src/spine/AnimationState.c +++ b/spine-c/src/spine/AnimationState.c @@ -786,6 +786,7 @@ int _spAnimationState_addPropertyID(spAnimationState* self, int id) { _spAnimationState_ensureCapacityPropertyIDs(self, internal->propertyIDsCount + 1); internal->propertyIDs[internal->propertyIDsCount] = id; + internal->propertyIDsCount++; return 1; } diff --git a/spine-cocos2dx/example/Classes/SpineboyExample.cpp b/spine-cocos2dx/example/Classes/SpineboyExample.cpp index 3da192c40..f5772c9c4 100644 --- a/spine-cocos2dx/example/Classes/SpineboyExample.cpp +++ b/spine-cocos2dx/example/Classes/SpineboyExample.cpp @@ -67,8 +67,8 @@ bool SpineboyExample::init () { skeletonNode->setMix("walk", "jump", 0.4); skeletonNode->setMix("jump", "run", 0.4); skeletonNode->setAnimation(0, "walk", true); - spTrackEntry* jumpEntry = skeletonNode->addAnimation(0, "jump", false, 3); - skeletonNode->addAnimation(0, "run", true); + spTrackEntry* jumpEntry = skeletonNode->addAnimation(0, "jump", false, 1); + skeletonNode->addAnimation(0, "run", true); skeletonNode->setTrackStartListener(jumpEntry, [] (spTrackEntry* entry) { log("jumped!");