|
|
@@ -348,7 +348,6 @@ bool AnimationSet2D::LoadSpriterAnimation(const XMLElement& animationElem)
|
|
|
{
|
|
|
SpriterTimelineKey2D key;
|
|
|
key.time_ = keyElem.GetFloat("time") * 0.001f;
|
|
|
- highestKeyTime = Max(highestKeyTime, key.time_);
|
|
|
if (keyElem.HasAttribute("spin"))
|
|
|
key.spin_ = keyElem.GetInt("spin");
|
|
|
|
|
|
@@ -439,10 +438,6 @@ bool AnimationSet2D::LoadSpriterAnimation(const XMLElement& animationElem)
|
|
|
|
|
|
// Create animation
|
|
|
SharedPtr<Animation2D> animation(new Animation2D(this));
|
|
|
- // Crop animation length if longer than the last keyframe, prevents sprites vanishing in clamp mode, or occasional flashes
|
|
|
- // when looped
|
|
|
- if (length > highestKeyTime)
|
|
|
- length = highestKeyTime;
|
|
|
animation->SetName(name);
|
|
|
animation->SetLength(length);
|
|
|
animation->SetLooped(looped);
|
|
|
@@ -469,6 +464,8 @@ bool AnimationSet2D::LoadSpriterAnimation(const XMLElement& animationElem)
|
|
|
|
|
|
keyFrame.time_ = timelineKey.time_;
|
|
|
|
|
|
+ highestKeyTime = Max(highestKeyTime, keyFrame.time_);
|
|
|
+
|
|
|
// Set disabled
|
|
|
keyFrame.enabled_ = false;
|
|
|
keyFrame.parent_ = timeline.parent_;
|
|
|
@@ -518,6 +515,12 @@ bool AnimationSet2D::LoadSpriterAnimation(const XMLElement& animationElem)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // Crop non-looped animation length if longer than the last keyframe
|
|
|
+ if (length > highestKeyTime)
|
|
|
+ animation->SetLength(highestKeyTime);
|
|
|
+ }
|
|
|
|
|
|
animations_.Push(animation);
|
|
|
|