From 9d384c50ed5a8e17c4fab1dacfcda609db30e15f Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Tue, 8 Jul 2025 20:38:45 +0200 Subject: [PATCH] [cpp] Rename Vector -> Array, ContainerUtil > ArrayUtils --- .gitignore | 2 + spine-cpp/spine-cpp/include/spine/Animation.h | 22 ++-- .../spine-cpp/include/spine/AnimationState.h | 40 +++---- .../include/spine/{Vector.h => Array.h} | 32 +++--- .../spine/{ContainerUtil.h => ArrayUtils.h} | 20 ++-- spine-cpp/spine-cpp/include/spine/Atlas.h | 18 ++-- .../include/spine/AtlasAttachmentLoader.h | 2 +- .../include/spine/AttachmentTimeline.h | 8 +- .../spine-cpp/include/spine/BlockAllocator.h | 4 +- spine-cpp/spine-cpp/include/spine/Bone.h | 6 +- spine-cpp/spine-cpp/include/spine/BonePose.h | 51 ++++++--- .../spine-cpp/include/spine/BoneTimeline.h | 4 +- .../spine-cpp/include/spine/ColorTimeline.h | 2 +- .../spine-cpp/include/spine/CurveTimeline.h | 6 +- spine-cpp/spine-cpp/include/spine/Debug.h | 2 +- .../spine-cpp/include/spine/DeformTimeline.h | 6 +- .../include/spine/DrawOrderTimeline.h | 8 +- .../spine-cpp/include/spine/EventTimeline.h | 6 +- spine-cpp/spine-cpp/include/spine/HashMap.h | 4 +- .../spine-cpp/include/spine/IkConstraint.h | 6 +- .../include/spine/IkConstraintData.h | 6 +- .../include/spine/IkConstraintTimeline.h | 2 +- .../spine-cpp/include/spine/InheritTimeline.h | 2 +- spine-cpp/spine-cpp/include/spine/Json.h | 4 +- spine-cpp/spine-cpp/include/spine/Log.h | 6 +- .../spine-cpp/include/spine/MeshAttachment.h | 24 ++--- .../spine-cpp/include/spine/PathAttachment.h | 6 +- .../spine-cpp/include/spine/PathConstraint.h | 26 ++--- .../include/spine/PathConstraintData.h | 6 +- .../include/spine/PathConstraintMixTimeline.h | 2 +- .../spine/PathConstraintPositionTimeline.h | 2 +- .../spine/PathConstraintSpacingTimeline.h | 2 +- .../include/spine/PhysicsConstraint.h | 2 +- .../include/spine/PhysicsConstraintTimeline.h | 4 +- spine-cpp/spine-cpp/include/spine/Pool.h | 8 +- .../include/spine/RegionAttachment.h | 12 +-- spine-cpp/spine-cpp/include/spine/Sequence.h | 6 +- .../include/spine/SequenceTimeline.h | 2 +- spine-cpp/spine-cpp/include/spine/Skeleton.h | 36 +++---- .../spine-cpp/include/spine/SkeletonBinary.h | 14 +-- .../spine-cpp/include/spine/SkeletonBounds.h | 14 +-- .../include/spine/SkeletonClipping.h | 30 +++--- .../spine-cpp/include/spine/SkeletonData.h | 44 ++++---- .../spine-cpp/include/spine/SkeletonJson.h | 10 +- .../include/spine/SkeletonRenderer.h | 6 +- spine-cpp/spine-cpp/include/spine/Skin.h | 22 ++-- .../include/spine/SliderMixTimeline.h | 2 +- .../spine-cpp/include/spine/SliderTimeline.h | 2 +- spine-cpp/spine-cpp/include/spine/Slot.h | 2 +- .../include/spine/SlotCurveTimeline.h | 2 +- spine-cpp/spine-cpp/include/spine/SlotPose.h | 6 +- .../spine-cpp/include/spine/TextureRegion.h | 2 +- spine-cpp/spine-cpp/include/spine/Timeline.h | 12 +-- .../include/spine/TransformConstraint.h | 6 +- .../include/spine/TransformConstraintData.h | 12 +-- .../spine/TransformConstraintTimeline.h | 2 +- .../spine-cpp/include/spine/Triangulator.h | 26 ++--- .../include/spine/VertexAttachment.h | 16 +-- spine-cpp/spine-cpp/include/spine/Vertices.h | 6 +- spine-cpp/spine-cpp/include/spine/spine.h | 4 +- spine-cpp/spine-cpp/src/spine/Animation.cpp | 22 ++-- .../spine-cpp/src/spine/AnimationState.cpp | 38 +++---- spine-cpp/spine-cpp/src/spine/Atlas.cpp | 10 +- .../src/spine/AtlasAttachmentLoader.cpp | 2 +- .../src/spine/AttachmentTimeline.cpp | 4 +- spine-cpp/spine-cpp/src/spine/Bone.cpp | 2 +- spine-cpp/spine-cpp/src/spine/BonePose.cpp | 2 +- .../spine-cpp/src/spine/BoneTimeline.cpp | 4 +- .../spine-cpp/src/spine/ColorTimeline.cpp | 2 +- .../spine-cpp/src/spine/CurveTimeline.cpp | 2 +- .../spine-cpp/src/spine/DeformTimeline.cpp | 40 +++---- .../spine-cpp/src/spine/DrawOrderTimeline.cpp | 14 +-- .../spine-cpp/src/spine/EventTimeline.cpp | 10 +- .../spine-cpp/src/spine/IkConstraint.cpp | 2 +- .../spine-cpp/src/spine/IkConstraintData.cpp | 2 +- .../src/spine/IkConstraintTimeline.cpp | 2 +- .../spine-cpp/src/spine/InheritTimeline.cpp | 2 +- spine-cpp/spine-cpp/src/spine/Json.cpp | 2 +- spine-cpp/spine-cpp/src/spine/Log.cpp | 6 +- .../spine-cpp/src/spine/MeshAttachment.cpp | 14 +-- .../spine-cpp/src/spine/PathAttachment.cpp | 4 +- .../spine-cpp/src/spine/PathConstraint.cpp | 22 ++-- .../src/spine/PathConstraintData.cpp | 2 +- .../src/spine/PathConstraintMixTimeline.cpp | 2 +- .../spine/PathConstraintPositionTimeline.cpp | 2 +- .../spine/PathConstraintSpacingTimeline.cpp | 2 +- .../src/spine/PhysicsConstraintTimeline.cpp | 8 +- .../spine-cpp/src/spine/RegionAttachment.cpp | 6 +- .../spine-cpp/src/spine/SequenceTimeline.cpp | 6 +- spine-cpp/spine-cpp/src/spine/Skeleton.cpp | 28 ++--- .../spine-cpp/src/spine/SkeletonBinary.cpp | 100 +++++++++--------- .../spine-cpp/src/spine/SkeletonBounds.cpp | 12 +-- .../spine-cpp/src/spine/SkeletonClipping.cpp | 44 ++++---- .../spine-cpp/src/spine/SkeletonData.cpp | 58 +++++----- .../spine-cpp/src/spine/SkeletonJson.cpp | 60 +++++------ .../spine-cpp/src/spine/SkeletonRenderer.cpp | 14 +-- spine-cpp/spine-cpp/src/spine/Skin.cpp | 16 +-- spine-cpp/spine-cpp/src/spine/Slider.cpp | 16 +-- .../spine-cpp/src/spine/SliderMixTimeline.cpp | 2 +- .../spine-cpp/src/spine/SliderTimeline.cpp | 2 +- .../spine-cpp/src/spine/SlotCurveTimeline.cpp | 2 +- spine-cpp/spine-cpp/src/spine/SlotPose.cpp | 2 +- spine-cpp/spine-cpp/src/spine/Timeline.cpp | 4 +- .../src/spine/TransformConstraint.cpp | 4 +- .../src/spine/TransformConstraintData.cpp | 8 +- .../src/spine/TransformConstraintTimeline.cpp | 2 +- .../spine-cpp/src/spine/Triangulator.cpp | 36 +++---- .../spine-cpp/src/spine/VertexAttachment.cpp | 18 ++-- 108 files changed, 667 insertions(+), 644 deletions(-) rename spine-cpp/spine-cpp/include/spine/{Vector.h => Array.h} (88%) rename spine-cpp/spine-cpp/include/spine/{ContainerUtil.h => ArrayUtils.h} (86%) diff --git a/.gitignore b/.gitignore index 58962ea21..2b8e15bfa 100644 --- a/.gitignore +++ b/.gitignore @@ -240,3 +240,5 @@ docs/ out.json spine-cpp/extraction.log extraction.log +spine-c-new/codegen/dist +spine-c-new/codegen/all-spine-types.json \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/Animation.h b/spine-cpp/spine-cpp/include/spine/Animation.h index c30997f38..b37ddd7c5 100644 --- a/spine-cpp/spine-cpp/include/spine/Animation.h +++ b/spine-cpp/spine-cpp/include/spine/Animation.h @@ -30,7 +30,7 @@ #ifndef Spine_Animation_h #define Spine_Animation_h -#include +#include #include #include #include @@ -101,17 +101,17 @@ namespace spine { friend class Slider; public: - Animation(const String &name, Vector &timelines, float duration); + Animation(const String &name, Array &timelines, float duration); ~Animation(); /// If the returned array or the timelines it contains are modified, setTimelines() must be called. - Vector &getTimelines(); + Array &getTimelines(); - void setTimelines(Vector &timelines); + void setTimelines(Array &timelines); /// Returns true if this animation contains a timeline with any of the specified property IDs. - bool hasTimeline(Vector &ids); + bool hasTimeline(Array &ids); /// The duration of the animation in seconds, which is usually the highest time of all frames in the timeline. The duration is /// used to know when it has completed and when it should loop back to the start. @@ -139,23 +139,23 @@ namespace spine { /// @param blend Controls how mixing is applied when alpha < 1. /// @param direction Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions, /// such as DrawOrderTimeline or AttachmentTimeline. - void apply(Skeleton &skeleton, float lastTime, float time, bool loop, Vector *pEvents, float alpha, + void apply(Skeleton &skeleton, float lastTime, float time, bool loop, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose); /// The animation's name, which is unique across all animations in the skeleton. const String &getName(); /// The bone indices affected by this animation. - const Vector &getBones(); + const Array &getBones(); /// @param target After the first and before the last entry. - static int search(Vector &values, float target); + static int search(Array &values, float target); - static int search(Vector &values, float target, int step); + static int search(Array &values, float target, int step); protected: - Vector _timelines; + Array _timelines; HashMap _timelineIds; - Vector _bones; + Array _bones; float _duration; String _name; }; diff --git a/spine-cpp/spine-cpp/include/spine/AnimationState.h b/spine-cpp/spine-cpp/include/spine/AnimationState.h index f5e00975e..87f99efd6 100644 --- a/spine-cpp/spine-cpp/include/spine/AnimationState.h +++ b/spine-cpp/spine-cpp/include/spine/AnimationState.h @@ -30,7 +30,7 @@ #ifndef Spine_AnimationState_h #define Spine_AnimationState_h -#include +#include #include #include #include @@ -339,9 +339,9 @@ namespace spine { float _delay, _trackTime, _trackLast, _nextTrackLast, _trackEnd, _timeScale; float _alpha, _mixTime, _mixDuration, _interruptAlpha, _totalAlpha; MixBlend _mixBlend; - Vector _timelineMode; - Vector _timelineHoldMix; - Vector _timelinesRotation; + Array _timelineMode; + Array _timelineHoldMix; + Array _timelinesRotation; AnimationStateListener _listener; AnimationStateListenerObject *_listenerObject; @@ -363,7 +363,7 @@ namespace spine { friend class AnimationState; private: - Vector _eventQueueEntries; + Array _eventQueueEntries; AnimationState &_state; bool _drainDisabled; @@ -410,24 +410,24 @@ namespace spine { bool apply(Skeleton &skeleton); /// Removes all animations from all tracks, leaving skeletons in their current pose. - /// + /// /// It may be desired to use AnimationState::setEmptyAnimations(float) to mix the skeletons back to the setup pose, /// rather than leaving them in their current pose. void clearTracks(); /// Removes all animations from the track, leaving skeletons in their current pose. - /// + /// /// It may be desired to use AnimationState::setEmptyAnimation(int, float) to mix the skeletons back to the setup pose, /// rather than leaving them in their current pose. void clearTrack(size_t trackIndex); /// Sets an animation by name. - /// + /// /// See setAnimation(int, Animation, bool). TrackEntry *setAnimation(size_t trackIndex, const String &animationName, bool loop); /// Sets the current animation for a track, discarding any queued animations. - /// + /// /// If the formerly current track entry is for the same animation and was never applied to a skeleton, it is replaced (not mixed /// from). /// @param loop If true, the animation will repeat. @@ -439,7 +439,7 @@ namespace spine { TrackEntry *setAnimation(size_t trackIndex, Animation *animation, bool loop); /// Queues an animation by name. - /// + /// /// See addAnimation(int, Animation, bool, float). TrackEntry *addAnimation(size_t trackIndex, const String &animationName, bool loop, float delay); @@ -455,19 +455,19 @@ namespace spine { /// Sets an empty animation for a track, discarding any queued animations, and sets the track entry's /// TrackEntry::getMixDuration(). An empty animation has no timelines and serves as a placeholder for mixing in or out. - /// + /// /// Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation(int, float), /// setEmptyAnimations(float), or addEmptyAnimation(int, float, float). Mixing to an empty animation causes /// the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation /// transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of /// 0 still mixes out over one frame. - /// + /// /// Mixing in is done by first setting an empty animation, then adding an animation using /// addAnimation(int, Animation, bool, float) with the desired delay (an empty animation has a duration of 0) and on /// the returned track entry, set the TrackEntry::setMixDuration(float). Mixing from an empty animation causes the new /// animation to be applied more and more over the mix duration. Properties keyed in the new animation transition from the value /// from lower tracks or from the setup pose value if no lower tracks key the property to the value keyed in the new animation. - /// + /// /// See Empty animations in the Spine /// Runtimes Guide. TrackEntry *setEmptyAnimation(size_t trackIndex, float mixDuration); @@ -475,7 +475,7 @@ namespace spine { /// Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's /// TrackEntry::getMixDuration(). If the track has no entries, it is equivalent to calling /// setEmptyAnimation(int, float). - /// + /// /// See setEmptyAnimation(int, float) and /// Empty animations in the Spine /// Runtimes Guide. @@ -488,7 +488,7 @@ namespace spine { TrackEntry *addEmptyAnimation(size_t trackIndex, float mixDuration, float delay); /// Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix duration. - /// + /// /// See Empty animations in the Spine /// Runtimes Guide. void setEmptyAnimations(float mixDuration); @@ -500,11 +500,11 @@ namespace spine { AnimationStateData *getData(); /// The list of tracks that have had animations, which may contain null entries for tracks that currently have no animation. - Vector &getTracks(); + Array &getTracks(); /// Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower /// or faster. Defaults to 1. - /// + /// /// See TrackEntry TrackEntry::getTimeScale() for affecting a single animation. float getTimeScale(); @@ -539,8 +539,8 @@ namespace spine { AnimationStateData *_data; Pool _trackEntryPool; - Vector _tracks; - Vector _events; + Array _tracks; + Array _events; EventQueue *_queue; HashMap _propertyIDs; @@ -561,7 +561,7 @@ namespace spine { /// the first time the mixing was applied. static void applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleton &skeleton, float time, float alpha, MixBlend pose, - Vector &timelinesRotation, size_t i, bool firstFrame); + Array &timelinesRotation, size_t i, bool firstFrame); /// Applies the attachment timeline and sets Slot::attachmentState. /// @param attachments False when: 1) the attachment timeline is mixing out, 2) mix < attachmentThreshold, and 3) the timeline diff --git a/spine-cpp/spine-cpp/include/spine/Vector.h b/spine-cpp/spine-cpp/include/spine/Array.h similarity index 88% rename from spine-cpp/spine-cpp/include/spine/Vector.h rename to spine-cpp/spine-cpp/include/spine/Array.h index e1aa3429f..b3b281194 100644 --- a/spine-cpp/spine-cpp/include/spine/Vector.h +++ b/spine-cpp/spine-cpp/include/spine/Array.h @@ -27,8 +27,8 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#ifndef Spine_Vector_h -#define Spine_Vector_h +#ifndef Spine_Array_h +#define Spine_Array_h #include #include @@ -37,24 +37,24 @@ namespace spine { template - class SP_API Vector : public SpineObject { + class SP_API Array : public SpineObject { public: using size_type = size_t; using value_type = T; - Vector() : _size(0), _capacity(0), _buffer(NULL) { + Array() : _size(0), _capacity(0), _buffer(NULL) { } - Vector(const Vector &inVector) : _size(inVector._size), _capacity(inVector._capacity), _buffer(NULL) { + Array(const Array &inArray) : _size(inArray._size), _capacity(inArray._capacity), _buffer(NULL) { if (_capacity > 0) { _buffer = allocate(_capacity); for (size_t i = 0; i < _size; ++i) { - construct(_buffer + i, inVector._buffer[i]); + construct(_buffer + i, inArray._buffer[i]); } } } - ~Vector() { + ~Array() { clear(); deallocate(_buffer); } @@ -75,7 +75,7 @@ namespace spine { return _size; } - inline Vector &setSize(size_t newSize, const T &defaultValue) { + inline Array &setSize(size_t newSize, const T &defaultValue) { assert(newSize >= 0); size_t oldSize = _size; _size = newSize; @@ -122,14 +122,14 @@ namespace spine { } } - inline void addAll(const Vector &inValue) { + inline void addAll(const Array &inValue) { ensureCapacity(this->size() + inValue.size()); for (size_t i = 0; i < inValue.size(); i++) { add(inValue[i]); } } - inline void clearAndAddAll(const Vector &inValue) { + inline void clearAndAddAll(const Array &inValue) { ensureCapacity(inValue.size()); for (size_t i = 0; i < inValue.size(); i++) _buffer[i] = inValue[i]; @@ -184,7 +184,7 @@ namespace spine { return _buffer[inIndex]; } - inline friend bool operator==(Vector &lhs, Vector &rhs) { + inline friend bool operator==(Array &lhs, Array &rhs) { if (lhs.size() != rhs.size()) { return false; } @@ -198,13 +198,13 @@ namespace spine { return true; } - inline friend bool operator!=(Vector &lhs, Vector &rhs) { + inline friend bool operator!=(Array &lhs, Array &rhs) { return !(lhs == rhs); } - Vector &operator=(const Vector &inVector) { - if (this != &inVector) { - clearAndAddAll(inVector); + Array &operator=(const Array &inArray) { + if (this != &inArray) { + clearAndAddAll(inArray); } return *this; } @@ -245,4 +245,4 @@ namespace spine { }; } -#endif /* Spine_Vector_h */ +#endif /* Spine_Array_h */ diff --git a/spine-cpp/spine-cpp/include/spine/ContainerUtil.h b/spine-cpp/spine-cpp/include/spine/ArrayUtils.h similarity index 86% rename from spine-cpp/spine-cpp/include/spine/ContainerUtil.h rename to spine-cpp/spine-cpp/include/spine/ArrayUtils.h index 410e2eb01..44b4323b1 100644 --- a/spine-cpp/spine-cpp/include/spine/ContainerUtil.h +++ b/spine-cpp/spine-cpp/include/spine/ArrayUtils.h @@ -31,7 +31,7 @@ #define Spine_ContainerUtil_h #include -#include +#include #include #include #include @@ -39,13 +39,13 @@ #include namespace spine { - class SP_API ContainerUtil : public SpineObject { + class SP_API ArrayUtils : public SpineObject { public: /// Finds an item by comparing each item's name. /// It is more efficient to cache the results of this method than to call it multiple times. /// @return May be NULL. template - static T *findWithName(Vector &items, const String &name) { + static T *findWithName(Array &items, const String &name) { assert(name.length() > 0); for (size_t i = 0; i < items.size(); ++i) { @@ -60,7 +60,7 @@ namespace spine { /// @return -1 if the item was not found. template - static int findIndexWithName(Vector &items, const String &name) { + static int findIndexWithName(Array &items, const String &name) { assert(name.length() > 0); for (size_t i = 0, len = items.size(); i < len; ++i) { @@ -77,7 +77,7 @@ namespace spine { /// It is more efficient to cache the results of this method than to call it multiple times. /// @return May be NULL. template - static T *findWithDataName(Vector &items, const String &name) { + static T *findWithDataName(Array &items, const String &name) { assert(name.length() > 0); for (size_t i = 0; i < items.size(); ++i) { @@ -92,7 +92,7 @@ namespace spine { /// @return -1 if the item was not found. template - static int findIndexWithDataName(Vector &items, const String &name) { + static int findIndexWithDataName(Array &items, const String &name) { assert(name.length() > 0); for (size_t i = 0, len = items.size(); i < len; ++i) { @@ -106,7 +106,7 @@ namespace spine { } template - static void cleanUpVectorOfPointers(Vector &items) { + static void deleteElements(Array &items) { for (int i = (int) items.size() - 1; i >= 0; i--) { T *item = items[i]; @@ -118,11 +118,11 @@ namespace spine { private: // ctor, copy ctor, and assignment should be private in a Singleton - ContainerUtil(); + ArrayUtils(); - ContainerUtil(const ContainerUtil &); + ArrayUtils(const ArrayUtils &); - ContainerUtil &operator=(const ContainerUtil &); + ArrayUtils &operator=(const ArrayUtils &); }; } diff --git a/spine-cpp/spine-cpp/include/spine/Atlas.h b/spine-cpp/spine-cpp/include/spine/Atlas.h index 06acf555d..e778c3713 100644 --- a/spine-cpp/spine-cpp/include/spine/Atlas.h +++ b/spine-cpp/spine-cpp/include/spine/Atlas.h @@ -30,7 +30,7 @@ #ifndef Spine_Atlas_h #define Spine_Atlas_h -#include +#include #include #include #include @@ -112,10 +112,10 @@ namespace spine { String name; int index; int x, y; - Vector splits; - Vector pads; - Vector names; - Vector values; + Array splits; + Array pads; + Array names; + Array values; }; class TextureLoader; @@ -135,13 +135,13 @@ namespace spine { /// @return The region, or NULL. AtlasRegion *findRegion(const String &name); - Vector &getPages(); + Array &getPages(); - Vector &getRegions(); + Array &getRegions(); private: - Vector _pages; - Vector _regions; + Array _pages; + Array _regions; TextureLoader *_textureLoader; void load(const char *begin, int length, const char *dir, bool createTexture); diff --git a/spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h b/spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h index 01b368bad..25369ec51 100644 --- a/spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h +++ b/spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h @@ -31,7 +31,7 @@ #define Spine_AtlasAttachmentLoader_h #include -#include +#include #include diff --git a/spine-cpp/spine-cpp/include/spine/AttachmentTimeline.h b/spine-cpp/spine-cpp/include/spine/AttachmentTimeline.h index 2d97a1140..cd1782db8 100644 --- a/spine-cpp/spine-cpp/include/spine/AttachmentTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/AttachmentTimeline.h @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include #include @@ -61,7 +61,7 @@ namespace spine { virtual ~AttachmentTimeline(); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; /// Sets the time and attachment name for the specified frame. @@ -70,10 +70,10 @@ namespace spine { void setFrame(int frame, float time, const String &attachmentName); /// The attachment name for each frame. May contain null values to clear the attachment. - Vector &getAttachmentNames(); + Array &getAttachmentNames(); protected: - Vector _attachmentNames; + Array _attachmentNames; void setAttachment(Skeleton &skeleton, SlotPose &pose, String *attachmentName); }; diff --git a/spine-cpp/spine-cpp/include/spine/BlockAllocator.h b/spine-cpp/spine-cpp/include/spine/BlockAllocator.h index 749a69cbd..313b08bde 100644 --- a/spine-cpp/spine-cpp/include/spine/BlockAllocator.h +++ b/spine-cpp/spine-cpp/include/spine/BlockAllocator.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include namespace spine { struct Block { @@ -59,7 +59,7 @@ namespace spine { class BlockAllocator : public SpineObject { int initialBlockSize; - Vector blocks; + Array blocks; public: BlockAllocator(int initialBlockSize) : initialBlockSize(initialBlockSize) { diff --git a/spine-cpp/spine-cpp/include/spine/Bone.h b/spine-cpp/spine-cpp/include/spine/Bone.h index 61566377d..a58220637 100644 --- a/spine-cpp/spine-cpp/include/spine/Bone.h +++ b/spine-cpp/spine-cpp/include/spine/Bone.h @@ -35,7 +35,7 @@ #include #include #include -#include +#include namespace spine { /// The current pose for a bone, before constraints are applied. @@ -85,7 +85,7 @@ namespace spine { Bone* getParent(); /// The immediate children of this bone. - Vector& getChildren(); + Array& getChildren(); static bool isYDown() { return yDown; } static void setYDown(bool value) { yDown = value; } @@ -93,7 +93,7 @@ namespace spine { private: static bool yDown; Bone* const _parent; - Vector _children; + Array _children; bool _sorted; }; } diff --git a/spine-cpp/spine-cpp/include/spine/BonePose.h b/spine-cpp/spine-cpp/include/spine/BonePose.h index 89fe0492f..9d03a5b7b 100644 --- a/spine-cpp/spine-cpp/include/spine/BonePose.h +++ b/spine-cpp/spine-cpp/include/spine/BonePose.h @@ -42,24 +42,39 @@ namespace spine { /// Skeleton::updateWorldTransform(Physics). class SP_API BonePose : public BoneLocal, public Update { friend class IkConstraint; + friend class PathConstraint; + friend class PhysicsConstraint; + friend class TransformConstraint; + friend class TransformConstraintData; + friend class FromRotate; + friend class ToRotate; + friend class FromX; + friend class ToX; + friend class FromY; + friend class ToY; + friend class FromScaleX; + friend class ToScaleX; + friend class FromScaleY; + friend class ToScaleY; + friend class FromShearX; + friend class ToShearX; + friend class FromShearY; + friend class ToShearY; + friend class Skeleton; + friend class Bone; public: - Bone* _bone; - float _a, _b, _worldX; - float _c, _d, _worldY; - int _world, _local; - BonePose(); virtual ~BonePose(); /// Called by Skeleton::updateCache() to compute the world transform, if needed. - virtual void update(Skeleton& skeleton, Physics physics) override; + virtual void update(Skeleton &skeleton, Physics physics) override; /// Computes the world transform using the parent bone's applied pose and this pose. Child bones are not updated. /// /// See World transforms in the Spine /// Runtimes Guide. - void updateWorldTransform(Skeleton& skeleton); + void updateWorldTransform(Skeleton &skeleton); /// Computes the local transform values from the world transform. /// @@ -69,12 +84,12 @@ namespace spine { /// /// Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The local transform after /// calling this method is equivalent to the local transform used to compute the world transform, but may not be identical. - void updateLocalTransform(Skeleton& skeleton); + void updateLocalTransform(Skeleton &skeleton); /// If the world transform has been modified and the local transform no longer matches, updateLocalTransform() is called. - void validateLocalTransform(Skeleton& skeleton); + void validateLocalTransform(Skeleton &skeleton); - void modifyLocal(Skeleton& skeleton); + void modifyLocal(Skeleton &skeleton); void modifyWorld(int update); void resetWorld(int update); @@ -115,16 +130,16 @@ namespace spine { float getWorldScaleY(); /// Transforms a point from world coordinates to the bone's local coordinates. - void worldToLocal(float worldX, float worldY, float& outLocalX, float& outLocalY); + void worldToLocal(float worldX, float worldY, float &outLocalX, float &outLocalY); /// Transforms a point from the bone's local coordinates to world coordinates. - void localToWorld(float localX, float localY, float& outWorldX, float& outWorldY); + void localToWorld(float localX, float localY, float &outWorldX, float &outWorldY); /// Transforms a point from world coordinates to the parent bone's local coordinates. - void worldToParent(float worldX, float worldY, float& outParentX, float& outParentY); + void worldToParent(float worldX, float worldY, float &outParentX, float &outParentY); /// Transforms a point from the parent bone's coordinates to world coordinates. - void parentToWorld(float parentX, float parentY, float& outWorldX, float& outWorldY); + void parentToWorld(float parentX, float parentY, float &outWorldX, float &outWorldY); /// Transforms a world rotation to a local rotation. float worldToLocalRotation(float worldRotation); @@ -137,7 +152,13 @@ namespace spine { /// After changes are made to the world transform, updateLocalTransform() should be called on this bone and any /// child bones, recursively. void rotateWorld(float degrees); + + protected: + Bone *_bone; + float _a, _b, _worldX; + float _c, _d, _worldY; + int _world, _local; }; -} +}// namespace spine #endif /* SPINE_BONEPOSE_H_ */ \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/BoneTimeline.h b/spine-cpp/spine-cpp/include/spine/BoneTimeline.h index 17cd84258..267e6dd3b 100644 --- a/spine-cpp/spine-cpp/include/spine/BoneTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/BoneTimeline.h @@ -67,7 +67,7 @@ namespace spine { BoneTimeline1(size_t frameCount, size_t bezierCount, int boneIndex, Property property); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; protected: @@ -88,7 +88,7 @@ namespace spine { BoneTimeline2(size_t frameCount, size_t bezierCount, int boneIndex, Property property1, Property property2); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; protected: diff --git a/spine-cpp/spine-cpp/include/spine/ColorTimeline.h b/spine-cpp/spine-cpp/include/spine/ColorTimeline.h index ef93c93a8..7207d9cbc 100644 --- a/spine-cpp/spine-cpp/include/spine/ColorTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/ColorTimeline.h @@ -102,7 +102,7 @@ namespace spine { virtual ~AlphaTimeline(); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; }; diff --git a/spine-cpp/spine-cpp/include/spine/CurveTimeline.h b/spine-cpp/spine-cpp/include/spine/CurveTimeline.h index db77f7005..072a2d96c 100644 --- a/spine-cpp/spine-cpp/include/spine/CurveTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/CurveTimeline.h @@ -31,7 +31,7 @@ #define Spine_CurveTimeline_h #include -#include +#include namespace spine { /// Base class for frames that use an interpolation bezier curve. @@ -53,7 +53,7 @@ namespace spine { float getBezierValue(float time, size_t frame, size_t valueOffset, size_t i); - Vector &getCurves(); + Array &getCurves(); protected: static const int LINEAR = 0; @@ -61,7 +61,7 @@ namespace spine { static const int BEZIER = 2; static const int BEZIER_SIZE = 18; - Vector _curves; // type, x, y, ... + Array _curves; // type, x, y, ... }; /// The base class for a CurveTimeline that sets one property. diff --git a/spine-cpp/spine-cpp/include/spine/Debug.h b/spine-cpp/spine-cpp/include/spine/Debug.h index f2911c27e..5487aa563 100644 --- a/spine-cpp/spine-cpp/include/spine/Debug.h +++ b/spine-cpp/spine-cpp/include/spine/Debug.h @@ -31,7 +31,7 @@ #define SPINE_LOG_H #include -#include +#include #include namespace spine { diff --git a/spine-cpp/spine-cpp/include/spine/DeformTimeline.h b/spine-cpp/spine-cpp/include/spine/DeformTimeline.h index 0f4cd2385..0410eaaf5 100644 --- a/spine-cpp/spine-cpp/include/spine/DeformTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/DeformTimeline.h @@ -47,10 +47,10 @@ namespace spine { explicit DeformTimeline(size_t frameCount, size_t bezierCount, int slotIndex, VertexAttachment *attachment); /// Sets the time and vertices for the specified frame. - void setFrame(int frameIndex, float time, Vector &vertices); + void setFrame(int frameIndex, float time, Array &vertices); /// The vertices for each frame. - Vector > &getVertices(); + Array > &getVertices(); /// The attachment that will be deformed. VertexAttachment *getAttachment(); @@ -69,7 +69,7 @@ namespace spine { void apply(Slot &slot, SlotPose &pose, float time, float alpha, MixBlend blend) override; private: - Vector > _vertices; + Array > _vertices; VertexAttachment *_attachment; }; diff --git a/spine-cpp/spine-cpp/include/spine/DrawOrderTimeline.h b/spine-cpp/spine-cpp/include/spine/DrawOrderTimeline.h index 00289b6a5..edec65fd4 100644 --- a/spine-cpp/spine-cpp/include/spine/DrawOrderTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/DrawOrderTimeline.h @@ -45,22 +45,22 @@ namespace spine { explicit DrawOrderTimeline(size_t frameCount); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; size_t getFrameCount(); /// The draw order for each frame. See setFrame(). - Vector > &getDrawOrders(); + Array > &getDrawOrders(); /// Sets the time and draw order for the specified frame. /// @param frame Between 0 and frameCount, inclusive. /// @param time The frame time in seconds. /// @param drawOrder For each slot in Skeleton::slots, the index of the slot in the new draw order. May be null to use setup pose draw order. - void setFrame(size_t frame, float time, Vector *drawOrder); + void setFrame(size_t frame, float time, Array *drawOrder); private: - Vector > _drawOrders; + Array > _drawOrders; }; } diff --git a/spine-cpp/spine-cpp/include/spine/EventTimeline.h b/spine-cpp/spine-cpp/include/spine/EventTimeline.h index 01f916ce6..251b26501 100644 --- a/spine-cpp/spine-cpp/include/spine/EventTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/EventTimeline.h @@ -48,20 +48,20 @@ namespace spine { /// Fires events for frames > lastTime and <= time. virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; size_t getFrameCount(); /// The event for each frame. - Vector &getEvents(); + Array &getEvents(); /// Sets the time and event for the specified frame. /// @param frame Between 0 and frameCount, inclusive. void setFrame(size_t frame, Event *event); private: - Vector _events; + Array _events; }; } diff --git a/spine-cpp/spine-cpp/include/spine/HashMap.h b/spine-cpp/spine-cpp/include/spine/HashMap.h index 45c54b877..f354a6d43 100755 --- a/spine-cpp/spine-cpp/include/spine/HashMap.h +++ b/spine-cpp/spine-cpp/include/spine/HashMap.h @@ -30,7 +30,7 @@ #ifndef Spine_HashMap_h #define Spine_HashMap_h -#include +#include #include // Required for new with line number and file name in MSVC @@ -131,7 +131,7 @@ namespace spine { } } - bool addAll(Vector &keys, const V &value) { + bool addAll(Array &keys, const V &value) { size_t oldSize = _size; for (size_t i = 0; i < keys.size(); i++) { put(keys[i], value); diff --git a/spine-cpp/spine-cpp/include/spine/IkConstraint.h b/spine-cpp/spine-cpp/include/spine/IkConstraint.h index af5e31c4c..fee2ef6fc 100644 --- a/spine-cpp/spine-cpp/include/spine/IkConstraint.h +++ b/spine-cpp/spine-cpp/include/spine/IkConstraint.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include namespace spine { class Skeleton; @@ -61,7 +61,7 @@ namespace spine { IkConstraintData &getData() override; - Vector &getBones(); + Array &getBones(); Bone *getTarget(); @@ -80,7 +80,7 @@ namespace spine { float softness, float mix); private: - Vector _bones; + Array _bones; Bone *_target; }; } diff --git a/spine-cpp/spine-cpp/include/spine/IkConstraintData.h b/spine-cpp/spine-cpp/include/spine/IkConstraintData.h index 5d90d7006..f85983a72 100644 --- a/spine-cpp/spine-cpp/include/spine/IkConstraintData.h +++ b/spine-cpp/spine-cpp/include/spine/IkConstraintData.h @@ -30,7 +30,7 @@ #ifndef Spine_IkConstraintData_h #define Spine_IkConstraintData_h -#include +#include #include #include #include @@ -60,7 +60,7 @@ namespace spine { virtual Constraint* create(Skeleton& skeleton) override; /// The bones that are constrained by this IK Constraint. - Vector &getBones(); + Array &getBones(); /// The bone that is the IK target. BoneData *getTarget(); @@ -73,7 +73,7 @@ namespace spine { void setUniform(bool uniform); private: - Vector _bones; + Array _bones; BoneData *_target; bool _uniform; }; diff --git a/spine-cpp/spine-cpp/include/spine/IkConstraintTimeline.h b/spine-cpp/spine-cpp/include/spine/IkConstraintTimeline.h index e405b9476..c442d4f18 100644 --- a/spine-cpp/spine-cpp/include/spine/IkConstraintTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/IkConstraintTimeline.h @@ -50,7 +50,7 @@ namespace spine { virtual ~IkConstraintTimeline(); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; /// Sets the time, mix, softness, bend direction, compress, and stretch for the specified frame. diff --git a/spine-cpp/spine-cpp/include/spine/InheritTimeline.h b/spine-cpp/spine-cpp/include/spine/InheritTimeline.h index 3bbd4f502..cdabc0018 100644 --- a/spine-cpp/spine-cpp/include/spine/InheritTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/InheritTimeline.h @@ -57,7 +57,7 @@ namespace spine { void setFrame(int frame, float time, Inherit inherit); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; private: diff --git a/spine-cpp/spine-cpp/include/spine/Json.h b/spine-cpp/spine-cpp/include/spine/Json.h index 3547364e7..8f025075f 100644 --- a/spine-cpp/spine-cpp/include/spine/Json.h +++ b/spine-cpp/spine-cpp/include/spine/Json.h @@ -31,7 +31,7 @@ #define Spine_Json_h #include -#include +#include #ifndef SPINE_JSON_HAVE_PREV /* spine doesn't use the "prev" link in the Json sibling lists. */ @@ -53,7 +53,7 @@ namespace spine { static const int JSON_OBJECT; template - static bool asArray(Json *value, Vector &array) { + static bool asArray(Json *value, Array &array) { if (value == NULL) return false; array.setSize(value->_size, 0); Json *vertex = value->_child; diff --git a/spine-cpp/spine-cpp/include/spine/Log.h b/spine-cpp/spine-cpp/include/spine/Log.h index ce66f44fc..689bd63a8 100644 --- a/spine-cpp/spine-cpp/include/spine/Log.h +++ b/spine-cpp/spine-cpp/include/spine/Log.h @@ -39,19 +39,19 @@ namespace spine { SP_API void spDebug_printTimeline(Timeline *timeline); - SP_API void spDebug_printBoneDatas(Vector &boneDatas); + SP_API void spDebug_printBoneDatas(Array &boneDatas); SP_API void spDebug_printBoneData(BoneData *boneData); SP_API void spDebug_printSkeleton(Skeleton *skeleton); - SP_API void spDebug_printBones(Vector &bones); + SP_API void spDebug_printBones(Array &bones); SP_API void spDebug_printBone(Bone *bone); SP_API void spDebug_printFloats(float *values, int numFloats); - SP_API void spDebug_printFloats(Vector &values); + SP_API void spDebug_printFloats(Array &values); } #endif diff --git a/spine-cpp/spine-cpp/include/spine/MeshAttachment.h b/spine-cpp/spine-cpp/include/spine/MeshAttachment.h index 1836aa9d6..864183641 100644 --- a/spine-cpp/spine-cpp/include/spine/MeshAttachment.h +++ b/spine-cpp/spine-cpp/include/spine/MeshAttachment.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include @@ -64,16 +64,16 @@ namespace spine { void setHullLength(int inValue); - Vector &getRegionUVs(); + Array &getRegionUVs(); - void setRegionUVs(Vector &inValue); + void setRegionUVs(Array &inValue); /// The UV pair for each vertex, normalized within the entire texture. See also MeshAttachment::updateRegion - Vector &getUVs(); + Array &getUVs(); - Vector &getTriangles(); + Array &getTriangles(); - void setTriangles(Vector &inValue); + void setTriangles(Array &inValue); Color &getColor(); @@ -94,9 +94,9 @@ namespace spine { void setParentMesh(MeshAttachment *inValue); // Nonessential. - Vector &getEdges(); + Array &getEdges(); - void setEdges(Vector &inValue); + void setEdges(Array &inValue); float getWidth(); @@ -112,10 +112,10 @@ namespace spine { private: MeshAttachment *_parentMesh; - Vector _uvs; - Vector _regionUVs; - Vector _triangles; - Vector _edges; + Array _uvs; + Array _regionUVs; + Array _triangles; + Array _edges; String _path; Color _color; int _hullLength; diff --git a/spine-cpp/spine-cpp/include/spine/PathAttachment.h b/spine-cpp/spine-cpp/include/spine/PathAttachment.h index f3a13d978..acb6fbb53 100644 --- a/spine-cpp/spine-cpp/include/spine/PathAttachment.h +++ b/spine-cpp/spine-cpp/include/spine/PathAttachment.h @@ -45,9 +45,9 @@ namespace spine { explicit PathAttachment(const String &name); /// The length in the setup pose from the start of the path to the end of each curve. - Vector &getLengths(); + Array &getLengths(); - void setLengths(Vector &inValue); + void setLengths(Array &inValue); bool isClosed(); @@ -62,7 +62,7 @@ namespace spine { virtual Attachment *copy() override; private: - Vector _lengths; + Array _lengths; bool _closed; bool _constantSpeed; Color _color; diff --git a/spine-cpp/spine-cpp/include/spine/PathConstraint.h b/spine-cpp/spine-cpp/include/spine/PathConstraint.h index 7e7b05dd8..fcedb350a 100644 --- a/spine-cpp/spine-cpp/include/spine/PathConstraint.h +++ b/spine-cpp/spine-cpp/include/spine/PathConstraint.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include namespace spine { class Skeleton; @@ -74,7 +74,7 @@ namespace spine { virtual bool isSourceActive() override; /// The bones that will be modified by this path constraint. - Vector &getBones(); + Array &getBones(); /// The slot whose path attachment will be used to constrained the bones. Slot *getSlot(); @@ -86,24 +86,24 @@ namespace spine { private: - Vector _bones; + Array _bones; Slot *_slot; - Vector _spaces; - Vector _positions; - Vector _world; - Vector _curves; - Vector _lengths; - Vector _segments; + Array _spaces; + Array _positions; + Array _world; + Array _curves; + Array _lengths; + Array _segments; - Vector &computeWorldPositions(Skeleton& skeleton, PathAttachment &path, int spacesCount, bool tangents); + Array &computeWorldPositions(Skeleton& skeleton, PathAttachment &path, int spacesCount, bool tangents); - void addBeforePosition(float p, Vector &temp, int i, Vector &output, int o); + void addBeforePosition(float p, Array &temp, int i, Array &output, int o); - void addAfterPosition(float p, Vector &temp, int i, Vector &output, int o); + void addAfterPosition(float p, Array &temp, int i, Array &output, int o); void addCurvePosition(float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, - Vector &output, int o, bool tangents); + Array &output, int o, bool tangents); void sortPathSlot(Skeleton& skeleton, Skin& skin, int slotIndex, Bone& slotBone); diff --git a/spine-cpp/spine-cpp/include/spine/PathConstraintData.h b/spine-cpp/spine-cpp/include/spine/PathConstraintData.h index 94fb65f52..3b080bd3a 100644 --- a/spine-cpp/spine-cpp/include/spine/PathConstraintData.h +++ b/spine-cpp/spine-cpp/include/spine/PathConstraintData.h @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include #include @@ -72,7 +72,7 @@ namespace spine { /// The bones that will be modified by this path constraint. - Vector &getBones(); + Array &getBones(); /// The slot whose path attachment will be used to constrained the bones. SlotData *getSlot(); @@ -100,7 +100,7 @@ namespace spine { void setOffsetRotation(float offsetRotation); private: - Vector _bones; + Array _bones; SlotData *_slot; PositionMode _positionMode; SpacingMode _spacingMode; diff --git a/spine-cpp/spine-cpp/include/spine/PathConstraintMixTimeline.h b/spine-cpp/spine-cpp/include/spine/PathConstraintMixTimeline.h index a8f1e42e7..eed33698c 100644 --- a/spine-cpp/spine-cpp/include/spine/PathConstraintMixTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/PathConstraintMixTimeline.h @@ -50,7 +50,7 @@ namespace spine { virtual ~PathConstraintMixTimeline(); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; /// Sets the time and color for the specified frame. diff --git a/spine-cpp/spine-cpp/include/spine/PathConstraintPositionTimeline.h b/spine-cpp/spine-cpp/include/spine/PathConstraintPositionTimeline.h index 32269be8c..477dffb11 100644 --- a/spine-cpp/spine-cpp/include/spine/PathConstraintPositionTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/PathConstraintPositionTimeline.h @@ -50,7 +50,7 @@ namespace spine { virtual ~PathConstraintPositionTimeline(); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; }; } diff --git a/spine-cpp/spine-cpp/include/spine/PathConstraintSpacingTimeline.h b/spine-cpp/spine-cpp/include/spine/PathConstraintSpacingTimeline.h index f69da9d2a..2171f30f9 100644 --- a/spine-cpp/spine-cpp/include/spine/PathConstraintSpacingTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/PathConstraintSpacingTimeline.h @@ -47,7 +47,7 @@ namespace spine { virtual ~PathConstraintSpacingTimeline(); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; }; } diff --git a/spine-cpp/spine-cpp/include/spine/PhysicsConstraint.h b/spine-cpp/spine-cpp/include/spine/PhysicsConstraint.h index 48a8ceb0f..22d6d36dd 100644 --- a/spine-cpp/spine-cpp/include/spine/PhysicsConstraint.h +++ b/spine-cpp/spine-cpp/include/spine/PhysicsConstraint.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include namespace spine { class Skeleton; diff --git a/spine-cpp/spine-cpp/include/spine/PhysicsConstraintTimeline.h b/spine-cpp/spine-cpp/include/spine/PhysicsConstraintTimeline.h index 450e71c03..de5112f90 100644 --- a/spine-cpp/spine-cpp/include/spine/PhysicsConstraintTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/PhysicsConstraintTimeline.h @@ -51,7 +51,7 @@ namespace spine { explicit PhysicsConstraintTimeline(size_t frameCount, size_t bezierCount, int constraintIndex, Property property); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; protected: @@ -254,7 +254,7 @@ namespace spine { } virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; int getFrameCount() { return (int)_frames.size(); } diff --git a/spine-cpp/spine-cpp/include/spine/Pool.h b/spine-cpp/spine-cpp/include/spine/Pool.h index 2f2b43a13..d577ad721 100644 --- a/spine-cpp/spine-cpp/include/spine/Pool.h +++ b/spine-cpp/spine-cpp/include/spine/Pool.h @@ -31,8 +31,8 @@ #define Spine_Pool_h #include -#include -#include +#include +#include #include namespace spine { @@ -43,7 +43,7 @@ namespace spine { } ~Pool() { - ContainerUtil::cleanUpVectorOfPointers(_objects); + ArrayUtils::deleteElements(_objects); } T *obtain() { @@ -67,7 +67,7 @@ namespace spine { } private: - Vector _objects; + Array _objects; }; } diff --git a/spine-cpp/spine-cpp/include/spine/RegionAttachment.h b/spine-cpp/spine-cpp/include/spine/RegionAttachment.h index f3d5d0a6b..704de465e 100644 --- a/spine-cpp/spine-cpp/include/spine/RegionAttachment.h +++ b/spine-cpp/spine-cpp/include/spine/RegionAttachment.h @@ -31,7 +31,7 @@ #define Spine_RegionAttachment_h #include -#include +#include #include #include #include @@ -68,7 +68,7 @@ namespace spine { /// @param stride The number of worldVertices entries between the value pairs written. void computeWorldVertices(Slot &slot, float *worldVertices, size_t offset, size_t stride = 2); - void computeWorldVertices(Slot &slot, Vector &worldVertices, size_t offset, size_t stride = 2); + void computeWorldVertices(Slot &slot, Array &worldVertices, size_t offset, size_t stride = 2); float getX(); @@ -112,9 +112,9 @@ namespace spine { void setSequence(Sequence *sequence); - Vector &getOffset(); + Array &getOffset(); - Vector &getUVs(); + Array &getUVs(); virtual Attachment *copy() override; @@ -129,8 +129,8 @@ namespace spine { static const int BRY; float _x, _y, _rotation, _scaleX, _scaleY, _width, _height; - Vector _vertexOffset; - Vector _uvs; + Array _vertexOffset; + Array _uvs; String _path; Color _color; TextureRegion *_region; diff --git a/spine-cpp/spine-cpp/include/spine/Sequence.h b/spine-cpp/spine-cpp/include/spine/Sequence.h index 992ec7327..b76bbfa5f 100644 --- a/spine-cpp/spine-cpp/include/spine/Sequence.h +++ b/spine-cpp/spine-cpp/include/spine/Sequence.h @@ -30,7 +30,7 @@ #ifndef Spine_Sequence_h #define Spine_Sequence_h -#include +#include #include #include #include @@ -74,12 +74,12 @@ namespace spine { void setSetupIndex(int setupIndex) { _setupIndex = setupIndex; } - Vector &getRegions() { return _regions; } + Array &getRegions() { return _regions; } private: static int _nextID; int _id; - Vector _regions; + Array _regions; int _start; int _digits; int _setupIndex; diff --git a/spine-cpp/spine-cpp/include/spine/SequenceTimeline.h b/spine-cpp/spine-cpp/include/spine/SequenceTimeline.h index 9390d3e63..4452cc1b4 100644 --- a/spine-cpp/spine-cpp/include/spine/SequenceTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/SequenceTimeline.h @@ -52,7 +52,7 @@ namespace spine { virtual ~SequenceTimeline(); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; /// Sets the time, mode, index, and frame time for the specified frame. diff --git a/spine-cpp/spine-cpp/include/spine/Skeleton.h b/spine-cpp/spine-cpp/include/spine/Skeleton.h index 4bc74d5f6..a23547ad8 100644 --- a/spine-cpp/spine-cpp/include/spine/Skeleton.h +++ b/spine-cpp/spine-cpp/include/spine/Skeleton.h @@ -30,7 +30,7 @@ #ifndef Spine_Skeleton_h #define Spine_Skeleton_h -#include +#include #include #include #include @@ -165,7 +165,7 @@ namespace spine { void sortBone(Bone *bone); - static void sortReset(Vector &bones); + static void sortReset(Array &bones); /// Updates the world transform for each bone and applies all constraints. /// @@ -185,21 +185,21 @@ namespace spine { SkeletonData *getData(); - Vector &getBones(); + Array &getBones(); - Vector &getUpdateCache(); + Array &getUpdateCache(); Bone *getRootBone(); /// @return May be NULL. Bone *findBone(const String &boneName); - Vector &getSlots(); + Array &getSlots(); /// @return May be NULL. Slot *findSlot(const String &slotName); - Vector &getDrawOrder(); + Array &getDrawOrder(); Skin *getSkin(); @@ -224,9 +224,9 @@ namespace spine { /// @param attachmentName May be empty. void setAttachment(const String &slotName, const String &attachmentName); - Vector &getConstraints(); + Array &getConstraints(); - Vector &getPhysicsConstraints(); + Array &getPhysicsConstraints(); template T *findConstraint(const String &constraintName) { @@ -247,10 +247,10 @@ namespace spine { /// @param outY The vertical distance between the skeleton origin and the bottom side of the AABB. /// @param outWidth The width of the AABB /// @param outHeight The height of the AABB. - /// @param outVertexBuffer Reference to hold a Vector of floats. This method will assign it with new floats as needed. + /// @param outVertexBuffer Reference to hold an array of floats. This method will assign it with new floats as needed. // @param clipping Pointer to a SkeletonClipping instance or NULL. If a clipper is given, clipping attachments will be taken into account. - void getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Vector &outVertexBuffer); - void getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Vector &outVertexBuffer, SkeletonClipping *clipper); + void getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Array &outVertexBuffer); + void getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Array &outVertexBuffer, SkeletonClipping *clipper); Color &getColor(); @@ -309,13 +309,13 @@ namespace spine { protected: SkeletonData &_data; - Vector _bones; - Vector _slots; - Vector _drawOrder; - Vector _constraints; - Vector _physics; - Vector _updateCache; - Vector _resetCache; + Array _bones; + Array _slots; + Array _drawOrder; + Array _constraints; + Array _physics; + Array _updateCache; + Array _resetCache; Skin *_skin; Color _color; float _x, _y; diff --git a/spine-cpp/spine-cpp/include/spine/SkeletonBinary.h b/spine-cpp/spine-cpp/include/spine/SkeletonBinary.h index 65891fea0..134b4ad6f 100644 --- a/spine-cpp/spine-cpp/include/spine/SkeletonBinary.h +++ b/spine-cpp/spine-cpp/include/spine/SkeletonBinary.h @@ -31,7 +31,7 @@ #define Spine_SkeletonBinary_h #include -#include +#include #include #include #include @@ -225,7 +225,7 @@ namespace spine { }; AttachmentLoader *_attachmentLoader; - Vector _linkedMeshes; + Array _linkedMeshes; String _error; float _scale; const bool _ownsLoader; @@ -239,17 +239,17 @@ namespace spine { Sequence *readSequence(DataInput &input); - int readVertices(DataInput &input, Vector &vertices, Vector &bones, bool weighted); + int readVertices(DataInput &input, Array &vertices, Array &bones, bool weighted); - void readFloatArray(DataInput &input, int n, float scale, Vector &array); + void readFloatArray(DataInput &input, int n, float scale, Array &array); - void readShortArray(DataInput &input, Vector &array, int n); + void readShortArray(DataInput &input, Array &array, int n); Animation *readAnimation(DataInput &input, const String &name, SkeletonData &skeletonData); - void readTimeline(DataInput &input, Vector &timelines, CurveTimeline1 &timeline, float scale); + void readTimeline(DataInput &input, Array &timelines, CurveTimeline1 &timeline, float scale); - void readTimeline(DataInput &input, Vector &timelines, BoneTimeline2 &timeline, float scale); + void readTimeline(DataInput &input, Array &timelines, BoneTimeline2 &timeline, float scale); void setBezier(DataInput &input, CurveTimeline &timeline, int bezier, int frame, int value, float time1, float time2, diff --git a/spine-cpp/spine-cpp/include/spine/SkeletonBounds.h b/spine-cpp/spine-cpp/include/spine/SkeletonBounds.h index c1dc9c62f..b91617b2b 100644 --- a/spine-cpp/spine-cpp/include/spine/SkeletonBounds.h +++ b/spine-cpp/spine-cpp/include/spine/SkeletonBounds.h @@ -30,7 +30,7 @@ #ifndef Spine_SkeletonBounds_h #define Spine_SkeletonBounds_h -#include +#include #include #include @@ -88,11 +88,11 @@ namespace spine { /// Returns the bounding box for the given polygon or null. Requires a call to update() first. BoundingBoxAttachment * getBoundingBox(Polygon *polygon); - /// Returns all polygons or an empty vector. Requires a call to update() first. - Vector &getPolygons(); + /// Returns all polygons or an empty array. Requires a call to update() first. + Array &getPolygons(); /// Returns all bounding boxes. Requires a call to update() first. - Vector &getBoundingBoxes(); + Array &getBoundingBoxes(); /// The left edge of the axis aligned bounding box. float getMinX(); @@ -114,8 +114,8 @@ namespace spine { private: Pool _polygonPool; - Vector _boundingBoxes; - Vector _polygons; + Array _boundingBoxes; + Array _polygons; float _minX, _minY, _maxX, _maxY; void aabbCompute(); @@ -123,7 +123,7 @@ namespace spine { class Polygon : public SpineObject { public: - Vector _vertices; + Array _vertices; int _count; Polygon() : _count(0) { diff --git a/spine-cpp/spine-cpp/include/spine/SkeletonClipping.h b/spine-cpp/spine-cpp/include/spine/SkeletonClipping.h index b955c087f..1891b33d4 100644 --- a/spine-cpp/spine-cpp/include/spine/SkeletonClipping.h +++ b/spine-cpp/spine-cpp/include/spine/SkeletonClipping.h @@ -30,7 +30,7 @@ #ifndef Spine_SkeletonClipping_h #define Spine_SkeletonClipping_h -#include +#include #include namespace spine { @@ -55,33 +55,33 @@ namespace spine { clipTriangles(float *vertices, unsigned short *triangles, size_t trianglesLength, float *uvs, size_t stride); bool - clipTriangles(Vector &vertices, Vector &triangles, Vector &uvs, size_t stride); + clipTriangles(Array &vertices, Array &triangles, Array &uvs, size_t stride); bool isClipping(); - Vector &getClippedVertices(); + Array &getClippedVertices(); - Vector &getClippedTriangles(); + Array &getClippedTriangles(); - Vector &getClippedUVs(); + Array &getClippedUVs(); private: Triangulator _triangulator; - Vector _clippingPolygon; - Vector _clipOutput; - Vector _clippedVertices; - Vector _clippedTriangles; - Vector _clippedUVs; - Vector _scratch; + Array _clippingPolygon; + Array _clipOutput; + Array _clippedVertices; + Array _clippedTriangles; + Array _clippedUVs; + Array _scratch; ClippingAttachment *_clipAttachment; - Vector *> *_clippingPolygons; + Array *> *_clippingPolygons; /** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping * area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */ - bool clip(float x1, float y1, float x2, float y2, float x3, float y3, Vector *clippingArea, - Vector *output); + bool clip(float x1, float y1, float x2, float y2, float x3, float y3, Array *clippingArea, + Array *output); - static void makeClockwise(Vector &polygon); + static void makeClockwise(Array &polygon); }; } diff --git a/spine-cpp/spine-cpp/include/spine/SkeletonData.h b/spine-cpp/spine-cpp/include/spine/SkeletonData.h index afe5f5681..f5fda87ea 100644 --- a/spine-cpp/spine-cpp/include/spine/SkeletonData.h +++ b/spine-cpp/spine-cpp/include/spine/SkeletonData.h @@ -30,7 +30,7 @@ #ifndef Spine_SkeletonData_h #define Spine_SkeletonData_h -#include +#include #include #include @@ -107,13 +107,13 @@ namespace spine { void setName(const String &inValue); /// The skeleton's bones, sorted parent first. The root bone is always the first bone. - Vector &getBones(); + Array &getBones(); /// The skeleton's slots in the setup pose draw order. - Vector &getSlots(); + Array &getSlots(); /// All skins, including the default skin. - Vector &getSkins(); + Array &getSkins(); /// The skeleton's default skin. /// By default this skin contains all attachments that were not in a skin in Spine. @@ -123,21 +123,21 @@ namespace spine { void setDefaultSkin(Skin *inValue); /// The skeleton's events. - Vector &getEvents(); + Array &getEvents(); /// The skeleton's animations. - Vector &getAnimations(); + Array &getAnimations(); - Vector &getIkConstraints(); + Array &getIkConstraints(); - Vector &getTransformConstraints(); + Array &getTransformConstraints(); - Vector &getPathConstraints(); + Array &getPathConstraints(); - Vector &getPhysicsConstraints(); + Array &getPhysicsConstraints(); /// The skeleton's constraints. - Vector &getConstraints(); + Array &getConstraints(); /// Finds a constraint by name and type. /// @return May be NULL. @@ -206,22 +206,22 @@ namespace spine { private: String _name; - Vector _bones; // Ordered parents first - Vector _slots; // Setup pose draw order. - Vector _skins; + Array _bones; // Ordered parents first + Array _slots; // Setup pose draw order. + Array _skins; Skin *_defaultSkin; - Vector _events; - Vector _animations; - Vector _ikConstraints; - Vector _transformConstraints; - Vector _pathConstraints; - Vector _physicsConstraints; - Vector _constraints; + Array _events; + Array _animations; + Array _ikConstraints; + Array _transformConstraints; + Array _pathConstraints; + Array _physicsConstraints; + Array _constraints; float _x, _y, _width, _height; float _referenceScale; String _version; String _hash; - Vector _strings; + Array _strings; // Nonessential. float _fps; diff --git a/spine-cpp/spine-cpp/include/spine/SkeletonJson.h b/spine-cpp/spine-cpp/include/spine/SkeletonJson.h index 764c6de53..54ba2561c 100644 --- a/spine-cpp/spine-cpp/include/spine/SkeletonJson.h +++ b/spine-cpp/spine-cpp/include/spine/SkeletonJson.h @@ -30,7 +30,7 @@ #ifndef Spine_SkeletonJson_h #define Spine_SkeletonJson_h -#include +#include #include #include @@ -83,7 +83,7 @@ namespace spine { private: AttachmentLoader *_attachmentLoader; - Vector _linkedMeshes; + Array _linkedMeshes; float _scale; const bool _ownsLoader; String _error; @@ -99,10 +99,10 @@ namespace spine { readCurve(Json *curve, CurveTimeline *timeline, int bezier, int frame, int value, float time1, float time2, float value1, float value2, float scale); - static void readTimeline(Vector &timelines, Json *keyMap, CurveTimeline1 *timeline, float defaultValue, float scale); + static void readTimeline(Array &timelines, Json *keyMap, CurveTimeline1 *timeline, float defaultValue, float scale); static void - readTimeline(Vector &timelines, Json *keyMap, CurveTimeline2 *timeline, const char *name1, const char *name2, float defaultValue, + readTimeline(Array &timelines, Json *keyMap, CurveTimeline2 *timeline, const char *name1, const char *name2, float defaultValue, float scale); Animation *readAnimation(Json *root, SkeletonData *skeletonData); @@ -113,7 +113,7 @@ namespace spine { void setError(Json *root, const String &value1, const String &value2); - int findSlotIndex(SkeletonData *skeletonData, const String &slotName, Vector timelines); + int findSlotIndex(SkeletonData *skeletonData, const String &slotName, Array timelines); }; } diff --git a/spine-cpp/spine-cpp/include/spine/SkeletonRenderer.h b/spine-cpp/spine-cpp/include/spine/SkeletonRenderer.h index 7da2b62b4..72a50751c 100644 --- a/spine-cpp/spine-cpp/include/spine/SkeletonRenderer.h +++ b/spine-cpp/spine-cpp/include/spine/SkeletonRenderer.h @@ -59,10 +59,10 @@ namespace spine { RenderCommand *render(Skeleton &skeleton); private: BlockAllocator _allocator; - Vector _worldVertices; - Vector _quadIndices; + Array _worldVertices; + Array _quadIndices; SkeletonClipping _clipping; - Vector _renderCommands; + Array _renderCommands; }; } diff --git a/spine-cpp/spine-cpp/include/spine/Skin.h b/spine-cpp/spine-cpp/include/spine/Skin.h index 9b2383c7c..19e3169a8 100644 --- a/spine-cpp/spine-cpp/include/spine/Skin.h +++ b/spine-cpp/spine-cpp/include/spine/Skin.h @@ -30,7 +30,7 @@ #ifndef Spine_Skin_h #define Spine_Skin_h -#include +#include #include #include @@ -89,11 +89,11 @@ namespace spine { } protected: - Entries(Vector > &buckets) : _buckets(buckets), _slotIndex(0), _bucketIndex(0) { + Entries(Array > &buckets) : _buckets(buckets), _slotIndex(0), _bucketIndex(0) { } private: - Vector > &_buckets; + Array > &_buckets; size_t _slotIndex; size_t _bucketIndex; }; @@ -111,9 +111,9 @@ namespace spine { private: - int findInBucket(Vector &, const String &attachmentName); + int findInBucket(Array &, const String &attachmentName); - Vector > _buckets; + Array > _buckets; }; explicit Skin(const String &name); @@ -133,12 +133,12 @@ namespace spine { /// Finds the skin keys for a given slot. The results are added to the passed array of names. /// @param slotIndex The target slotIndex. To find the slot index, use SkeletonData::findSlot and SlotData::getIndex. /// @param names Found skin key names will be added to this array. - void findNamesForSlot(size_t slotIndex, Vector &names); + void findNamesForSlot(size_t slotIndex, Array &names); /// Finds the attachments for a given slot. The results are added to the passed array of Attachments. /// @param slotIndex The target slotIndex. To find the slot index, use SkeletonData::findSlot and SlotData::getIndex. /// @param attachments Found Attachments will be added to this array. - void findAttachmentsForSlot(size_t slotIndex, Vector &attachments); + void findAttachmentsForSlot(size_t slotIndex, Array &attachments); const String &getName(); @@ -150,17 +150,17 @@ namespace spine { AttachmentMap::Entries getAttachments(); - Vector &getBones(); + Array &getBones(); - Vector &getConstraints(); + Array &getConstraints(); Color &getColor() { return _color; } private: const String _name; AttachmentMap _attachments; - Vector _bones; - Vector _constraints; + Array _bones; + Array _constraints; Color _color; /// Attach all attachments from this skin if the corresponding attachment from the old skin is currently attached. diff --git a/spine-cpp/spine-cpp/include/spine/SliderMixTimeline.h b/spine-cpp/spine-cpp/include/spine/SliderMixTimeline.h index f0231647e..c86937c5b 100644 --- a/spine-cpp/spine-cpp/include/spine/SliderMixTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/SliderMixTimeline.h @@ -46,7 +46,7 @@ namespace spine { virtual ~SliderMixTimeline(); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; }; } diff --git a/spine-cpp/spine-cpp/include/spine/SliderTimeline.h b/spine-cpp/spine-cpp/include/spine/SliderTimeline.h index d1213a56b..3b3e8358a 100644 --- a/spine-cpp/spine-cpp/include/spine/SliderTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/SliderTimeline.h @@ -46,7 +46,7 @@ namespace spine { virtual ~SliderTimeline(); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; }; } diff --git a/spine-cpp/spine-cpp/include/spine/Slot.h b/spine-cpp/spine-cpp/include/spine/Slot.h index cae449f24..8127ff5c2 100644 --- a/spine-cpp/spine-cpp/include/spine/Slot.h +++ b/spine-cpp/spine-cpp/include/spine/Slot.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include namespace spine { diff --git a/spine-cpp/spine-cpp/include/spine/SlotCurveTimeline.h b/spine-cpp/spine-cpp/include/spine/SlotCurveTimeline.h index 3230fca35..4a44c7de4 100644 --- a/spine-cpp/spine-cpp/include/spine/SlotCurveTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/SlotCurveTimeline.h @@ -49,7 +49,7 @@ namespace spine { virtual ~SlotCurveTimeline(); - virtual void apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, + virtual void apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; protected: diff --git a/spine-cpp/spine-cpp/include/spine/SlotPose.h b/spine-cpp/spine-cpp/include/spine/SlotPose.h index a4ea59aa7..16362ceee 100644 --- a/spine-cpp/spine-cpp/include/spine/SlotPose.h +++ b/spine-cpp/spine-cpp/include/spine/SlotPose.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include namespace spine { class Attachment; @@ -60,7 +60,7 @@ namespace spine { bool _hasDarkColor; Attachment* _attachment; int _sequenceIndex; - Vector _deform; + Array _deform; public: SlotPose(); @@ -98,7 +98,7 @@ namespace spine { /// weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions. /// /// See VertexAttachment::computeWorldVertices() and DeformTimeline. - Vector& getDeform(); + Array& getDeform(); }; } diff --git a/spine-cpp/spine-cpp/include/spine/TextureRegion.h b/spine-cpp/spine-cpp/include/spine/TextureRegion.h index 1082c5de2..878e1de3b 100644 --- a/spine-cpp/spine-cpp/include/spine/TextureRegion.h +++ b/spine-cpp/spine-cpp/include/spine/TextureRegion.h @@ -30,7 +30,7 @@ #ifndef Spine_TextureRegion_h #define Spine_TextureRegion_h -#include +#include namespace spine { class SP_API TextureRegion : public SpineObject { diff --git a/spine-cpp/spine-cpp/include/spine/Timeline.h b/spine-cpp/spine-cpp/include/spine/Timeline.h index 90a44b613..ef8ec60f5 100644 --- a/spine-cpp/spine-cpp/include/spine/Timeline.h +++ b/spine-cpp/spine-cpp/include/spine/Timeline.h @@ -31,7 +31,7 @@ #define Spine_Timeline_h #include -#include +#include #include #include #include @@ -62,24 +62,24 @@ namespace spine { /// @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions such as DrawOrderTimeline and AttachmentTimeline. /// @param appliedPose True to modify the applied pose. virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) = 0; size_t getFrameEntries(); size_t getFrameCount(); - Vector &getFrames(); + Array &getFrames(); float getDuration(); - virtual Vector &getPropertyIds(); + virtual Array &getPropertyIds(); protected: void setPropertyIds(PropertyId propertyIds[], size_t propertyIdsCount); - Vector _propertyIds; - Vector _frames; + Array _propertyIds; + Array _frames; size_t _frameEntries; }; } diff --git a/spine-cpp/spine-cpp/include/spine/TransformConstraint.h b/spine-cpp/spine-cpp/include/spine/TransformConstraint.h index 1fe31113d..4c5e0a824 100644 --- a/spine-cpp/spine-cpp/include/spine/TransformConstraint.h +++ b/spine-cpp/spine-cpp/include/spine/TransformConstraint.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include namespace spine { class Skeleton; @@ -59,7 +59,7 @@ namespace spine { bool isSourceActive() override; /// The bones that will be modified by this transform constraint. - Vector& getBones(); + Array& getBones(); /// The bone whose world transform will be copied to the constrained bones. Bone* getSource(); @@ -67,7 +67,7 @@ namespace spine { void setSource(Bone* source); private: - Vector _bones; + Array _bones; Bone* _source; }; } diff --git a/spine-cpp/spine-cpp/include/spine/TransformConstraintData.h b/spine-cpp/spine-cpp/include/spine/TransformConstraintData.h index 32ae9b7c3..310a34ae0 100644 --- a/spine-cpp/spine-cpp/include/spine/TransformConstraintData.h +++ b/spine-cpp/spine-cpp/include/spine/TransformConstraintData.h @@ -32,7 +32,7 @@ #include #include -#include +#include #include namespace spine { @@ -50,7 +50,7 @@ namespace spine { float _offset; /// Constrained properties. - Vector _to; + Array _to; FromProperty(); virtual ~FromProperty(); @@ -169,7 +169,7 @@ namespace spine { virtual Constraint* create(Skeleton& skeleton) override; /// The bones that will be modified by this transform constraint. - Vector& getBones(); + Array& getBones(); /// The bone whose world transform will be copied to the constrained bones. BoneData* getSource(); @@ -216,14 +216,14 @@ namespace spine { void setClamp(bool clamp); /// The mapping of transform properties to other transform properties. - Vector& getProperties(); + Array& getProperties(); private: - Vector _bones; + Array _bones; BoneData* _source; float _offsets[6]; // [rotation, x, y, scaleX, scaleY, shearY] bool _localSource, _localTarget, _additive, _clamp; - Vector _properties; + Array _properties; }; } diff --git a/spine-cpp/spine-cpp/include/spine/TransformConstraintTimeline.h b/spine-cpp/spine-cpp/include/spine/TransformConstraintTimeline.h index 81a91a2f2..4587e729c 100644 --- a/spine-cpp/spine-cpp/include/spine/TransformConstraintTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/TransformConstraintTimeline.h @@ -51,7 +51,7 @@ namespace spine { virtual ~TransformConstraintTimeline(); virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, + apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) override; /// Sets the time, rotate mix, translate mix, scale mix, and shear mix for the specified frame. diff --git a/spine-cpp/spine-cpp/include/spine/Triangulator.h b/spine-cpp/spine-cpp/include/spine/Triangulator.h index 801167d86..31a2eb498 100644 --- a/spine-cpp/spine-cpp/include/spine/Triangulator.h +++ b/spine-cpp/spine-cpp/include/spine/Triangulator.h @@ -30,7 +30,7 @@ #ifndef Spine_Triangulator_h #define Spine_Triangulator_h -#include +#include #include namespace spine { @@ -38,28 +38,28 @@ namespace spine { public: ~Triangulator(); - Vector &triangulate(Vector &vertices); + Array &triangulate(Array &vertices); - Vector* > & - decompose(Vector + Array* > & + decompose(Array &vertices, - Vector &triangles + Array &triangles ); private: - Vector* > + Array* > _convexPolygons; - Vector* > + Array* > _convexPolygonsIndices; - Vector _indices; - Vector _isConcaveArray; - Vector _triangles; + Array _indices; + Array _isConcaveArray; + Array _triangles; - Pool > _polygonPool; - Pool > _polygonIndicesPool; + Pool > _polygonPool; + Pool > _polygonIndicesPool; - static bool isConcave(int index, int vertexCount, Vector &vertices, Vector &indices); + static bool isConcave(int index, int vertexCount, Array &vertices, Array &indices); static bool positiveArea(float p1x, float p1y, float p2x, float p2y, float p3x, float p3y); diff --git a/spine-cpp/spine-cpp/include/spine/VertexAttachment.h b/spine-cpp/spine-cpp/include/spine/VertexAttachment.h index bbd2d07a4..6a0ad01ec 100644 --- a/spine-cpp/spine-cpp/include/spine/VertexAttachment.h +++ b/spine-cpp/spine-cpp/include/spine/VertexAttachment.h @@ -32,7 +32,7 @@ #include -#include +#include namespace spine { class Slot; @@ -68,19 +68,19 @@ namespace spine { virtual void computeWorldVertices(Skeleton &skeleton, Slot &slot, size_t start, size_t count, float *worldVertices, size_t offset, size_t stride = 2); - virtual void computeWorldVertices(Skeleton &skeleton, Slot &slot, size_t start, size_t count, Vector &worldVertices, size_t offset, + virtual void computeWorldVertices(Skeleton &skeleton, Slot &slot, size_t start, size_t count, Array &worldVertices, size_t offset, size_t stride = 2); /// Gets a unique ID for this attachment. int getId(); - Vector &getBones(); + Array &getBones(); - void setBones(Vector &bones); + void setBones(Array &bones); - Vector &getVertices(); + Array &getVertices(); - void setVertices(Vector &vertices); + void setVertices(Array &vertices); size_t getWorldVerticesLength(); @@ -93,8 +93,8 @@ namespace spine { void copyTo(VertexAttachment *other); protected: - Vector _bones; - Vector _vertices; + Array _bones; + Array _vertices; size_t _worldVerticesLength; Attachment *_timelineAttachment; diff --git a/spine-cpp/spine-cpp/include/spine/Vertices.h b/spine-cpp/spine-cpp/include/spine/Vertices.h index 1f3bd86b7..8b0f37f52 100644 --- a/spine-cpp/spine-cpp/include/spine/Vertices.h +++ b/spine-cpp/spine-cpp/include/spine/Vertices.h @@ -30,13 +30,13 @@ #ifndef Spine_Vertices_h #define Spine_Vertices_h -#include +#include namespace spine { class SP_API Vertices : public SpineObject { public: - Vector _bones; - Vector _weights; + Array _bones; + Array _weights; }; } diff --git a/spine-cpp/spine-cpp/include/spine/spine.h b/spine-cpp/spine-cpp/include/spine/spine.h index fa95cdf97..667e5838c 100644 --- a/spine-cpp/spine-cpp/include/spine/spine.h +++ b/spine-cpp/spine-cpp/include/spine/spine.h @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #include #include @@ -128,7 +128,7 @@ #include #include #include -#include +#include #include #include diff --git a/spine-cpp/spine-cpp/src/spine/Animation.cpp b/spine-cpp/spine-cpp/src/spine/Animation.cpp index df24c6009..01a305d8d 100644 --- a/spine-cpp/spine-cpp/src/spine/Animation.cpp +++ b/spine-cpp/spine-cpp/src/spine/Animation.cpp @@ -35,13 +35,13 @@ #include #include -#include +#include #include using namespace spine; -Animation::Animation(const String &name, Vector &timelines, float duration) : _timelines(), +Animation::Animation(const String &name, Array &timelines, float duration) : _timelines(), _timelineIds(), _bones(), _duration(duration), @@ -49,7 +49,7 @@ Animation::Animation(const String &name, Vector &timelines, float du setTimelines(timelines); } -bool Animation::hasTimeline(Vector &ids) { +bool Animation::hasTimeline(Array &ids) { for (size_t i = 0; i < ids.size(); i++) { if (_timelineIds.containsKey(ids[i])) return true; } @@ -57,10 +57,10 @@ bool Animation::hasTimeline(Vector &ids) { } Animation::~Animation() { - ContainerUtil::cleanUpVectorOfPointers(_timelines); + ArrayUtils::deleteElements(_timelines); } -void Animation::apply(Skeleton &skeleton, float lastTime, float time, bool loop, Vector *pEvents, float alpha, +void Animation::apply(Skeleton &skeleton, float lastTime, float time, bool loop, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { if (loop && _duration != 0) { time = MathUtil::fmod(time, _duration); @@ -78,11 +78,11 @@ const String &Animation::getName() { return _name; } -const Vector &Animation::getBones() { +const Array &Animation::getBones() { return _bones; } -Vector &Animation::getTimelines() { +Array &Animation::getTimelines() { return _timelines; } @@ -94,7 +94,7 @@ void Animation::setDuration(float inValue) { _duration = inValue; } -int Animation::search(Vector &frames, float target) { +int Animation::search(Array &frames, float target) { size_t n = (int) frames.size(); for (size_t i = 1; i < n; i++) { if (frames[i] > target) return (int) (i - 1); @@ -102,14 +102,14 @@ int Animation::search(Vector &frames, float target) { return (int) (n - 1); } -int Animation::search(Vector &frames, float target, int step) { +int Animation::search(Array &frames, float target, int step) { size_t n = frames.size(); for (size_t i = step; i < n; i += step) if (frames[i] > target) return (int) (i - step); return (int) (n - step); } -void Animation::setTimelines(Vector &timelines) { +void Animation::setTimelines(Array &timelines) { _timelines = timelines; size_t n = timelines.size(); @@ -119,7 +119,7 @@ void Animation::setTimelines(Vector &timelines) { HashMap boneSet; for (size_t i = 0; i < n; i++) { Timeline *timeline = timelines[i]; - Vector &propertyIds = timeline->getPropertyIds(); + Array &propertyIds = timeline->getPropertyIds(); for (size_t ii = 0; ii < propertyIds.size(); ii++) { _timelineIds.put(propertyIds[ii], true); } diff --git a/spine-cpp/spine-cpp/src/spine/AnimationState.cpp b/spine-cpp/spine-cpp/src/spine/AnimationState.cpp index 8d65edbae..ef933c494 100644 --- a/spine-cpp/spine-cpp/src/spine/AnimationState.cpp +++ b/spine-cpp/spine-cpp/src/spine/AnimationState.cpp @@ -477,13 +477,13 @@ bool AnimationState::apply(Skeleton &skeleton) { // apply current entry. float animationLast = current._animationLast, animationTime = current.getAnimationTime(); float applyTime = animationTime; - Vector *applyEvents = &_events; + Array *applyEvents = &_events; if (current._reverse) { applyTime = current._animation->getDuration() - applyTime; applyEvents = NULL; } size_t timelineCount = current._animation->_timelines.size(); - Vector &timelines = current._animation->_timelines; + Array &timelines = current._animation->_timelines; if ((i == 0 && alpha == 1) || blend == MixBlend_Add) { if (i == 0) attachments = true; for (size_t ii = 0; ii < timelineCount; ++ii) { @@ -495,12 +495,12 @@ bool AnimationState::apply(Skeleton &skeleton) { timeline->apply(skeleton, animationLast, applyTime, applyEvents, alpha, blend, MixDirection_In, false); } } else { - Vector &timelineMode = current._timelineMode; + Array &timelineMode = current._timelineMode; bool shortestRotation = current._shortestRotation; bool firstFrame = !shortestRotation && current._timelinesRotation.size() != timelines.size() << 1; if (firstFrame) current._timelinesRotation.setSize(timelines.size() << 1, 0); - Vector &timelinesRotation = current._timelinesRotation; + Array &timelinesRotation = current._timelinesRotation; for (size_t ii = 0; ii < timelineCount; ++ii) { Timeline *timeline = timelines[ii]; @@ -527,7 +527,7 @@ bool AnimationState::apply(Skeleton &skeleton) { } int setupState = _unkeyedState + Setup; - Vector &slots = skeleton.getSlots(); + Array &slots = skeleton.getSlots(); for (int i = 0, n = (int) slots.size(); i < n; i++) { Slot *slot = slots[i]; if (slot->_attachmentState == setupState) { @@ -676,7 +676,7 @@ AnimationStateData *AnimationState::getData() { return _data; } -Vector &AnimationState::getTracks() { +Array &AnimationState::getTracks() { return _tracks; } @@ -720,7 +720,7 @@ void AnimationState::disposeTrackEntry(TrackEntry *entry) { } Animation *AnimationState::getEmptyAnimation() { - static Vector timelines; + static Array timelines; static Animation ret(String(""), timelines, 0); return &ret; } @@ -730,7 +730,7 @@ void AnimationState::applyAttachmentTimeline(AttachmentTimeline *attachmentTimel Slot *slot = skeleton.getSlots()[attachmentTimeline->getSlotIndex()]; if (!slot->getBone().isActive()) return; - Vector &frames = attachmentTimeline->getFrames(); + Array &frames = attachmentTimeline->getFrames(); if (time < frames[0]) { if (blend == MixBlend_Setup || blend == MixBlend_First) setAttachment(skeleton, *slot, slot->getData().getAttachmentName(), attachments); @@ -745,7 +745,7 @@ void AnimationState::applyAttachmentTimeline(AttachmentTimeline *attachmentTimel void AnimationState::applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleton &skeleton, float time, float alpha, - MixBlend blend, Vector &timelinesRotation, size_t i, bool firstFrame) { + MixBlend blend, Array &timelinesRotation, size_t i, bool firstFrame) { if (firstFrame) timelinesRotation[i] = 0; if (alpha == 1) { @@ -757,7 +757,7 @@ void AnimationState::applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleto if (!bone->isActive()) return; BoneLocal &pose = bone->_pose; BoneLocal &setup = bone->_data._setup; - Vector &frames = rotateTimeline->_frames; + Array &frames = rotateTimeline->_frames; float r1, r2; if (time < frames[0]) { switch (blend) { @@ -856,12 +856,12 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle } bool attachments = mix < from->_mixAttachmentThreshold, drawOrder = mix < from->_mixDrawOrderThreshold; - Vector &timelines = from->_animation->_timelines; + Array &timelines = from->_animation->_timelines; size_t timelineCount = timelines.size(); float alphaHold = from->_alpha * to->_interruptAlpha, alphaMix = alphaHold * (1 - mix); float animationLast = from->_animationLast, animationTime = from->getAnimationTime(); float applyTime = animationTime; - Vector *events = NULL; + Array *events = NULL; if (from->_reverse) { applyTime = from->_animation->_duration - applyTime; } else { @@ -872,14 +872,14 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBle for (size_t i = 0; i < timelineCount; i++) timelines[i]->apply(skeleton, animationLast, applyTime, events, alphaMix, blend, MixDirection_Out, false); } else { - Vector &timelineMode = from->_timelineMode; - Vector &timelineHoldMix = from->_timelineHoldMix; + Array &timelineMode = from->_timelineMode; + Array &timelineHoldMix = from->_timelineHoldMix; bool shortestRotation = from->_shortestRotation; bool firstFrame = !shortestRotation && from->_timelinesRotation.size() != timelines.size() << 1; if (firstFrame) from->_timelinesRotation.setSize(timelines.size() << 1, 0); - Vector &timelinesRotation = from->_timelinesRotation; + Array &timelinesRotation = from->_timelinesRotation; from->_totalAlpha = 0; for (size_t i = 0; i < timelineCount; i++) { @@ -1079,11 +1079,11 @@ void AnimationState::animationsChanged() { void AnimationState::computeHold(TrackEntry *entry) { TrackEntry *to = entry->_mixingTo; - Vector &timelines = entry->_animation->_timelines; + Array &timelines = entry->_animation->_timelines; size_t timelinesCount = timelines.size(); - Vector &timelineMode = entry->_timelineMode; + Array &timelineMode = entry->_timelineMode; timelineMode.setSize(timelinesCount, 0); - Vector &timelineHoldMix = entry->_timelineHoldMix; + Array &timelineHoldMix = entry->_timelineHoldMix; timelineHoldMix.setSize(timelinesCount, 0); if (to != NULL && to->_holdPrevious) { @@ -1098,7 +1098,7 @@ void AnimationState::computeHold(TrackEntry *entry) { continue_outer: for (; i < timelinesCount; ++i) { Timeline *timeline = timelines[i]; - Vector &ids = timeline->getPropertyIds(); + Array &ids = timeline->getPropertyIds(); if (!_propertyIDs.addAll(ids, true)) { timelineMode[i] = Subsequent; } else { diff --git a/spine-cpp/spine-cpp/src/spine/Atlas.cpp b/spine-cpp/spine-cpp/src/spine/Atlas.cpp index b317f91dd..41fa1d5fb 100644 --- a/spine-cpp/spine-cpp/src/spine/Atlas.cpp +++ b/spine-cpp/spine-cpp/src/spine/Atlas.cpp @@ -28,7 +28,7 @@ *****************************************************************************/ #include -#include +#include #include #include @@ -72,8 +72,8 @@ Atlas::~Atlas() { _textureLoader->unload(_pages[i]->texture); } } - ContainerUtil::cleanUpVectorOfPointers(_pages); - ContainerUtil::cleanUpVectorOfPointers(_regions); + ArrayUtils::deleteElements(_pages); + ArrayUtils::deleteElements(_regions); } void Atlas::flipV() { @@ -91,11 +91,11 @@ AtlasRegion *Atlas::findRegion(const String &name) { return NULL; } -Vector &Atlas::getPages() { +Array &Atlas::getPages() { return _pages; } -Vector &Atlas::getRegions() { +Array &Atlas::getRegions() { return _regions; } diff --git a/spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp b/spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp index 94fd91dae..ba41e0104 100644 --- a/spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp +++ b/spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp @@ -44,7 +44,7 @@ AtlasAttachmentLoader::AtlasAttachmentLoader(Atlas *atlas) : AttachmentLoader(), } bool loadSequence(Atlas *atlas, const String &basePath, Sequence *sequence) { - Vector ®ions = sequence->getRegions(); + Array ®ions = sequence->getRegions(); for (int i = 0, n = (int) regions.size(); i < n; i++) { String path = sequence->getPath(basePath, i); regions[i] = atlas->findRegion(path); diff --git a/spine-cpp/spine-cpp/src/spine/AttachmentTimeline.cpp b/spine-cpp/spine-cpp/src/spine/AttachmentTimeline.cpp index 137b73ad1..25b7811d8 100644 --- a/spine-cpp/spine-cpp/src/spine/AttachmentTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/AttachmentTimeline.cpp @@ -60,7 +60,7 @@ void AttachmentTimeline::setAttachment(Skeleton &skeleton, SlotPose &pose, Strin pose.setAttachment(attachmentName == NULL || attachmentName->isEmpty() ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName)); } -void AttachmentTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, +void AttachmentTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); @@ -84,6 +84,6 @@ void AttachmentTimeline::setFrame(int frame, float time, const String &attachmen _attachmentNames[frame] = attachmentName; } -Vector &AttachmentTimeline::getAttachmentNames() { +Array &AttachmentTimeline::getAttachmentNames() { return _attachmentNames; } diff --git a/spine-cpp/spine-cpp/src/spine/Bone.cpp b/spine-cpp/spine-cpp/src/spine/Bone.cpp index 4f9dada99..b79cd8994 100644 --- a/spine-cpp/spine-cpp/src/spine/Bone.cpp +++ b/spine-cpp/spine-cpp/src/spine/Bone.cpp @@ -61,6 +61,6 @@ Bone *Bone::getParent() { return _parent; } -Vector &Bone::getChildren() { +Array &Bone::getChildren() { return _children; } \ No newline at end of file diff --git a/spine-cpp/spine-cpp/src/spine/BonePose.cpp b/spine-cpp/spine-cpp/src/spine/BonePose.cpp index aa64dbda2..3728b63ea 100644 --- a/spine-cpp/spine-cpp/src/spine/BonePose.cpp +++ b/spine-cpp/spine-cpp/src/spine/BonePose.cpp @@ -257,7 +257,7 @@ void BonePose::modifyWorld(int update) { } void BonePose::resetWorld(int update) { - Vector &children = _bone->getChildren(); + Array &children = _bone->getChildren(); for (size_t i = 0, n = children.size(); i < n; i++) { BonePose &child = children[i]->getAppliedPose(); if (child._world == update) { diff --git a/spine-cpp/spine-cpp/src/spine/BoneTimeline.cpp b/spine-cpp/spine-cpp/src/spine/BoneTimeline.cpp index 474acde4b..bd2c42985 100644 --- a/spine-cpp/spine-cpp/src/spine/BoneTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/BoneTimeline.cpp @@ -47,7 +47,7 @@ BoneTimeline1::BoneTimeline1(size_t frameCount, size_t bezierCount, int boneInde setPropertyIds(ids, 1); } -void BoneTimeline1::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, +void BoneTimeline1::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); @@ -65,7 +65,7 @@ BoneTimeline2::BoneTimeline2(size_t frameCount, size_t bezierCount, int boneInde setPropertyIds(ids, 2); } -void BoneTimeline2::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, +void BoneTimeline2::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); diff --git a/spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp b/spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp index d62472b55..a0b525e3e 100644 --- a/spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp @@ -216,7 +216,7 @@ AlphaTimeline::AlphaTimeline(size_t frameCount, size_t bezierCount, int slotInde AlphaTimeline::~AlphaTimeline() { } -void AlphaTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, +void AlphaTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); diff --git a/spine-cpp/spine-cpp/src/spine/CurveTimeline.cpp b/spine-cpp/spine-cpp/src/spine/CurveTimeline.cpp index 6371dc61f..95124862a 100644 --- a/spine-cpp/spine-cpp/src/spine/CurveTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/CurveTimeline.cpp @@ -90,7 +90,7 @@ float CurveTimeline::getBezierValue(float time, size_t frameIndex, size_t valueO return y + (time - x) / (_frames[frameIndex] - x) * (_frames[frameIndex + valueOffset] - y); } -Vector &CurveTimeline::getCurves() { +Array &CurveTimeline::getCurves() { return _curves; } diff --git a/spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp b/spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp index 55d78201a..40e3ab957 100644 --- a/spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp @@ -50,7 +50,7 @@ DeformTimeline::DeformTimeline(size_t frameCount, size_t bezierCount, int slotIn _vertices.ensureCapacity(frameCount); for (size_t i = 0; i < frameCount; ++i) { - Vector vec; + Array vec; _vertices.add(vec); } } @@ -67,15 +67,15 @@ void DeformTimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, return; } - Vector &deformArray = pose._deform; + Array &deformArray = pose._deform; if (deformArray.size() == 0) { blend = MixBlend_Setup; } - Vector> &vertices = _vertices; + Array> &vertices = _vertices; size_t vertexCount = vertices[0].size(); - Vector &frames = _frames; + Array &frames = _frames; if (time < frames[0]) { switch (blend) { case MixBlend_Setup: @@ -87,10 +87,10 @@ void DeformTimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, return; } deformArray.setSize(vertexCount, 0); - Vector &deform = deformArray; + Array &deform = deformArray; if (vertexAttachment->getBones().size() == 0) { // Unweighted vertex positions. - Vector &setupVertices = vertexAttachment->getVertices(); + Array &setupVertices = vertexAttachment->getVertices(); for (size_t i = 0; i < vertexCount; i++) deform[i] += (setupVertices[i] - deform[i]) * alpha; } else { @@ -109,15 +109,15 @@ void DeformTimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, } deformArray.setSize(vertexCount, 0); - Vector &deform = deformArray; + Array &deform = deformArray; if (time >= frames[frames.size() - 1]) {// Time is after last frame. - Vector &lastVertices = vertices[frames.size() - 1]; + Array &lastVertices = vertices[frames.size() - 1]; if (alpha == 1) { if (blend == MixBlend_Add) { if (vertexAttachment->getBones().size() == 0) { // Unweighted vertex positions, no alpha. - Vector &setupVertices = vertexAttachment->getVertices(); + Array &setupVertices = vertexAttachment->getVertices(); for (size_t i = 0; i < vertexCount; i++) deform[i] += lastVertices[i] - setupVertices[i]; } else { @@ -134,7 +134,7 @@ void DeformTimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, case MixBlend_Setup: { if (vertexAttachment->getBones().size() == 0) { // Unweighted vertex positions, with alpha. - Vector &setupVertices = vertexAttachment->getVertices(); + Array &setupVertices = vertexAttachment->getVertices(); for (size_t i = 0; i < vertexCount; i++) { float setup = setupVertices[i]; deform[i] = setup + (lastVertices[i] - setup) * alpha; @@ -155,7 +155,7 @@ void DeformTimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, case MixBlend_Add: if (vertexAttachment->getBones().size() == 0) { // Unweighted vertex positions, with alpha. - Vector &setupVertices = vertexAttachment->getVertices(); + Array &setupVertices = vertexAttachment->getVertices(); for (size_t i = 0; i < vertexCount; i++) deform[i] += (lastVertices[i] - setupVertices[i]) * alpha; } else { @@ -172,14 +172,14 @@ void DeformTimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, // Interpolate between the previous frame and the current frame. int frame = Animation::search(frames, time); float percent = getCurvePercent(time, frame); - Vector &prevVertices = vertices[frame]; - Vector &nextVertices = vertices[frame + 1]; + Array &prevVertices = vertices[frame]; + Array &nextVertices = vertices[frame + 1]; if (alpha == 1) { if (blend == MixBlend_Add) { if (vertexAttachment->getBones().size() == 0) { // Unweighted vertex positions, no alpha. - Vector &setupVertices = vertexAttachment->getVertices(); + Array &setupVertices = vertexAttachment->getVertices(); for (size_t i = 0; i < vertexCount; i++) { float prev = prevVertices[i]; deform[i] += prev + (nextVertices[i] - prev) * percent - setupVertices[i]; @@ -205,7 +205,7 @@ void DeformTimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, case MixBlend_Setup: { if (vertexAttachment->getBones().size() == 0) { // Unweighted vertex positions, with alpha. - Vector &setupVertices = vertexAttachment->getVertices(); + Array &setupVertices = vertexAttachment->getVertices(); for (size_t i = 0; i < vertexCount; i++) { float prev = prevVertices[i], setup = setupVertices[i]; deform[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha; @@ -230,7 +230,7 @@ void DeformTimeline::apply(Slot &slot, SlotPose &pose, float time, float alpha, case MixBlend_Add: if (vertexAttachment->getBones().size() == 0) { // Unweighted vertex positions, with alpha. - Vector &setupVertices = vertexAttachment->getVertices(); + Array &setupVertices = vertexAttachment->getVertices(); for (size_t i = 0; i < vertexCount; i++) { float prev = prevVertices[i]; deform[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha; @@ -251,7 +251,7 @@ void DeformTimeline::setBezier(size_t bezier, size_t frame, float value, float t float cx2, float cy2, float time2, float value2) { SP_UNUSED(value1); SP_UNUSED(value2); - Vector &curves = _curves; + Array &curves = _curves; size_t i = getFrameCount() + bezier * BEZIER_SIZE; if (value == 0) curves[frame] = BEZIER + (float) i; float tmpx = (time1 - cx1 * 2 + cx2) * 0.03f, tmpy = cy2 * 0.03f - cy1 * 0.06f; @@ -272,7 +272,7 @@ void DeformTimeline::setBezier(size_t bezier, size_t frame, float value, float t } float DeformTimeline::getCurvePercent(float time, int frame) { - Vector &curves = _curves; + Array &curves = _curves; int i = (int) curves[frame]; switch (i) { case LINEAR: { @@ -299,13 +299,13 @@ float DeformTimeline::getCurvePercent(float time, int frame) { return y + (1 - y) * (time - x) / (_frames[frame + getFrameEntries()] - x); } -void DeformTimeline::setFrame(int frame, float time, Vector &vertices) { +void DeformTimeline::setFrame(int frame, float time, Array &vertices) { _frames[frame] = time; _vertices[frame].clear(); _vertices[frame].addAll(vertices); } -Vector> &DeformTimeline::getVertices() { +Array> &DeformTimeline::getVertices() { return _vertices; } diff --git a/spine-cpp/spine-cpp/src/spine/DrawOrderTimeline.cpp b/spine-cpp/spine-cpp/src/spine/DrawOrderTimeline.cpp index 3a560435a..bab7f89b4 100644 --- a/spine-cpp/spine-cpp/src/spine/DrawOrderTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/DrawOrderTimeline.cpp @@ -47,20 +47,20 @@ DrawOrderTimeline::DrawOrderTimeline(size_t frameCount) : Timeline(frameCount, 1 _drawOrders.ensureCapacity(frameCount); for (size_t i = 0; i < frameCount; ++i) { - Vector vec; + Array vec; _drawOrders.add(vec); } } -void DrawOrderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, +void DrawOrderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(appliedPose); SP_UNUSED(lastTime); SP_UNUSED(pEvents); SP_UNUSED(alpha); - Vector &drawOrder = skeleton._drawOrder; - Vector &slots = skeleton._slots; + Array &drawOrder = skeleton._drawOrder; + Array &slots = skeleton._slots; if (direction == MixDirection_Out) { if (blend == MixBlend_Setup) { drawOrder.clear(); @@ -81,7 +81,7 @@ void DrawOrderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Ve return; } - Vector &drawOrderToSetupIndex = _drawOrders[Animation::search(_frames, time)]; + Array &drawOrderToSetupIndex = _drawOrders[Animation::search(_frames, time)]; if (drawOrderToSetupIndex.size() == 0) { drawOrder.clear(); drawOrder.ensureCapacity(slots.size()); @@ -95,7 +95,7 @@ void DrawOrderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Ve } } -void DrawOrderTimeline::setFrame(size_t frame, float time, Vector *drawOrder) { +void DrawOrderTimeline::setFrame(size_t frame, float time, Array *drawOrder) { _frames[frame] = time; _drawOrders[frame].clear(); if (drawOrder != NULL) { @@ -107,6 +107,6 @@ size_t DrawOrderTimeline::getFrameCount() { return _frames.size(); } -Vector> &DrawOrderTimeline::getDrawOrders() { +Array> &DrawOrderTimeline::getDrawOrders() { return _drawOrders; } diff --git a/spine-cpp/spine-cpp/src/spine/EventTimeline.cpp b/spine-cpp/spine-cpp/src/spine/EventTimeline.cpp index 5bf5a93cf..dab32d73b 100644 --- a/spine-cpp/spine-cpp/src/spine/EventTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/EventTimeline.cpp @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include #include @@ -52,14 +52,14 @@ EventTimeline::EventTimeline(size_t frameCount) : Timeline(frameCount, 1) { } EventTimeline::~EventTimeline() { - ContainerUtil::cleanUpVectorOfPointers(_events); + ArrayUtils::deleteElements(_events); } -void EventTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, +void EventTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { if (pEvents == NULL) return; - Vector &events = *pEvents; + Array &events = *pEvents; size_t frameCount = _frames.size(); @@ -100,6 +100,6 @@ size_t EventTimeline::getFrameCount() { return _frames.size(); } -Vector &EventTimeline::getEvents() { +Array &EventTimeline::getEvents() { return _events; } diff --git a/spine-cpp/spine-cpp/src/spine/IkConstraint.cpp b/spine-cpp/spine-cpp/src/spine/IkConstraint.cpp index 8e1d9d134..a0a74ea00 100644 --- a/spine-cpp/spine-cpp/src/spine/IkConstraint.cpp +++ b/spine-cpp/spine-cpp/src/spine/IkConstraint.cpp @@ -87,7 +87,7 @@ IkConstraintData &IkConstraint::getData() { return _data; } -Vector &IkConstraint::getBones() { +Array &IkConstraint::getBones() { return _bones; } diff --git a/spine-cpp/spine-cpp/src/spine/IkConstraintData.cpp b/spine-cpp/spine-cpp/src/spine/IkConstraintData.cpp index 9c57405e3..0510d0b4b 100644 --- a/spine-cpp/spine-cpp/src/spine/IkConstraintData.cpp +++ b/spine-cpp/spine-cpp/src/spine/IkConstraintData.cpp @@ -41,7 +41,7 @@ IkConstraintData::IkConstraintData(const String &name) : ConstraintDataGeneric &IkConstraintData::getBones() { +Array &IkConstraintData::getBones() { return _bones; } diff --git a/spine-cpp/spine-cpp/src/spine/IkConstraintTimeline.cpp b/spine-cpp/spine-cpp/src/spine/IkConstraintTimeline.cpp index b21709068..920b1c6af 100644 --- a/spine-cpp/spine-cpp/src/spine/IkConstraintTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/IkConstraintTimeline.cpp @@ -53,7 +53,7 @@ IkConstraintTimeline::IkConstraintTimeline(size_t frameCount, size_t bezierCount IkConstraintTimeline::~IkConstraintTimeline() { } -void IkConstraintTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, +void IkConstraintTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); diff --git a/spine-cpp/spine-cpp/src/spine/InheritTimeline.cpp b/spine-cpp/spine-cpp/src/spine/InheritTimeline.cpp index b3d4c7bd5..8c87b9900 100644 --- a/spine-cpp/spine-cpp/src/spine/InheritTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/InheritTimeline.cpp @@ -58,7 +58,7 @@ void InheritTimeline::setFrame(int frame, float time, Inherit inherit) { } -void InheritTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, +void InheritTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); diff --git a/spine-cpp/spine-cpp/src/spine/Json.cpp b/spine-cpp/spine-cpp/src/spine/Json.cpp index 305dc68ab..125226076 100644 --- a/spine-cpp/spine-cpp/src/spine/Json.cpp +++ b/spine-cpp/spine-cpp/src/spine/Json.cpp @@ -37,7 +37,7 @@ THE SOFTWARE. #include #include #include -#include +#include #include #include diff --git a/spine-cpp/spine-cpp/src/spine/Log.cpp b/spine-cpp/spine-cpp/src/spine/Log.cpp index 4c3274657..bde609ff5 100644 --- a/spine-cpp/spine-cpp/src/spine/Log.cpp +++ b/spine-cpp/spine-cpp/src/spine/Log.cpp @@ -75,7 +75,7 @@ void spine::spDebug_printAnimation(Animation *animation) { } } -void spine::spDebug_printBoneDatas(Vector &boneDatas) { +void spine::spDebug_printBoneDatas(Array &boneDatas) { int i, n; for (i = 0, n = (int) boneDatas.size(); i < n; i++) { spDebug_printBoneData(boneDatas[i]); @@ -93,7 +93,7 @@ void spine::spDebug_printSkeleton(Skeleton *skeleton) { spDebug_printBones(skeleton->getBones()); } -void spine::spDebug_printBones(Vector &bones) { +void spine::spDebug_printBones(Array &bones) { int i, n; for (i = 0, n = (int) bones.size(); i < n; i++) { spDebug_printBone(bones[i]); @@ -115,7 +115,7 @@ void spine::spDebug_printFloats(float *values, int numFloats) { printf("]"); } -void spine::spDebug_printFloats(Vector &values) { +void spine::spDebug_printFloats(Array &values) { int i, n; printf("(%zu) [", values.size()); for (i = 0, n = (int) values.size(); i < n; i++) { diff --git a/spine-cpp/spine-cpp/src/spine/MeshAttachment.cpp b/spine-cpp/spine-cpp/src/spine/MeshAttachment.cpp index d3c59f694..97fec28ac 100644 --- a/spine-cpp/spine-cpp/src/spine/MeshAttachment.cpp +++ b/spine-cpp/spine-cpp/src/spine/MeshAttachment.cpp @@ -123,23 +123,23 @@ void MeshAttachment::setHullLength(int inValue) { _hullLength = inValue; } -Vector &MeshAttachment::getRegionUVs() { +Array &MeshAttachment::getRegionUVs() { return _regionUVs; } -void MeshAttachment::setRegionUVs(Vector &inValue) { +void MeshAttachment::setRegionUVs(Array &inValue) { _regionUVs.clearAndAddAll(inValue); } -Vector &MeshAttachment::getUVs() { +Array &MeshAttachment::getUVs() { return _uvs; } -Vector &MeshAttachment::getTriangles() { +Array &MeshAttachment::getTriangles() { return _triangles; } -void MeshAttachment::setTriangles(Vector &inValue) { +void MeshAttachment::setTriangles(Array &inValue) { _triangles.clearAndAddAll(inValue); } @@ -186,11 +186,11 @@ void MeshAttachment::setParentMesh(MeshAttachment *inValue) { } } -Vector &MeshAttachment::getEdges() { +Array &MeshAttachment::getEdges() { return _edges; } -void MeshAttachment::setEdges(Vector &inValue) { +void MeshAttachment::setEdges(Array &inValue) { _edges.clearAndAddAll(inValue); } diff --git a/spine-cpp/spine-cpp/src/spine/PathAttachment.cpp b/spine-cpp/spine-cpp/src/spine/PathAttachment.cpp index 678f7bf0b..8a12631ea 100644 --- a/spine-cpp/spine-cpp/src/spine/PathAttachment.cpp +++ b/spine-cpp/spine-cpp/src/spine/PathAttachment.cpp @@ -37,11 +37,11 @@ PathAttachment::PathAttachment(const String &name) : VertexAttachment(name), _cl _color() { } -Vector &PathAttachment::getLengths() { +Array &PathAttachment::getLengths() { return _lengths; } -void PathAttachment::setLengths(Vector &inValue) { +void PathAttachment::setLengths(Array &inValue) { _lengths.clearAndAddAll(inValue); } diff --git a/spine-cpp/spine-cpp/src/spine/PathConstraint.cpp b/spine-cpp/spine-cpp/src/spine/PathConstraint.cpp index 630259569..347ab1bed 100644 --- a/spine-cpp/spine-cpp/src/spine/PathConstraint.cpp +++ b/spine-cpp/spine-cpp/src/spine/PathConstraint.cpp @@ -152,7 +152,7 @@ void PathConstraint::update(Skeleton &skeleton, Physics physics) { } } - Vector &positions = computeWorldPositions(skeleton, *pathAttachment, (int) spacesCount, tangents); + Array &positions = computeWorldPositions(skeleton, *pathAttachment, (int) spacesCount, tangents); float *positionsBuffer = positions.buffer(); float boneX = positionsBuffer[0], boneY = positionsBuffer[1], offsetRotation = data._offsetRotation; bool tip; @@ -241,7 +241,7 @@ PathConstraintData &PathConstraint::getData() { return _data; } -Vector &PathConstraint::getBones() { +Array &PathConstraint::getBones() { return _bones; } @@ -253,13 +253,13 @@ void PathConstraint::setSlot(Slot *slot) { _slot = slot; } -Vector & +Array & PathConstraint::computeWorldPositions(Skeleton &skeleton, PathAttachment &path, int spacesCount, bool tangents) { float position = _applied->_position; float *spaces = _spaces.buffer(); _positions.setSize(spacesCount * 3 + 2, 0); - Vector &out = _positions; - Vector &world = _world; + Array &out = _positions; + Array &world = _world; bool closed = path.isClosed(); int verticesLength = (int) path.getWorldVerticesLength(); int curveCount = verticesLength / 6; @@ -267,7 +267,7 @@ PathConstraint::computeWorldPositions(Skeleton &skeleton, PathAttachment &path, float pathLength; if (!path.isConstantSpeed()) { - Vector &lengths = path.getLengths(); + Array &lengths = path.getLengths(); float *lengthsBuffer = lengths.buffer(); curveCount -= closed ? 1 : 2; pathLength = lengthsBuffer[curveCount]; @@ -500,14 +500,14 @@ PathConstraint::computeWorldPositions(Skeleton &skeleton, PathAttachment &path, return out; } -void PathConstraint::addBeforePosition(float p, Vector &temp, int i, Vector &output, int o) { +void PathConstraint::addBeforePosition(float p, Array &temp, int i, Array &output, int o) { float x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = MathUtil::atan2(dy, dx); output[o] = x1 + p * MathUtil::cos(r); output[o + 1] = y1 + p * MathUtil::sin(r); output[o + 2] = r; } -void PathConstraint::addAfterPosition(float p, Vector &temp, int i, Vector &output, int o) { +void PathConstraint::addAfterPosition(float p, Array &temp, int i, Array &output, int o) { float x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = MathUtil::atan2(dy, dx); output[o] = x1 + p * MathUtil::cos(r); output[o + 1] = y1 + p * MathUtil::sin(r); @@ -515,7 +515,7 @@ void PathConstraint::addAfterPosition(float p, Vector &temp, int i, Vecto } void PathConstraint::addCurvePosition(float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, - float y2, Vector &output, int o, bool tangents) { + float y2, Array &output, int o, bool tangents) { if (p < epsilon || MathUtil::isNan(p)) { output[o] = x1; output[o + 1] = y1; @@ -547,11 +547,11 @@ void PathConstraint::sortPathSlot(Skeleton &skeleton, Skin &skin, int slotIndex, void PathConstraint::sortPath(Skeleton &skeleton, Attachment *attachment, Bone &slotBone) { if (attachment == NULL || !attachment->getRTTI().instanceOf(PathAttachment::rtti)) return; PathAttachment *pathAttachment = static_cast(attachment); - Vector &pathBones = pathAttachment->getBones(); + Array &pathBones = pathAttachment->getBones(); if (pathBones.size() == 0) skeleton.sortBone(&slotBone); else { - Vector &bones = skeleton._bones; + Array &bones = skeleton._bones; for (size_t i = 0, n = pathBones.size(); i < n;) { int nn = pathBones[i++]; nn += i; diff --git a/spine-cpp/spine-cpp/src/spine/PathConstraintData.cpp b/spine-cpp/spine-cpp/src/spine/PathConstraintData.cpp index ea6e230b4..d6cfca2c8 100644 --- a/spine-cpp/spine-cpp/src/spine/PathConstraintData.cpp +++ b/spine-cpp/spine-cpp/src/spine/PathConstraintData.cpp @@ -46,7 +46,7 @@ PathConstraintData::PathConstraintData(const String &name) : ConstraintDataGener } -Vector &PathConstraintData::getBones() { +Array &PathConstraintData::getBones() { return _bones; } diff --git a/spine-cpp/spine-cpp/src/spine/PathConstraintMixTimeline.cpp b/spine-cpp/spine-cpp/src/spine/PathConstraintMixTimeline.cpp index a6cdc025e..486581a59 100644 --- a/spine-cpp/spine-cpp/src/spine/PathConstraintMixTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/PathConstraintMixTimeline.cpp @@ -54,7 +54,7 @@ PathConstraintMixTimeline::PathConstraintMixTimeline(size_t frameCount, size_t b PathConstraintMixTimeline::~PathConstraintMixTimeline() { } -void PathConstraintMixTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, +void PathConstraintMixTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); diff --git a/spine-cpp/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp b/spine-cpp/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp index 0d8e736ec..868f5c0b7 100644 --- a/spine-cpp/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp @@ -53,7 +53,7 @@ PathConstraintPositionTimeline::PathConstraintPositionTimeline(size_t frameCount PathConstraintPositionTimeline::~PathConstraintPositionTimeline() { } -void PathConstraintPositionTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, +void PathConstraintPositionTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); diff --git a/spine-cpp/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp b/spine-cpp/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp index 6cecc184a..ff8fa5144 100644 --- a/spine-cpp/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp @@ -53,7 +53,7 @@ PathConstraintSpacingTimeline::PathConstraintSpacingTimeline(size_t frameCount, PathConstraintSpacingTimeline::~PathConstraintSpacingTimeline() { } -void PathConstraintSpacingTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, +void PathConstraintSpacingTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); diff --git a/spine-cpp/spine-cpp/src/spine/PhysicsConstraintTimeline.cpp b/spine-cpp/spine-cpp/src/spine/PhysicsConstraintTimeline.cpp index 3ec8b6066..d0206119b 100644 --- a/spine-cpp/spine-cpp/src/spine/PhysicsConstraintTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/PhysicsConstraintTimeline.cpp @@ -58,12 +58,12 @@ PhysicsConstraintTimeline::PhysicsConstraintTimeline(size_t frameCount, size_t b setPropertyIds(ids, 1); } -void PhysicsConstraintTimeline::apply(Skeleton &skeleton, float, float time, Vector *, +void PhysicsConstraintTimeline::apply(Skeleton &skeleton, float, float time, Array *, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { if (_constraintIndex == -1) { float value = time >= _frames[0] ? getCurveValue(time) : 0; - Vector &physicsConstraints = skeleton.getPhysicsConstraints(); + Array &physicsConstraints = skeleton.getPhysicsConstraints(); for (size_t i = 0; i < physicsConstraints.size(); i++) { PhysicsConstraint *constraint = physicsConstraints[i]; if (constraint->isActive() && global(constraint->_data)) { @@ -80,7 +80,7 @@ void PhysicsConstraintTimeline::apply(Skeleton &skeleton, float, float time, Vec } } -void PhysicsConstraintResetTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { +void PhysicsConstraintResetTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { PhysicsConstraint *constraint = nullptr; if (_constraintIndex != -1) { constraint = static_cast(skeleton.getConstraints()[_constraintIndex]); @@ -98,7 +98,7 @@ void PhysicsConstraintResetTimeline::apply(Skeleton &skeleton, float lastTime, f if (constraint != nullptr) constraint->reset(skeleton); else { - Vector &physicsConstraints = skeleton.getPhysicsConstraints(); + Array &physicsConstraints = skeleton.getPhysicsConstraints(); for (size_t i = 0; i < physicsConstraints.size(); i++) { constraint = physicsConstraints[i]; if (constraint->isActive()) constraint->reset(skeleton); diff --git a/spine-cpp/spine-cpp/src/spine/RegionAttachment.cpp b/spine-cpp/spine-cpp/src/spine/RegionAttachment.cpp index c0245db54..db8af513c 100644 --- a/spine-cpp/spine-cpp/src/spine/RegionAttachment.cpp +++ b/spine-cpp/spine-cpp/src/spine/RegionAttachment.cpp @@ -127,7 +127,7 @@ void RegionAttachment::updateRegion() { } } -void RegionAttachment::computeWorldVertices(Slot &slot, Vector &worldVertices, size_t offset, size_t stride) { +void RegionAttachment::computeWorldVertices(Slot &slot, Array &worldVertices, size_t offset, size_t stride) { assert(worldVertices.size() >= (offset + 8)); computeWorldVertices(slot, worldVertices.buffer(), offset, stride); } @@ -244,11 +244,11 @@ void RegionAttachment::setSequence(Sequence *sequence) { _sequence = sequence; } -Vector &RegionAttachment::getOffset() { +Array &RegionAttachment::getOffset() { return _vertexOffset; } -Vector &RegionAttachment::getUVs() { +Array &RegionAttachment::getUVs() { return _uvs; } diff --git a/spine-cpp/spine-cpp/src/spine/SequenceTimeline.cpp b/spine-cpp/spine-cpp/src/spine/SequenceTimeline.cpp index 85093a90f..bac124da9 100644 --- a/spine-cpp/spine-cpp/src/spine/SequenceTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/SequenceTimeline.cpp @@ -55,14 +55,14 @@ SequenceTimeline::~SequenceTimeline() { } void SequenceTimeline::setFrame(int frame, float time, SequenceMode mode, int index, float delay) { - Vector &frames = this->_frames; + Array &frames = this->_frames; frame *= ENTRIES; frames[frame] = time; frames[frame + MODE] = mode | (index << 4); frames[frame + DELAY] = delay; } -void SequenceTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, +void SequenceTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(alpha); SP_UNUSED(lastTime); @@ -86,7 +86,7 @@ void SequenceTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vec return; } - Vector &frames = this->_frames; + Array &frames = this->_frames; if (time < frames[0]) { if (blend == MixBlend_Setup || blend == MixBlend_First) pose.setSequenceIndex(-1); return; diff --git a/spine-cpp/spine-cpp/src/spine/Skeleton.cpp b/spine-cpp/spine-cpp/src/spine/Skeleton.cpp index 77931511e..57f767995 100644 --- a/spine-cpp/spine-cpp/src/spine/Skeleton.cpp +++ b/spine-cpp/spine-cpp/src/spine/Skeleton.cpp @@ -52,7 +52,7 @@ #include #include -#include +#include #include @@ -101,9 +101,9 @@ Skeleton::Skeleton(SkeletonData &skeletonData) : _data(skeletonData), _skin(NULL } Skeleton::~Skeleton() { - ContainerUtil::cleanUpVectorOfPointers(_bones); - ContainerUtil::cleanUpVectorOfPointers(_slots); - ContainerUtil::cleanUpVectorOfPointers(_constraints); + ArrayUtils::deleteElements(_bones); + ArrayUtils::deleteElements(_slots); + ArrayUtils::deleteElements(_constraints); } void Skeleton::updateCache() { @@ -125,7 +125,7 @@ void Skeleton::updateCache() { } if (_skin) { - Vector &skinBones = _skin->getBones(); + Array &skinBones = _skin->getBones(); for (size_t i = 0, n = skinBones.size(); i < n; i++) { Bone *bone = _bones[skinBones[i]->getIndex()]; do { @@ -198,7 +198,7 @@ void Skeleton::sortBone(Bone *bone) { _updateCache.add((Update *)bone); } -void Skeleton::sortReset(Vector &bones) { +void Skeleton::sortReset(Array &bones) { Bone **items = bones.buffer(); for (size_t i = 0, n = bones.size(); i < n; i++) { Bone *bone = items[i]; @@ -293,11 +293,11 @@ SkeletonData *Skeleton::getData() { return &_data; } -Vector &Skeleton::getBones() { +Array &Skeleton::getBones() { return _bones; } -Vector &Skeleton::getUpdateCache() { +Array &Skeleton::getUpdateCache() { return _updateCache; } @@ -314,7 +314,7 @@ Bone *Skeleton::findBone(const String &boneName) { return NULL; } -Vector &Skeleton::getSlots() { +Array &Skeleton::getSlots() { return _slots; } @@ -327,7 +327,7 @@ Slot *Skeleton::findSlot(const String &slotName) { return NULL; } -Vector &Skeleton::getDrawOrder() { +Array &Skeleton::getDrawOrder() { return _drawOrder; } @@ -392,19 +392,19 @@ void Skeleton::setAttachment(const String &slotName, const String &attachmentNam slot->_pose.setAttachment(attachment); } -Vector &Skeleton::getConstraints() { +Array &Skeleton::getConstraints() { return _constraints; } -Vector &Skeleton::getPhysicsConstraints() { +Array &Skeleton::getPhysicsConstraints() { return _physics; } -void Skeleton::getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Vector &outVertexBuffer) { +void Skeleton::getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Array &outVertexBuffer) { getBounds(outX, outY, outWidth, outHeight, outVertexBuffer, NULL); } -void Skeleton::getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Vector &outVertexBuffer, SkeletonClipping *clipper) { +void Skeleton::getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Array &outVertexBuffer, SkeletonClipping *clipper) { static unsigned short quadIndices[] = {0, 1, 2, 2, 3, 0}; float minX = FLT_MAX; float minY = FLT_MAX; diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp index a4168ad9d..aefcb7236 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include @@ -93,7 +93,7 @@ SkeletonBinary::SkeletonBinary(AttachmentLoader *attachmentLoader, bool ownsLoad } SkeletonBinary::~SkeletonBinary() { - ContainerUtil::cleanUpVectorOfPointers(_linkedMeshes); + ArrayUtils::deleteElements(_linkedMeshes); _linkedMeshes.clear(); if (_ownsLoader) delete _attachmentLoader; @@ -136,7 +136,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons return NULL; } - ContainerUtil::cleanUpVectorOfPointers(_linkedMeshes); + ArrayUtils::deleteElements(_linkedMeshes); _linkedMeshes.clear(); SkeletonData *skeletonData = new (__FILE__, __LINE__) SkeletonData(); @@ -177,12 +177,12 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons } int n = input.readInt(true); - Vector &strings = skeletonData->_strings.setSize(n, NULL); + Array &strings = skeletonData->_strings.setSize(n, NULL); for (int i = 0; i < n; i++) strings[i] = input.readString(); /* Bones. */ - Vector &bones = skeletonData->_bones.setSize(input.readInt(true), NULL); + Array &bones = skeletonData->_bones.setSize(input.readInt(true), NULL); for (int i = 0; i < (int)bones.size(); ++i) { const char *name = input.readString(); BoneData *parent = i == 0 ? 0 : bones[input.readInt(true)]; @@ -207,7 +207,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons } /* Slots. */ - Vector &slots = skeletonData->_slots.setSize(input.readInt(true), NULL); + Array &slots = skeletonData->_slots.setSize(input.readInt(true), NULL); for (int i = 0; i < (int)slots.size(); ++i) { String slotName = String(input.readString(), true); BoneData *boneData = bones[input.readInt(true)]; @@ -228,14 +228,14 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons /* Constraints. */ int constraintCount = input.readInt(true); - Vector &constraints = skeletonData->_constraints.setSize(constraintCount, NULL); + Array &constraints = skeletonData->_constraints.setSize(constraintCount, NULL); for (int i = 0; i < constraintCount; i++) { String name(input.readString(), true); int nn; switch (input.readByte()) { case CONSTRAINT_IK: { IkConstraintData *data = new (__FILE__, __LINE__) IkConstraintData(name); - Vector &constraintBones = data->_bones.setSize(nn = input.readInt(true), NULL); + Array &constraintBones = data->_bones.setSize(nn = input.readInt(true), NULL); for (int ii = 0; ii < nn; ii++) constraintBones[ii] = bones[input.readInt(true)]; data->_target = bones[input.readInt(true)]; @@ -253,7 +253,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons } case CONSTRAINT_TRANSFORM: { TransformConstraintData *data = new (__FILE__, __LINE__) TransformConstraintData(name); - Vector &constraintBones = data->_bones.setSize(nn = input.readInt(true), NULL); + Array &constraintBones = data->_bones.setSize(nn = input.readInt(true), NULL); for (int ii = 0; ii < nn; ii++) constraintBones[ii] = bones[input.readInt(true)]; data->_source = bones[input.readInt(true)]; @@ -263,7 +263,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons data->_localTarget = (flags & 4) != 0; data->_additive = (flags & 8) != 0; data->_clamp = (flags & 16) != 0; - Vector &froms = data->_properties.setSize(nn = flags >> 5, NULL); + Array &froms = data->_properties.setSize(nn = flags >> 5, NULL); for (int ii = 0, tn; ii < nn; ii++) { float fromScale = 1; FromProperty *from = NULL; @@ -290,7 +290,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons break; } from->_offset = input.readFloat() * fromScale; - Vector &tos = from->_to.setSize(tn = input.readByte(), NULL); + Array &tos = from->_to.setSize(tn = input.readByte(), NULL); for (int t = 0; t < tn; t++) { float toScale = 1; ToProperty *to = NULL; @@ -343,7 +343,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons } case CONSTRAINT_PATH: { PathConstraintData *data = new (__FILE__, __LINE__) PathConstraintData(name); - Vector &constraintBones = data->_bones.setSize(nn = input.readInt(true), NULL); + Array &constraintBones = data->_bones.setSize(nn = input.readInt(true), NULL); for (int ii = 0; ii < nn; ii++) constraintBones[ii] = bones[input.readInt(true)]; data->_slot = slots[input.readInt(true)]; @@ -459,7 +459,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons /* Skins. */ { int i = skeletonData->_skins.size(); - Vector &skins = skeletonData->_skins.setSize(n = i + input.readInt(true), NULL); + Array &skins = skeletonData->_skins.setSize(n = i + input.readInt(true), NULL); for (; i < n; i++) { Skin *skin = readSkin(input, *skeletonData, false, nonessential); if (skin) @@ -472,7 +472,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons } /* Linked meshes. */ - Vector &items = _linkedMeshes; + Array &items = _linkedMeshes; for (int i = 0, n = items.size(); i < n; i++) { LinkedMesh *linkedMesh = items[i]; Skin *skin = skeletonData->_skins[linkedMesh->_skinIndex]; @@ -487,12 +487,12 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons linkedMesh->_mesh->setParentMesh(static_cast(parent)); if (linkedMesh->_mesh->getSequence() == NULL) linkedMesh->_mesh->updateRegion(); } - ContainerUtil::cleanUpVectorOfPointers(_linkedMeshes); + ArrayUtils::deleteElements(_linkedMeshes); _linkedMeshes.clear(); /* Events. */ int eventsCount = input.readInt(true); - Vector &events = skeletonData->_events.setSize(eventsCount, NULL); + Array &events = skeletonData->_events.setSize(eventsCount, NULL); for (int i = 0; i < eventsCount; ++i) { EventData *eventData = new (__FILE__, __LINE__) EventData(String(input.readString(), true)); eventData->_intValue = input.readInt(false); @@ -508,7 +508,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons /* Animations. */ int animationsCount = input.readInt(true); - Vector &animations = skeletonData->_animations.setSize(animationsCount, NULL); + Array &animations = skeletonData->_animations.setSize(animationsCount, NULL); for (int i = 0; i < animationsCount; ++i) { Animation *animation = readAnimation(input, String(input.readString(), true), *skeletonData); if (!animation) { @@ -552,13 +552,13 @@ Skin *SkeletonBinary::readSkin(DataInput &input, SkeletonData &skeletonData, boo if (nonessential) Color::rgba8888ToColor(skin->getColor(), input.readInt()); int n; - Vector &from = skeletonData._bones; - Vector &bones = skin->getBones().setSize(n = input.readInt(true), NULL); + Array &from = skeletonData._bones; + Array &bones = skin->getBones().setSize(n = input.readInt(true), NULL); for (int i = 0; i < n; i++) bones[i] = from[input.readInt(true)]; - Vector &fromConstraints = skeletonData._constraints; - Vector &constraints = skin->getConstraints().setSize(n = input.readInt(true), NULL); + Array &fromConstraints = skeletonData._constraints; + Array &constraints = skin->getConstraints().setSize(n = input.readInt(true), NULL); for (int i = 0; i < n; i++) constraints[i] = fromConstraints[input.readInt(true)]; @@ -618,8 +618,8 @@ Attachment *SkeletonBinary::readAttachment(DataInput &input, Skin &skin, int slo return region; } case AttachmentType_Boundingbox: { - Vector vertices; - Vector bones; + Array vertices; + Array bones; int verticesLength = readVertices(input, vertices, bones, (flags & 16) != 0); int color = nonessential ? input.readInt() : 0; @@ -636,15 +636,15 @@ Attachment *SkeletonBinary::readAttachment(DataInput &input, Skin &skin, int slo int color = (flags & 32) != 0 ? input.readInt() : 0xffffffff; Sequence *sequence = (flags & 64) != 0 ? readSequence(input) : nullptr; int hullLength = input.readInt(true); - Vector vertices; - Vector bones; + Array vertices; + Array bones; int verticesLength = readVertices(input, vertices, bones, (flags & 128) != 0); - Vector uvs; + Array uvs; readFloatArray(input, verticesLength, 1, uvs); - Vector triangles; + Array triangles; readShortArray(input, triangles, (verticesLength - hullLength - 2) * 3); - Vector edges; + Array edges; float width = 0, height = 0; if (nonessential) { readShortArray(input, edges, input.readInt(true)); @@ -699,10 +699,10 @@ Attachment *SkeletonBinary::readAttachment(DataInput &input, Skin &skin, int slo case AttachmentType_Path: { bool closed = (flags & 16) != 0; bool constantSpeed = (flags & 32) != 0; - Vector vertices; - Vector bones; + Array vertices; + Array bones; int verticesLength = readVertices(input, vertices, bones, (flags & 64) != 0); - Vector lengths; + Array lengths; lengths.setSize(verticesLength / 6, 0); for (int i = 0, n = lengths.size(); i < n; i++) lengths[i] = input.readFloat() * scale; @@ -735,8 +735,8 @@ Attachment *SkeletonBinary::readAttachment(DataInput &input, Skin &skin, int slo } case AttachmentType_Clipping: { int endSlotIndex = input.readInt(true); - Vector vertices; - Vector bones; + Array vertices; + Array bones; int verticesLength = readVertices(input, vertices, bones, (flags & 16) != 0); int color = nonessential ? input.readInt() : 0; @@ -761,7 +761,7 @@ Sequence *SkeletonBinary::readSequence(DataInput &input) { return sequence; } -int SkeletonBinary::readVertices(DataInput &input, Vector &vertices, Vector &bones, bool weighted) { +int SkeletonBinary::readVertices(DataInput &input, Array &vertices, Array &bones, bool weighted) { float scale = _scale; int vertexCount = input.readInt(true); int verticesLength = vertexCount << 1; @@ -784,7 +784,7 @@ int SkeletonBinary::readVertices(DataInput &input, Vector &vertices, Vect return verticesLength; } -void SkeletonBinary::readFloatArray(DataInput &input, int n, float scale, Vector &array) { +void SkeletonBinary::readFloatArray(DataInput &input, int n, float scale, Array &array) { array.setSize(n, 0); int i; if (scale == 1) { @@ -798,7 +798,7 @@ void SkeletonBinary::readFloatArray(DataInput &input, int n, float scale, Vector } } -void SkeletonBinary::readShortArray(DataInput &input, Vector &array, int n) { +void SkeletonBinary::readShortArray(DataInput &input, Array &array, int n) { array.setSize(n, 0); for (int i = 0; i < n; ++i) { array[i] = (short) input.readInt(true); @@ -806,7 +806,7 @@ void SkeletonBinary::readShortArray(DataInput &input, Vector &ar } Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, SkeletonData &skeletonData) { - Vector timelines; + Array timelines; timelines.ensureCapacity(input.readInt(true)); float scale = _scale; @@ -986,7 +986,7 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S break; } default: { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); setError("Invalid slot timeline type: ", String().append(timelineType).buffer()); return NULL; } @@ -1042,7 +1042,7 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S readTimeline(input, timelines, *(new (__FILE__, __LINE__) ShearYTimeline(frameCount, bezierCount, boneIndex)), 1); break; default: { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); setError("Invalid bone timeline type: ", String().append(timelineType).buffer()); return NULL; } @@ -1161,7 +1161,7 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S break; } default: { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); setError("Invalid path constraint timeline type: ", String().append(type).buffer()); return NULL; } @@ -1205,7 +1205,7 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S readTimeline(input, timelines, *(new (__FILE__, __LINE__) PhysicsConstraintMixTimeline(frameCount, bezierCount, index)), 1); break; default: { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); setError("Invalid physics constraint timeline type: ", String().append(type).buffer()); return NULL; } @@ -1226,7 +1226,7 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S readTimeline(input, timelines, *(new (__FILE__, __LINE__) SliderMixTimeline(frameCount, bezierCount, index)), 1); break; default: { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); setError("Invalid slider timeline type: ", String().append(type).buffer()); return NULL; } @@ -1243,7 +1243,7 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S const char *attachmentName = input.readStringRef(); Attachment *attachment = skin->getAttachment(slotIndex, String(attachmentName)); if (!attachment) { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); setError("Timeline attachment not found: ", attachmentName); return NULL; } @@ -1252,7 +1252,7 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S case ATTACHMENT_DEFORM: { VertexAttachment *vertexAttachment = static_cast(attachment); bool weighted = vertexAttachment->_bones.size() > 0; - Vector &vertices = vertexAttachment->_vertices; + Array &vertices = vertexAttachment->_vertices; int deformLength = weighted ? (int) vertices.size() / 3 * 2 : (int) vertices.size(); DeformTimeline *timeline = new (__FILE__, __LINE__) DeformTimeline(frameCount, input.readInt(true), slotIndex, @@ -1260,7 +1260,7 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S float time = input.readFloat(); for (int frame = 0, bezier = 0;; ++frame) { - Vector deform; + Array deform; size_t end = (size_t) input.readInt(true); if (end == 0) { if (weighted) { @@ -1315,7 +1315,7 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S break; } default: { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); setError("Invalid attachment timeline type: ", String().append(timelineType).buffer()); return NULL; } @@ -1332,11 +1332,11 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S for (size_t i = 0; i < drawOrderCount; ++i) { float time = input.readFloat(); size_t offsetCount = (size_t) input.readInt(true); - Vector drawOrder; + Array drawOrder; drawOrder.setSize(slotCount, 0); for (int ii = (int) slotCount - 1; ii >= 0; --ii) drawOrder[ii] = -1; - Vector unchanged; + Array unchanged; unchanged.setSize(slotCount - offsetCount, 0); size_t originalIndex = 0, unchangedIndex = 0; for (size_t ii = 0; ii < offsetCount; ++ii) { @@ -1391,7 +1391,7 @@ Animation *SkeletonBinary::readAnimation(DataInput &input, const String &name, S return new (__FILE__, __LINE__) Animation(String(name), timelines, duration); } -void SkeletonBinary::readTimeline(DataInput &input, Vector &timelines, CurveTimeline1 &timeline, float scale) { +void SkeletonBinary::readTimeline(DataInput &input, Array &timelines, CurveTimeline1 &timeline, float scale) { float time = input.readFloat(), value = input.readFloat() * scale; for (int frame = 0, bezier = 0, frameLast = (int) timeline.getFrameCount() - 1;; frame++) { timeline.setFrame(frame, time, value); @@ -1411,7 +1411,7 @@ void SkeletonBinary::readTimeline(DataInput &input, Vector &timeline timelines.add(&timeline); } -void SkeletonBinary::readTimeline(DataInput &input, Vector &timelines, BoneTimeline2 &timeline, float scale) { +void SkeletonBinary::readTimeline(DataInput &input, Array &timelines, BoneTimeline2 &timeline, float scale) { float time = input.readFloat(), value1 = input.readFloat() * scale, value2 = input.readFloat() * scale; for (int frame = 0, bezier = 0, frameLast = (int) timeline.getFrameCount() - 1;; frame++) { timeline.setFrame(frame, time, value1, value2); diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonBounds.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonBounds.cpp index 41400127e..78a1774c1 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonBounds.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonBounds.cpp @@ -49,7 +49,7 @@ SkeletonBounds::~SkeletonBounds() { } void SkeletonBounds::update(Skeleton &skeleton, bool updateAabb) { - Vector &slots = skeleton.getSlots(); + Array &slots = skeleton.getSlots(); size_t slotCount = slots.size(); _boundingBoxes.clear(); @@ -123,7 +123,7 @@ bool SkeletonBounds::aabbIntersectsSkeleton(SkeletonBounds &bounds) { } bool SkeletonBounds::containsPoint(spine::Polygon *polygon, float x, float y) { - Vector &vertices = polygon->_vertices; + Array &vertices = polygon->_vertices; int nn = polygon->_count; int prevIndex = nn - 2; @@ -155,7 +155,7 @@ BoundingBoxAttachment *SkeletonBounds::intersectsSegment(float x1, float y1, flo } bool SkeletonBounds::intersectsSegment(spine::Polygon *polygon, float x1, float y1, float x2, float y2) { - Vector &vertices = polygon->_vertices; + Array &vertices = polygon->_vertices; size_t nn = polygon->_count; float width12 = x1 - x2, height12 = y1 - y2; @@ -190,11 +190,11 @@ BoundingBoxAttachment *SkeletonBounds::getBoundingBox(Polygon *polygon) { return index == -1 ? NULL : _boundingBoxes[index]; } -Vector &SkeletonBounds::getPolygons() { +Array &SkeletonBounds::getPolygons() { return _polygons; } -Vector &SkeletonBounds::getBoundingBoxes() { +Array &SkeletonBounds::getBoundingBoxes() { return _boundingBoxes; } @@ -230,7 +230,7 @@ void SkeletonBounds::aabbCompute() { for (size_t i = 0, n = _polygons.size(); i < n; ++i) { spine::Polygon *polygon = _polygons[i]; - Vector &vertices = polygon->_vertices; + Array &vertices = polygon->_vertices; for (int ii = 0, nn = polygon->_count; ii < nn; ii += 2) { float x = vertices[ii]; float y = vertices[ii + 1]; diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonClipping.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonClipping.cpp index fcb35e790..917ba0c9c 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonClipping.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonClipping.cpp @@ -58,8 +58,8 @@ size_t SkeletonClipping::clipStart(Skeleton &skeleton, Slot &slot, ClippingAttac _clippingPolygons = &_triangulator.decompose(_clippingPolygon, _triangulator.triangulate(_clippingPolygon)); for (size_t i = 0; i < _clippingPolygons->size(); ++i) { - Vector *polygonP = (*_clippingPolygons)[i]; - Vector &polygon = *polygonP; + Array *polygonP = (*_clippingPolygons)[i]; + Array &polygon = *polygonP; makeClockwise(polygon); polygon.add(polygon[0]); polygon.add(polygon[1]); @@ -87,10 +87,10 @@ void SkeletonClipping::clipEnd() { bool SkeletonClipping::clipTriangles(float *vertices, unsigned short *triangles, size_t trianglesLength) { - Vector &clipOutput = _clipOutput; - Vector &clippedVertices = _clippedVertices; - Vector &clippedTriangles = _clippedTriangles; - Vector *> &polygons = *_clippingPolygons; + Array &clipOutput = _clipOutput; + Array &clippedVertices = _clippedVertices; + Array &clippedTriangles = _clippedTriangles; + Array *> &polygons = *_clippingPolygons; size_t polygonsCount = (*_clippingPolygons).size(); size_t index = 0; @@ -159,17 +159,17 @@ bool SkeletonClipping::clipTriangles(float *vertices, unsigned short *triangles, return clipped; } -bool SkeletonClipping::clipTriangles(Vector &vertices, Vector &triangles, Vector &uvs, +bool SkeletonClipping::clipTriangles(Array &vertices, Array &triangles, Array &uvs, size_t stride) { return clipTriangles(vertices.buffer(), triangles.buffer(), triangles.size(), uvs.buffer(), stride); } bool SkeletonClipping::clipTriangles(float *vertices, unsigned short *triangles, size_t trianglesLength, float *uvs, size_t stride) { - Vector &clipOutput = _clipOutput; - Vector &clippedVertices = _clippedVertices; - Vector &clippedTriangles = _clippedTriangles; - Vector *> &polygons = *_clippingPolygons; + Array &clipOutput = _clipOutput; + Array &clippedVertices = _clippedVertices; + Array &clippedTriangles = _clippedTriangles; + Array *> &polygons = *_clippingPolygons; size_t polygonsCount = (*_clippingPolygons).size(); size_t index = 0; @@ -261,25 +261,25 @@ bool SkeletonClipping::isClipping() { return _clipAttachment != NULL; } -Vector &SkeletonClipping::getClippedVertices() { +Array &SkeletonClipping::getClippedVertices() { return _clippedVertices; } -Vector &SkeletonClipping::getClippedTriangles() { +Array &SkeletonClipping::getClippedTriangles() { return _clippedTriangles; } -Vector &SkeletonClipping::getClippedUVs() { +Array &SkeletonClipping::getClippedUVs() { return _clippedUVs; } -bool SkeletonClipping::clip(float x1, float y1, float x2, float y2, float x3, float y3, Vector *clippingArea, - Vector *output) { - Vector *originalOutput = output; +bool SkeletonClipping::clip(float x1, float y1, float x2, float y2, float x3, float y3, Array *clippingArea, + Array *output) { + Array *originalOutput = output; bool clipped = false; // Avoid copy at the end. - Vector *input; + Array *input; if (clippingArea->size() % 4 >= 2) { input = output; output = &_scratch; @@ -298,13 +298,13 @@ bool SkeletonClipping::clip(float x1, float y1, float x2, float y2, float x3, fl output->clear(); size_t clippingVerticesLast = clippingArea->size() - 4; - Vector &clippingVertices = *clippingArea; + Array &clippingVertices = *clippingArea; for (size_t i = 0;; i += 2) { float edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; float ex = edgeX - clippingVertices[i + 2], ey = edgeY - clippingVertices[i + 3]; size_t outputStart = output->size(); - Vector &inputVertices = *input; + Array &inputVertices = *input; for (size_t ii = 0, nn = input->size() - 2; ii < nn;) { float inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; ii += 2; @@ -355,7 +355,7 @@ bool SkeletonClipping::clip(float x1, float y1, float x2, float y2, float x3, fl if (i == clippingVerticesLast) { break; } - Vector *temp = output; + Array *temp = output; output = input; output->clear(); input = temp; @@ -375,7 +375,7 @@ bool SkeletonClipping::clip(float x1, float y1, float x2, float y2, float x3, fl return clipped; } -void SkeletonClipping::makeClockwise(Vector &polygon) { +void SkeletonClipping::makeClockwise(Array &polygon) { size_t verticeslength = polygon.size(); float area = polygon[verticeslength - 2] * polygon[1] - polygon[0] * polygon[verticeslength - 1]; diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonData.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonData.cpp index 16bd2e416..b1d03a304 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonData.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonData.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include using namespace spine; @@ -59,18 +59,18 @@ SkeletonData::SkeletonData() : _name(), } SkeletonData::~SkeletonData() { - ContainerUtil::cleanUpVectorOfPointers(_bones); - ContainerUtil::cleanUpVectorOfPointers(_slots); - ContainerUtil::cleanUpVectorOfPointers(_skins); + ArrayUtils::deleteElements(_bones); + ArrayUtils::deleteElements(_slots); + ArrayUtils::deleteElements(_skins); _defaultSkin = NULL; - ContainerUtil::cleanUpVectorOfPointers(_events); - ContainerUtil::cleanUpVectorOfPointers(_animations); - ContainerUtil::cleanUpVectorOfPointers(_ikConstraints); - ContainerUtil::cleanUpVectorOfPointers(_transformConstraints); - ContainerUtil::cleanUpVectorOfPointers(_pathConstraints); - ContainerUtil::cleanUpVectorOfPointers(_physicsConstraints); + ArrayUtils::deleteElements(_events); + ArrayUtils::deleteElements(_animations); + ArrayUtils::deleteElements(_ikConstraints); + ArrayUtils::deleteElements(_transformConstraints); + ArrayUtils::deleteElements(_pathConstraints); + ArrayUtils::deleteElements(_physicsConstraints); // Note: _constraints contains pointers to objects already cleaned up above, so just clear _constraints.clear(); for (size_t i = 0; i < _strings.size(); i++) { @@ -79,39 +79,39 @@ SkeletonData::~SkeletonData() { } BoneData *SkeletonData::findBone(const String &boneName) { - return ContainerUtil::findWithName(_bones, boneName); + return ArrayUtils::findWithName(_bones, boneName); } SlotData *SkeletonData::findSlot(const String &slotName) { - return ContainerUtil::findWithName(_slots, slotName); + return ArrayUtils::findWithName(_slots, slotName); } Skin *SkeletonData::findSkin(const String &skinName) { - return ContainerUtil::findWithName(_skins, skinName); + return ArrayUtils::findWithName(_skins, skinName); } spine::EventData *SkeletonData::findEvent(const String &eventDataName) { - return ContainerUtil::findWithName(_events, eventDataName); + return ArrayUtils::findWithName(_events, eventDataName); } Animation *SkeletonData::findAnimation(const String &animationName) { - return ContainerUtil::findWithName(_animations, animationName); + return ArrayUtils::findWithName(_animations, animationName); } IkConstraintData *SkeletonData::findIkConstraint(const String &constraintName) { - return ContainerUtil::findWithName(_ikConstraints, constraintName); + return ArrayUtils::findWithName(_ikConstraints, constraintName); } TransformConstraintData *SkeletonData::findTransformConstraint(const String &constraintName) { - return ContainerUtil::findWithName(_transformConstraints, constraintName); + return ArrayUtils::findWithName(_transformConstraints, constraintName); } PathConstraintData *SkeletonData::findPathConstraint(const String &constraintName) { - return ContainerUtil::findWithName(_pathConstraints, constraintName); + return ArrayUtils::findWithName(_pathConstraints, constraintName); } PhysicsConstraintData *SkeletonData::findPhysicsConstraint(const String &constraintName) { - return ContainerUtil::findWithName(_physicsConstraints, constraintName); + return ArrayUtils::findWithName(_physicsConstraints, constraintName); } const String &SkeletonData::getName() { @@ -122,15 +122,15 @@ void SkeletonData::setName(const String &inValue) { _name = inValue; } -Vector &SkeletonData::getBones() { +Array &SkeletonData::getBones() { return _bones; } -Vector &SkeletonData::getSlots() { +Array &SkeletonData::getSlots() { return _slots; } -Vector &SkeletonData::getSkins() { +Array &SkeletonData::getSkins() { return _skins; } @@ -142,27 +142,27 @@ void SkeletonData::setDefaultSkin(Skin *inValue) { _defaultSkin = inValue; } -Vector &SkeletonData::getEvents() { +Array &SkeletonData::getEvents() { return _events; } -Vector &SkeletonData::getAnimations() { +Array &SkeletonData::getAnimations() { return _animations; } -Vector &SkeletonData::getIkConstraints() { +Array &SkeletonData::getIkConstraints() { return _ikConstraints; } -Vector &SkeletonData::getTransformConstraints() { +Array &SkeletonData::getTransformConstraints() { return _transformConstraints; } -Vector &SkeletonData::getPathConstraints() { +Array &SkeletonData::getPathConstraints() { return _pathConstraints; } -Vector &SkeletonData::getPhysicsConstraints() { +Array &SkeletonData::getPhysicsConstraints() { return _physicsConstraints; } @@ -247,7 +247,7 @@ void SkeletonData::setFps(float inValue) { _fps = inValue; } -Vector &SkeletonData::getConstraints() { +Array &SkeletonData::getConstraints() { // Build unified constraints array by aggregating all constraint types _constraints.clear(); for (size_t i = 0, n = _ikConstraints.size(); i < n; i++) { diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp index 6f053458e..f75c20ccb 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include @@ -117,7 +117,7 @@ SkeletonJson::SkeletonJson(AttachmentLoader *attachmentLoader, bool ownsLoader) } SkeletonJson::~SkeletonJson() { - ContainerUtil::cleanUpVectorOfPointers(_linkedMeshes); + ArrayUtils::deleteElements(_linkedMeshes); if (_ownsLoader) delete _attachmentLoader; } @@ -554,7 +554,7 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) { linkedMesh->_mesh->setParentMesh(static_cast(parent)); if (linkedMesh->_mesh->_region != NULL) linkedMesh->_mesh->updateRegion(); } - ContainerUtil::cleanUpVectorOfPointers(_linkedMeshes); + ArrayUtils::deleteElements(_linkedMeshes); _linkedMeshes.clear(); /* Events. */ @@ -669,17 +669,17 @@ Attachment *SkeletonJson::readAttachment(Json *map, Skin *skin, int slotIndex, c return mesh; } - Vector uvs; + Array uvs; if (!Json::asArray(Json::getItem(map, "uvs"), uvs)) return NULL; readVertices(map, mesh, uvs.size()); - Vector triangles; + Array triangles; if (!Json::asArray(Json::getItem(map, "triangles"), triangles)) return NULL; mesh->_triangles.clearAndAddAll(triangles); mesh->_regionUVs.clearAndAddAll(uvs); if (mesh->_region != NULL) mesh->updateRegion(); if (Json::getInt(map, "hull", 0)) mesh->setHullLength(Json::getInt(map, "hull", 0) << 1); - Vector edges; + Array edges; Json::asArray(Json::getItem(map, "edges"), edges); if (edges.size() > 0) mesh->_edges.clearAndAddAll(edges); return mesh; @@ -745,7 +745,7 @@ Sequence *SkeletonJson::readSequence(Json *item) { void SkeletonJson::readVertices(Json *map, VertexAttachment *attachment, size_t verticesLength) { attachment->setWorldVerticesLength(verticesLength); - Vector vertices; + Array vertices; if (!Json::asArray(Json::getItem(map, "vertices"), vertices)) return; if (verticesLength == vertices.size()) { if (_scale != 1) { @@ -774,7 +774,7 @@ void SkeletonJson::readVertices(Json *map, VertexAttachment *attachment, size_t } Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { - Vector timelines; + Array timelines; // Slot timelines. for (Json *slotMap = Json::getItem(map, "slots") ? Json::getItem(map, "slots")->_child : NULL; slotMap; slotMap = slotMap->_next) { @@ -957,7 +957,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { } timelines.add(timeline); } else { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); return NULL; } } @@ -965,9 +965,9 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { // Bone timelines. for (Json *boneMap = Json::getItem(map, "bones") ? Json::getItem(map, "bones")->_child : NULL; boneMap; boneMap = boneMap->_next) { - int boneIndex = ContainerUtil::findIndexWithName(skeletonData->_bones, boneMap->_name); + int boneIndex = ArrayUtils::findIndexWithName(skeletonData->_bones, boneMap->_name); if (boneIndex == -1) { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); return NULL; } @@ -1006,7 +1006,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { } timelines.add(timeline); } else { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); return NULL; } } @@ -1018,7 +1018,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { if (keyMap == NULL) continue; IkConstraintData *constraint = skeletonData->findIkConstraint(timelineMap->_name); if (!constraint) { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); return NULL; } int constraintIndex = skeletonData->_ikConstraints.indexOf(constraint); @@ -1058,7 +1058,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { if (keyMap == NULL) continue; TransformConstraintData *constraint = skeletonData->findTransformConstraint(timelineMap->_name); if (!constraint) { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); return NULL; } int constraintIndex = skeletonData->_transformConstraints.indexOf(constraint); @@ -1107,7 +1107,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { for (Json *constraintMap = Json::getItem(map, "path") ? Json::getItem(map, "path")->_child : NULL; constraintMap; constraintMap = constraintMap->_next) { PathConstraintData *constraint = skeletonData->findPathConstraint(constraintMap->_name); if (!constraint) { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); return NULL; } int index = skeletonData->_pathConstraints.indexOf(constraint); @@ -1168,7 +1168,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { if (constraintMap->_name && strlen(constraintMap->_name) > 0) { PhysicsConstraintData *constraint = skeletonData->findConstraint(constraintMap->_name); if (!constraint) { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); return NULL; } index = skeletonData->_physicsConstraints.indexOf(constraint); @@ -1215,7 +1215,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { for (Json *constraintMap = Json::getItem(map, "slider") ? Json::getItem(map, "slider")->_child : NULL; constraintMap; constraintMap = constraintMap->_next) { SliderData *constraint = skeletonData->findConstraint(constraintMap->_name); if (!constraint) { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); return NULL; } int index = skeletonData->_constraints.indexOf(constraint); @@ -1236,7 +1236,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { for (Json *attachmentsMap = Json::getItem(map, "attachments") ? Json::getItem(map, "attachments")->_child : NULL; attachmentsMap; attachmentsMap = attachmentsMap->_next) { Skin *skin = skeletonData->findSkin(attachmentsMap->_name); if (!skin) { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); return NULL; } for (Json *slotMap = attachmentsMap->_child; slotMap; slotMap = slotMap->_next) { @@ -1245,7 +1245,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { for (Json *attachmentMap = slotMap->_child; attachmentMap; attachmentMap = attachmentMap->_next) { Attachment *attachment = skin->getAttachment(slotIndex, attachmentMap->_name); if (!attachment) { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); return NULL; } for (Json *timelineMap = attachmentMap->_child; timelineMap; timelineMap = timelineMap->_next) { @@ -1255,14 +1255,14 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { if (timelineName == "deform") { VertexAttachment *vertexAttachment = static_cast(attachment); bool weighted = vertexAttachment->_bones.size() != 0; - Vector &vertices = vertexAttachment->_vertices; + Array &vertices = vertexAttachment->_vertices; int deformLength = weighted ? (int) vertices.size() / 3 * 2 : (int) vertices.size(); DeformTimeline *timeline = new (__FILE__, __LINE__) DeformTimeline(frames, frames, slotIndex, vertexAttachment); float time = Json::getFloat(keyMap, "time", 0); for (int frame = 0, bezier = 0;; frame++) { - Vector deform; + Array deform; Json *verticesValue = Json::getItem(keyMap, "vertices"); if (!verticesValue) { if (weighted) { @@ -1324,19 +1324,19 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { int slotCount = skeletonData->_slots.size(); int frame = 0; for (Json *keyMap = drawOrder->_child; keyMap; keyMap = keyMap->_next, ++frame) { - Vector drawOrder2; + Array drawOrder2; Json *offsets = Json::getItem(keyMap, "offsets"); if (offsets) { drawOrder2.setSize(slotCount, 0); for (int i = slotCount - 1; i >= 0; i--) drawOrder2[i] = -1; - Vector unchanged; + Array unchanged; unchanged.setSize(slotCount - offsets->_size, 0); int originalIndex = 0, unchangedIndex = 0; for (Json *offsetMap = offsets->_child; offsetMap; offsetMap = offsetMap->_next) { SlotData *slot = skeletonData->findSlot(Json::getString(offsetMap, "slot", 0)); if (!slot) { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); return NULL; } /* Collect unchanged items. */ @@ -1366,7 +1366,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { for (Json *keyMap = events->_child; keyMap; keyMap = keyMap->_next, ++frame) { EventData *eventData = skeletonData->findEvent(Json::getString(keyMap, "name", 0)); if (!eventData) { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); return NULL; } Event *event = new (__FILE__, __LINE__) Event(Json::getFloat(keyMap, "time", 0), *eventData); @@ -1388,7 +1388,7 @@ Animation *SkeletonJson::readAnimation(Json *map, SkeletonData *skeletonData) { return new (__FILE__, __LINE__) Animation(String(map->_name), timelines, duration); } -void SkeletonJson::readTimeline(Vector &timelines, Json *keyMap, CurveTimeline1 *timeline, float defaultValue, float scale) { +void SkeletonJson::readTimeline(Array &timelines, Json *keyMap, CurveTimeline1 *timeline, float defaultValue, float scale) { float time = Json::getFloat(keyMap, "time", 0), value = Json::getFloat(keyMap, "value", defaultValue) * scale; for (int frame = 0, bezier = 0;; frame++) { timeline->setFrame(frame, time, value); @@ -1407,7 +1407,7 @@ void SkeletonJson::readTimeline(Vector &timelines, Json *keyMap, Cur } } -void SkeletonJson::readTimeline(Vector &timelines, Json *keyMap, CurveTimeline2 *timeline, const char *name1, const char *name2, +void SkeletonJson::readTimeline(Array &timelines, Json *keyMap, CurveTimeline2 *timeline, const char *name1, const char *name2, float defaultValue, float scale) { float time = Json::getFloat(keyMap, "time", 0); float value1 = Json::getFloat(keyMap, name1, defaultValue) * scale, value2 = Json::getFloat(keyMap, name2, defaultValue) * scale; @@ -1457,10 +1457,10 @@ void SkeletonJson::setBezier(CurveTimeline *timeline, int frame, int value, int timeline->setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); } -int SkeletonJson::findSlotIndex(SkeletonData *skeletonData, const String &slotName, Vector timelines) { - int slotIndex = ContainerUtil::findIndexWithName(skeletonData->getSlots(), slotName); +int SkeletonJson::findSlotIndex(SkeletonData *skeletonData, const String &slotName, Array timelines) { + int slotIndex = ArrayUtils::findIndexWithName(skeletonData->getSlots(), slotName); if (slotIndex == -1) { - ContainerUtil::cleanUpVectorOfPointers(timelines); + ArrayUtils::deleteElements(timelines); setError(NULL, "Slot not found: ", slotName); } return slotIndex; diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonRenderer.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonRenderer.cpp index 10642123a..349c060bb 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonRenderer.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonRenderer.cpp @@ -65,7 +65,7 @@ static RenderCommand *createRenderCommand(BlockAllocator &allocator, int numVert return cmd; } -static RenderCommand *batchSubCommands(BlockAllocator &allocator, Vector &commands, int first, int last, int numVertices, int numIndices) { +static RenderCommand *batchSubCommands(BlockAllocator &allocator, Array &commands, int first, int last, int numVertices, int numIndices) { RenderCommand *batched = createRenderCommand(allocator, numVertices, numIndices, commands[first]->blendMode, commands[first]->texture); float *positions = batched->positions; float *uvs = batched->uvs; @@ -91,7 +91,7 @@ static RenderCommand *batchSubCommands(BlockAllocator &allocator, Vector &commands) { +static RenderCommand *batchCommands(BlockAllocator &allocator, Array &commands) { if (commands.size() == 0) return nullptr; RenderCommand *root = nullptr; @@ -156,12 +156,12 @@ RenderCommand *SkeletonRenderer::render(Skeleton &skeleton) { continue; } - Vector *worldVertices = &_worldVertices; - Vector *quadIndices = &_quadIndices; - Vector *vertices = worldVertices; + Array *worldVertices = &_worldVertices; + Array *quadIndices = &_quadIndices; + Array *vertices = worldVertices; int32_t verticesCount; - Vector *uvs; - Vector *indices; + Array *uvs; + Array *indices; int32_t indicesCount; Color *attachmentColor; void *texture; diff --git a/spine-cpp/spine-cpp/src/spine/Skin.cpp b/spine-cpp/spine-cpp/src/spine/Skin.cpp index f69c2191f..58aaa6914 100644 --- a/spine-cpp/spine-cpp/src/spine/Skin.cpp +++ b/spine-cpp/spine-cpp/src/spine/Skin.cpp @@ -51,8 +51,8 @@ static void disposeAttachment(Attachment *attachment) { void Skin::AttachmentMap::put(size_t slotIndex, const String &attachmentName, Attachment *attachment) { if (slotIndex >= _buckets.size()) - _buckets.setSize(slotIndex + 1, Vector()); - Vector &bucket = _buckets[slotIndex]; + _buckets.setSize(slotIndex + 1, Array()); + Array &bucket = _buckets[slotIndex]; int existing = findInBucket(bucket, attachmentName); attachment->reference(); if (existing >= 0) { @@ -78,7 +78,7 @@ void Skin::AttachmentMap::remove(size_t slotIndex, const String &attachmentName) } } -int Skin::AttachmentMap::findInBucket(Vector &bucket, const String &attachmentName) { +int Skin::AttachmentMap::findInBucket(Array &bucket, const String &attachmentName) { for (size_t i = 0; i < bucket.size(); i++) if (bucket[i]._name == attachmentName) return (int) i; return -1; @@ -113,7 +113,7 @@ void Skin::removeAttachment(size_t slotIndex, const String &name) { _attachments.remove(slotIndex, name); } -void Skin::findNamesForSlot(size_t slotIndex, Vector &names) { +void Skin::findNamesForSlot(size_t slotIndex, Array &names) { Skin::AttachmentMap::Entries entries = _attachments.getEntries(); while (entries.hasNext()) { Skin::AttachmentMap::Entry &entry = entries.next(); @@ -123,7 +123,7 @@ void Skin::findNamesForSlot(size_t slotIndex, Vector &names) { } } -void Skin::findAttachmentsForSlot(size_t slotIndex, Vector &attachments) { +void Skin::findAttachmentsForSlot(size_t slotIndex, Array &attachments) { Skin::AttachmentMap::Entries entries = _attachments.getEntries(); while (entries.hasNext()) { Skin::AttachmentMap::Entry &entry = entries.next(); @@ -140,7 +140,7 @@ Skin::AttachmentMap::Entries Skin::getAttachments() { } void Skin::attachAll(Skeleton &skeleton, Skin &oldSkin) { - Vector &slots = skeleton.getSlots(); + Array &slots = skeleton.getSlots(); Skin::AttachmentMap::Entries entries = oldSkin.getAttachments(); while (entries.hasNext()) { Skin::AttachmentMap::Entry &entry = entries.next(); @@ -186,10 +186,10 @@ void Skin::copySkin(Skin *other) { } } -Vector &Skin::getConstraints() { +Array &Skin::getConstraints() { return _constraints; } -Vector &Skin::getBones() { +Array &Skin::getBones() { return _bones; } diff --git a/spine-cpp/spine-cpp/src/spine/Slider.cpp b/spine-cpp/spine-cpp/src/spine/Slider.cpp index 572569443..295b52359 100644 --- a/spine-cpp/spine-cpp/src/spine/Slider.cpp +++ b/spine-cpp/spine-cpp/src/spine/Slider.cpp @@ -78,8 +78,8 @@ void Slider::update(Skeleton &skeleton, Physics physics) { p._time = MathUtil::max(0.0f, p._time); } - Vector &bones = skeleton._bones; - const Vector &indices = animation->getBones(); + Array &bones = skeleton._bones; + const Array &indices = animation->getBones(); for (size_t i = 0, n = indices.size(); i < n; i++) bones[indices[i]]->_applied->modifyLocal(skeleton); @@ -91,8 +91,8 @@ void Slider::sort(Skeleton &skeleton) { if (_bone != NULL && !_data._local) skeleton.sortBone(_bone); skeleton._updateCache.add(this); - Vector &bones = skeleton._bones; - const Vector &indices = _data._animation->getBones(); + Array &bones = skeleton._bones; + const Array &indices = _data._animation->getBones(); for (size_t i = 0, n = indices.size(); i < n; i++) { Bone *bone = bones[indices[i]]; bone->_sorted = false; @@ -100,10 +100,10 @@ void Slider::sort(Skeleton &skeleton) { skeleton.constrained(*bone); } - Vector &timelines = _data._animation->getTimelines(); - Vector &slots = skeleton._slots; - Vector &constraints = skeleton._constraints; - Vector &physics = skeleton._physics; + Array &timelines = _data._animation->getTimelines(); + Array &slots = skeleton._slots; + Array &constraints = skeleton._constraints; + Array &physics = skeleton._physics; size_t physicsCount = physics.size(); for (size_t i = 0, n = timelines.size(); i < n; i++) { Timeline *t = timelines[i]; diff --git a/spine-cpp/spine-cpp/src/spine/SliderMixTimeline.cpp b/spine-cpp/spine-cpp/src/spine/SliderMixTimeline.cpp index 489429554..afcc28d6a 100644 --- a/spine-cpp/spine-cpp/src/spine/SliderMixTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/SliderMixTimeline.cpp @@ -54,7 +54,7 @@ SliderMixTimeline::SliderMixTimeline(size_t frameCount, size_t bezierCount, SliderMixTimeline::~SliderMixTimeline() { } -void SliderMixTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, +void SliderMixTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); diff --git a/spine-cpp/spine-cpp/src/spine/SliderTimeline.cpp b/spine-cpp/spine-cpp/src/spine/SliderTimeline.cpp index bce1dc103..faa3c1a7c 100644 --- a/spine-cpp/spine-cpp/src/spine/SliderTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/SliderTimeline.cpp @@ -54,7 +54,7 @@ SliderTimeline::SliderTimeline(size_t frameCount, size_t bezierCount, SliderTimeline::~SliderTimeline() { } -void SliderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, +void SliderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); diff --git a/spine-cpp/spine-cpp/src/spine/SlotCurveTimeline.cpp b/spine-cpp/spine-cpp/src/spine/SlotCurveTimeline.cpp index fb0f053dd..b54c254ac 100644 --- a/spine-cpp/spine-cpp/src/spine/SlotCurveTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/SlotCurveTimeline.cpp @@ -45,7 +45,7 @@ SlotCurveTimeline::SlotCurveTimeline(size_t frameCount, size_t frameEntries, siz SlotCurveTimeline::~SlotCurveTimeline() { } -void SlotCurveTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, +void SlotCurveTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); diff --git a/spine-cpp/spine-cpp/src/spine/SlotPose.cpp b/spine-cpp/spine-cpp/src/spine/SlotPose.cpp index dda97c4b7..a253ef8ef 100644 --- a/spine-cpp/spine-cpp/src/spine/SlotPose.cpp +++ b/spine-cpp/spine-cpp/src/spine/SlotPose.cpp @@ -93,6 +93,6 @@ void SlotPose::setSequenceIndex(int sequenceIndex) { _sequenceIndex = sequenceIndex; } -Vector &SlotPose::getDeform() { +Array &SlotPose::getDeform() { return _deform; } \ No newline at end of file diff --git a/spine-cpp/spine-cpp/src/spine/Timeline.cpp b/spine-cpp/spine-cpp/src/spine/Timeline.cpp index 196bc3d75..63643a4f1 100644 --- a/spine-cpp/spine-cpp/src/spine/Timeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/Timeline.cpp @@ -44,7 +44,7 @@ Timeline::Timeline(size_t frameCount, size_t frameEntries) Timeline::~Timeline() { } -Vector &Timeline::getPropertyIds() { +Array &Timeline::getPropertyIds() { return _propertyIds; } @@ -60,7 +60,7 @@ size_t Timeline::getFrameCount() { return _frames.size() / _frameEntries; } -Vector &Timeline::getFrames() { +Array &Timeline::getFrames() { return _frames; } diff --git a/spine-cpp/spine-cpp/src/spine/TransformConstraint.cpp b/spine-cpp/spine-cpp/src/spine/TransformConstraint.cpp index 1d6b986e4..04fc34a53 100644 --- a/spine-cpp/spine-cpp/src/spine/TransformConstraint.cpp +++ b/spine-cpp/spine-cpp/src/spine/TransformConstraint.cpp @@ -84,7 +84,7 @@ void TransformConstraint::update(Skeleton &skeleton, Physics physics) { for (size_t f = 0; f < fn; f++) { FromProperty *from = fromItems[f]; float value = from->value(skeleton, source, localSource, offsets) - from->_offset; - Vector &toProps = from->_to; + Array &toProps = from->_to; ToProperty **toItems = toProps.buffer(); for (size_t t = 0, tn = toProps.size(); t < tn; t++) { ToProperty *to = toItems[t]; @@ -127,7 +127,7 @@ bool TransformConstraint::isSourceActive() { } /// The bones that will be modified by this transform constraint. -Vector &TransformConstraint::getBones() { +Array &TransformConstraint::getBones() { return _bones; } diff --git a/spine-cpp/spine-cpp/src/spine/TransformConstraintData.cpp b/spine-cpp/spine-cpp/src/spine/TransformConstraintData.cpp index 5b28b127d..d79fef084 100644 --- a/spine-cpp/spine-cpp/src/spine/TransformConstraintData.cpp +++ b/spine-cpp/spine-cpp/src/spine/TransformConstraintData.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include using namespace spine; @@ -51,7 +51,7 @@ TransformConstraintData::TransformConstraintData(const String &name) : Constrain } } -Vector &TransformConstraintData::getBones() { +Array &TransformConstraintData::getBones() { return _bones; } @@ -143,7 +143,7 @@ void TransformConstraintData::setClamp(bool clamp) { _clamp = clamp; } -Vector &TransformConstraintData::getProperties() { +Array &TransformConstraintData::getProperties() { return _properties; } @@ -326,7 +326,7 @@ TransformConstraintData::~TransformConstraintData() { FromProperty *fromProp = _properties[i]; if (fromProp) { // Clean up the ToProperty objects in the FromProperty - ContainerUtil::cleanUpVectorOfPointers(fromProp->_to); + ArrayUtils::deleteElements(fromProp->_to); delete fromProp; } } diff --git a/spine-cpp/spine-cpp/src/spine/TransformConstraintTimeline.cpp b/spine-cpp/spine-cpp/src/spine/TransformConstraintTimeline.cpp index aeadd1153..55d142b03 100644 --- a/spine-cpp/spine-cpp/src/spine/TransformConstraintTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/TransformConstraintTimeline.cpp @@ -56,7 +56,7 @@ TransformConstraintTimeline::TransformConstraintTimeline(size_t frameCount, size TransformConstraintTimeline::~TransformConstraintTimeline() { } -void TransformConstraintTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, +void TransformConstraintTimeline::apply(Skeleton &skeleton, float lastTime, float time, Array *pEvents, float alpha, MixBlend blend, MixDirection direction, bool appliedPose) { SP_UNUSED(lastTime); SP_UNUSED(pEvents); diff --git a/spine-cpp/spine-cpp/src/spine/Triangulator.cpp b/spine-cpp/spine-cpp/src/spine/Triangulator.cpp index 336c6f522..a4a4bfc15 100644 --- a/spine-cpp/spine-cpp/src/spine/Triangulator.cpp +++ b/spine-cpp/spine-cpp/src/spine/Triangulator.cpp @@ -34,14 +34,14 @@ using namespace spine; Triangulator::~Triangulator() { - ContainerUtil::cleanUpVectorOfPointers(_convexPolygons); - ContainerUtil::cleanUpVectorOfPointers(_convexPolygonsIndices); + ArrayUtils::deleteElements(_convexPolygons); + ArrayUtils::deleteElements(_convexPolygonsIndices); } -Vector &Triangulator::triangulate(Vector &vertices) { +Array &Triangulator::triangulate(Array &vertices) { size_t vertexCount = vertices.size() >> 1; - Vector &indices = _indices; + Array &indices = _indices; indices.clear(); indices.ensureCapacity(vertexCount); indices.setSize(vertexCount, 0); @@ -49,14 +49,14 @@ Vector &Triangulator::triangulate(Vector &vertices) { indices[i] = i; } - Vector &isConcaveArray = _isConcaveArray; + Array &isConcaveArray = _isConcaveArray; isConcaveArray.ensureCapacity(vertexCount); isConcaveArray.setSize(vertexCount, 0); for (int i = 0, n = (int) vertexCount; i < n; ++i) { isConcaveArray[i] = isConcave(i, (int) vertexCount, vertices, indices); } - Vector &triangles = _triangles; + Array &triangles = _triangles; triangles.clear(); triangles.ensureCapacity(MathUtil::max((int) 0, (int) vertexCount - 2) << 2); @@ -124,21 +124,21 @@ Vector &Triangulator::triangulate(Vector &vertices) { return triangles; } -Vector *> &Triangulator::decompose(Vector &vertices, Vector &triangles) { - Vector *> &convexPolygons = _convexPolygons; +Array *> &Triangulator::decompose(Array &vertices, Array &triangles) { + Array *> &convexPolygons = _convexPolygons; for (size_t i = 0, n = convexPolygons.size(); i < n; ++i) _polygonPool.free(convexPolygons[i]); convexPolygons.clear(); - Vector *> &convexPolygonsIndices = _convexPolygonsIndices; + Array *> &convexPolygonsIndices = _convexPolygonsIndices; for (size_t i = 0, n = convexPolygonsIndices.size(); i < n; ++i) _polygonIndicesPool.free(convexPolygonsIndices[i]); convexPolygonsIndices.clear(); - Vector *polygonIndices = _polygonIndicesPool.obtain(); + Array *polygonIndices = _polygonIndicesPool.obtain(); polygonIndices->clear(); - Vector *polygon = _polygonPool.obtain(); + Array *polygon = _polygonPool.obtain(); polygon->clear(); // Merge subsequent triangles if they form a triangle fan. @@ -153,7 +153,7 @@ Vector *> &Triangulator::decompose(Vector &vertices, Vector bool merged = false; if (fanBaseIndex == t1) { size_t o = polygon->size() - 4; - Vector &p = *polygon; + Array &p = *polygon; int winding1 = winding(p[o], p[o + 1], p[o + 2], p[o + 3], x3, y3); int winding2 = winding(x3, y3, p[0], p[1], p[2], p[3]); if (winding1 == lastwinding && winding2 == lastwinding) { @@ -207,7 +207,7 @@ Vector *> &Triangulator::decompose(Vector &vertices, Vector polygon = convexPolygons[i]; size_t o = polygon->size() - 4; - Vector &p = *polygon; + Array &p = *polygon; float prevPrevX = p[o], prevPrevY = p[o + 1]; float prevX = p[o + 2], prevY = p[o + 3]; float firstX = p[0], firstY = p[1]; @@ -217,8 +217,8 @@ Vector *> &Triangulator::decompose(Vector &vertices, Vector for (size_t ii = 0; ii < n; ++ii) { if (ii == i) continue; - Vector *otherIndicesP = convexPolygonsIndices[ii]; - Vector &otherIndices = *otherIndicesP; + Array *otherIndicesP = convexPolygonsIndices[ii]; + Array &otherIndices = *otherIndicesP; if (otherIndices.size() != 3) continue; @@ -226,8 +226,8 @@ Vector *> &Triangulator::decompose(Vector &vertices, Vector int otherSecondIndex = otherIndices[1]; int otherLastIndex = otherIndices[2]; - Vector *otherPolyP = convexPolygons[ii]; - Vector &otherPoly = *otherPolyP; + Array *otherPolyP = convexPolygons[ii]; + Array &otherPoly = *otherPolyP; float x3 = otherPoly[otherPoly.size() - 2], y3 = otherPoly[otherPoly.size() - 1]; @@ -265,7 +265,7 @@ Vector *> &Triangulator::decompose(Vector &vertices, Vector return convexPolygons; } -bool Triangulator::isConcave(int index, int vertexCount, Vector &vertices, Vector &indices) { +bool Triangulator::isConcave(int index, int vertexCount, Array &vertices, Array &indices) { int previous = indices[(vertexCount + index - 1) % vertexCount] << 1; int current = indices[index] << 1; int next = indices[(index + 1) % vertexCount] << 1; diff --git a/spine-cpp/spine-cpp/src/spine/VertexAttachment.cpp b/spine-cpp/spine-cpp/src/spine/VertexAttachment.cpp index bd3d0042c..14e4d73a0 100644 --- a/spine-cpp/spine-cpp/src/spine/VertexAttachment.cpp +++ b/spine-cpp/spine-cpp/src/spine/VertexAttachment.cpp @@ -46,7 +46,7 @@ VertexAttachment::~VertexAttachment() { } -void VertexAttachment::computeWorldVertices(Skeleton &skeleton, Slot &slot, size_t start, size_t count, Vector &worldVertices, +void VertexAttachment::computeWorldVertices(Skeleton &skeleton, Slot &slot, size_t start, size_t count, Array &worldVertices, size_t offset, size_t stride) { computeWorldVertices(skeleton, slot, start, count, worldVertices.buffer(), offset, stride); } @@ -54,9 +54,9 @@ void VertexAttachment::computeWorldVertices(Skeleton &skeleton, Slot &slot, size void VertexAttachment::computeWorldVertices(Skeleton &skeleton, Slot &slot, size_t start, size_t count, float *worldVertices, size_t offset, size_t stride) { count = offset + (count >> 1) * stride; - Vector *deformArray = &slot.getAppliedPose().getDeform(); - Vector *vertices = &_vertices; - Vector &bones = _bones; + Array *deformArray = &slot.getAppliedPose().getDeform(); + Array *vertices = &_vertices; + Array &bones = _bones; if (bones.size() == 0) { if (deformArray->size() > 0) vertices = deformArray; @@ -80,7 +80,7 @@ void VertexAttachment::computeWorldVertices(Skeleton &skeleton, Slot &slot, size skip += n; } - Vector &skeletonBones = skeleton.getBones(); + Array &skeletonBones = skeleton.getBones(); if (deformArray->size() == 0) { for (size_t w = offset, b = skip * 3; w < count; w += stride) { float wx = 0, wy = 0; @@ -122,19 +122,19 @@ int VertexAttachment::getId() { return _id; } -Vector &VertexAttachment::getBones() { +Array &VertexAttachment::getBones() { return _bones; } -void VertexAttachment::setBones(Vector &bones) { +void VertexAttachment::setBones(Array &bones) { _bones.clearAndAddAll(bones); } -Vector &VertexAttachment::getVertices() { +Array &VertexAttachment::getVertices() { return _vertices; } -void VertexAttachment::setVertices(Vector &vertices) { +void VertexAttachment::setVertices(Array &vertices) { _vertices.clearAndAddAll(vertices); }