Procházet zdrojové kódy

[c] fixed bug in spAnimationState_addPropertyID, didn't keep track of #properties. Closes #774

badlogic před 8 roky
rodič
revize
7fc9d1a26a

+ 1 - 0
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;
 }
 

+ 2 - 2
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!");