浏览代码

[cocos2dx] Add missing new AnimationState methods. Closes #807

badlogic 8 年之前
父节点
当前提交
b9ee3bfc5d
共有 2 个文件被更改,包括 15 次插入0 次删除
  1. 12 0
      spine-cocos2dx/src/spine/SkeletonAnimation.cpp
  2. 3 0
      spine-cocos2dx/src/spine/SkeletonAnimation.h

+ 12 - 0
spine-cocos2dx/src/spine/SkeletonAnimation.cpp

@@ -170,6 +170,18 @@ spTrackEntry* SkeletonAnimation::addAnimation (int trackIndex, const std::string
 	return spAnimationState_addAnimation(_state, trackIndex, animation, loop, delay);
 }
 	
+spTrackEntry* SkeletonAnimation::setEmptyAnimation (int trackIndex, float mixDuration) {
+	return spAnimationState_setEmptyAnimation(_state, trackIndex, mixDuration);
+}
+
+void SkeletonAnimation::setEmptyAnimations (float mixDuration) {
+	spAnimationState_setEmptyAnimations(_state, mixDuration);
+}
+
+spTrackEntry* SkeletonAnimation::addEmptyAnimation (int trackIndex, float mixDuration, float delay) {
+	return spAnimationState_addEmptyAnimation(_state, trackIndex, mixDuration, delay);
+}
+
 spAnimation* SkeletonAnimation::findAnimation(const std::string& name) const {
 	return spSkeletonData_findAnimation(_skeleton->data, name.c_str());
 }

+ 3 - 0
spine-cocos2dx/src/spine/SkeletonAnimation.h

@@ -73,6 +73,9 @@ public:
 
 	spTrackEntry* setAnimation (int trackIndex, const std::string& name, bool loop);
 	spTrackEntry* addAnimation (int trackIndex, const std::string& name, bool loop, float delay = 0);
+	spTrackEntry* setEmptyAnimation (int trackIndex, float mixDuration);
+	void setEmptyAnimations (float mixDuration);
+	spTrackEntry* addEmptyAnimation (int trackIndex, float mixDuration, float delay = 0);
 	spAnimation* findAnimation(const std::string& name) const;
 	spTrackEntry* getCurrent (int trackIndex = 0);
 	void clearTracks ();