|
@@ -116,6 +116,8 @@ void SkeletonAnimation::initialize () {
|
|
|
_state->listener = animationCallback;
|
|
|
|
|
|
_spAnimationState* stateInternal = (_spAnimationState*)_state;
|
|
|
+
|
|
|
+ _firstDraw = true;
|
|
|
}
|
|
|
|
|
|
SkeletonAnimation::SkeletonAnimation ()
|
|
@@ -136,6 +138,14 @@ void SkeletonAnimation::update (float deltaTime) {
|
|
|
spSkeleton_updateWorldTransform(_skeleton);
|
|
|
}
|
|
|
|
|
|
+void SkeletonAnimation::draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, uint32_t transformFlags) {
|
|
|
+ if (_firstDraw) {
|
|
|
+ _firstDraw = false;
|
|
|
+ update(0);
|
|
|
+ }
|
|
|
+ super::draw(renderer, transform, transformFlags);
|
|
|
+}
|
|
|
+
|
|
|
void SkeletonAnimation::setAnimationStateData (spAnimationStateData* stateData) {
|
|
|
CCASSERT(stateData, "stateData cannot be null.");
|
|
|
|