Stephen Gowen 7 năm trước cách đây
mục cha
commit
1361203f1c

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 359 - 353
spine-cpp/spine-cpp/include/spine/AnimationState.h


+ 1 - 1
spine-cpp/spine-cpp/include/spine/RegionAttachment.h

@@ -124,7 +124,7 @@ namespace Spine
         static const int BRX;
         static const int BRY;
         
-        float _x, _y, _rotation, _scaleX = 1, _scaleY = 1, _width, _height;
+        float _x, _y, _rotation, _scaleX, _scaleY, _width, _height;
         float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight;
         Vector<float> _offset;
         Vector<float> _uvs;

+ 93 - 1
spine-cpp/spine-cpp/src/spine/AnimationState.cpp

@@ -28,7 +28,99 @@
 * POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/
 
+#include <spine/AnimationState.h>
+
+#include <spine/Animation.h>
+
+#include <spine/MathUtil.h>
+
 namespace Spine
 {
-    // TODO
+    TrackEntry::TrackEntry()
+    {
+        
+    }
+    
+    int TrackEntry::getTrackIndex() { return _trackIndex; }
+    
+    Animation* TrackEntry::getAnimation() { return _animation; }
+    
+    bool TrackEntry::getLoop() { return _loop; }
+    void TrackEntry::setLoop(bool inValue) { _loop = inValue; }
+
+    float TrackEntry::getDelay() { return _delay; }
+    void TrackEntry::setDelay(float inValue) { _delay = inValue; }
+
+    float TrackEntry::getTrackTime() { return _trackTime; }
+    void TrackEntry::setTrackTime(float inValue) { _trackTime = inValue; }
+
+    float TrackEntry::getTrackEnd() { return _trackEnd; }
+    void TrackEntry::setTrackEnd(float inValue) { _trackEnd = inValue; }
+
+    float TrackEntry::getAnimationStart() { return _animationStart; }
+    void TrackEntry::setAnimationStart(float inValue) { _animationStart = inValue; }
+
+    float TrackEntry::getAnimationEnd() { return _animationEnd; }
+    void TrackEntry::setAnimationEnd(float inValue) { _animationEnd = inValue; }
+
+    float TrackEntry::getAnimationLast() { return _animationLast; }
+    void TrackEntry::setAnimationLast(float inValue)
+    {
+        _animationLast = inValue;
+        _nextAnimationLast = inValue;
+    }
+
+    float TrackEntry::getAnimationTime()
+    {
+        if (_loop)
+        {
+            float duration = _animationEnd - _animationStart;
+            if (duration == 0)
+            {
+                return _animationStart;
+            }
+
+            return fmodf(_trackTime, duration) + _animationStart;
+        }
+
+        return MIN(_trackTime + _animationStart, _animationEnd);
+    }
+
+    float TrackEntry::getTimeScale() { return _timeScale; }
+    void TrackEntry::setTimeScale(float inValue) { _timeScale = inValue; }
+
+    float TrackEntry::getAlpha() { return _alpha; }
+    void TrackEntry::setAlpha(float inValue) { _alpha = inValue; }
+
+    float TrackEntry::getEventThreshold() { return _eventThreshold; }
+    void TrackEntry::setEventThreshold(float inValue) { _eventThreshold = inValue; }
+
+    float TrackEntry::getAttachmentThreshold() { return _attachmentThreshold; }
+    void TrackEntry::setAttachmentThreshold(float inValue) { _attachmentThreshold = inValue; }
+
+    float TrackEntry::getDrawOrderThreshold() { return _drawOrderThreshold; }
+    void TrackEntry::setDrawOrderThreshold(float inValue) { _drawOrderThreshold = inValue; }
+
+    TrackEntry* TrackEntry::getNext() { return _next; }
+
+    bool TrackEntry::isComplete()
+    {
+        return _trackTime >= _animationEnd - _animationStart;
+    }
+
+    float TrackEntry::getMixTime() { return _mixTime; }
+    void TrackEntry::setMixTime(float inValue) { _mixTime = inValue; }
+
+    float TrackEntry::getMixDuration() { return _mixDuration; }
+    void TrackEntry::setMixDuration(float inValue) { _mixDuration = inValue; }
+
+    TrackEntry* TrackEntry::getMixingFrom() { return _mixingFrom; }
+    
+//    event AnimationState.TrackEntryDelegate Start, Interrupt, End, Dispose, Complete;
+//    event AnimationState.TrackEntryEventDelegate Event;
+    
+    void TrackEntry::resetRotationDirections()
+    {
+        _timelinesRotation.clear();
+    }
 }

+ 1 - 1
spine-cpp/spine-cpp/src/spine/AnimationStateData.cpp

@@ -35,7 +35,7 @@
 
 namespace Spine
 {
-    AnimationStateData::AnimationStateData(SkeletonData& skeletonData) : _skeletonData(skeletonData)
+    AnimationStateData::AnimationStateData(SkeletonData& skeletonData) : _skeletonData(skeletonData), _defaultMix(0)
     {
         // Empty
     }

+ 1 - 1
spine-cpp/spine-cpp/src/spine/ClippingAttachment.cpp

@@ -36,7 +36,7 @@ namespace Spine
 {
     RTTI_IMPL(ClippingAttachment, VertexAttachment);
     
-    ClippingAttachment::ClippingAttachment(std::string name) : VertexAttachment(name)
+    ClippingAttachment::ClippingAttachment(std::string name) : VertexAttachment(name), _endSlot(NULL)
     {
         // Empty
     }

+ 1 - 1
spine-cpp/spine-cpp/src/spine/PathAttachment.cpp

@@ -34,7 +34,7 @@ namespace Spine
 {
     RTTI_IMPL(PathAttachment, VertexAttachment);
     
-    PathAttachment::PathAttachment(std::string name) : VertexAttachment(name)
+    PathAttachment::PathAttachment(std::string name) : VertexAttachment(name), _closed(false), _constantSpeed(false)
     {
         // Empty
     }

+ 1 - 1
spine-cpp/spine-cpp/src/spine/PointAttachment.cpp

@@ -38,7 +38,7 @@ namespace Spine
 {
     RTTI_IMPL(PointAttachment, Attachment);
     
-    PointAttachment::PointAttachment(std::string name) : Attachment(name)
+    PointAttachment::PointAttachment(std::string name) : Attachment(name), _x(0), _y(0), _rotation(0)
     {
         // Empty
     }

+ 24 - 1
spine-cpp/spine-cpp/src/spine/RegionAttachment.cpp

@@ -49,7 +49,30 @@ namespace Spine
     const int RegionAttachment::BRX = 6;
     const int RegionAttachment::BRY = 7;
     
-    RegionAttachment::RegionAttachment(std::string name) : Attachment(name)
+    RegionAttachment::RegionAttachment(std::string name) : Attachment(name),
+    _x(0),
+    _y(0),
+    _rotation(0),
+    _scaleX(1),
+    _scaleY(1),
+    _width(0),
+    _height(0),
+    _regionOffsetX(0),
+    _regionOffsetY(0),
+    _regionWidth(0),
+    _regionHeight(0),
+    _regionOriginalWidth(0),
+    _regionOriginalHeight(0),
+    _rendererObject(NULL),
+    _path(),
+    _regionU(0),
+    _regionV(0),
+    _regionU2(0),
+    _regionV2(0),
+    _r(0),
+    _g(0),
+    _b(0),
+    _a(0)
     {
         _offset.reserve(NUM_UVS);
         _uvs.reserve(NUM_UVS);

+ 1 - 1
spine-cpp/spine-cpp/src/spine/SkeletonClipping.cpp

@@ -35,7 +35,7 @@
 
 namespace Spine
 {
-    SkeletonClipping::SkeletonClipping()
+    SkeletonClipping::SkeletonClipping() : _clipAttachment(NULL)
     {
         _clipOutput.reserve(128);
         _clippedVertices.reserve(128);

+ 1 - 1
spine-cpp/spine-cpp/src/spine/TwoColorTimeline.cpp

@@ -59,7 +59,7 @@ namespace Spine
     const int TwoColorTimeline::G2 = 6;
     const int TwoColorTimeline::B2 = 7;
     
-    TwoColorTimeline::TwoColorTimeline(int frameCount) : CurveTimeline(frameCount)
+    TwoColorTimeline::TwoColorTimeline(int frameCount) : CurveTimeline(frameCount), _slotIndex(0)
     {
         _frames.reserve(frameCount * ENTRIES);
     }

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác