From ad381b43ef04d9f51602742a66b05832fbde0caa Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sat, 7 Jun 2025 02:39:16 +0200 Subject: [PATCH] [cpp] 4.3 porting WIP --- spine-cpp/spine-cpp/include/spine/BoneLocal.h | 92 ++++++++++++ spine-cpp/spine-cpp/include/spine/Event.h | 6 +- spine-cpp/spine-cpp/include/spine/Posed.h | 88 ++++++++++++ .../spine-cpp/include/spine/PosedActive.h | 71 ++++++++++ .../include/spine/TransformConstraintPose.h | 75 ++++++++++ .../include/spine/{Updatable.h => Update.h} | 27 ++-- spine-cpp/spine-cpp/include/spine/spine.h | 8 +- spine-cpp/spine-cpp/src/spine/BoneLocal.cpp | 131 ++++++++++++++++++ .../src/spine/TransformConstraintPose.cpp | 98 +++++++++++++ .../src/spine/{Updatable.cpp => Update.cpp} | 10 +- 10 files changed, 584 insertions(+), 22 deletions(-) create mode 100644 spine-cpp/spine-cpp/include/spine/BoneLocal.h create mode 100644 spine-cpp/spine-cpp/include/spine/Posed.h create mode 100644 spine-cpp/spine-cpp/include/spine/PosedActive.h create mode 100644 spine-cpp/spine-cpp/include/spine/TransformConstraintPose.h rename spine-cpp/spine-cpp/include/spine/{Updatable.h => Update.h} (80%) create mode 100644 spine-cpp/spine-cpp/src/spine/BoneLocal.cpp create mode 100644 spine-cpp/spine-cpp/src/spine/TransformConstraintPose.cpp rename spine-cpp/spine-cpp/src/spine/{Updatable.cpp => Update.cpp} (93%) diff --git a/spine-cpp/spine-cpp/include/spine/BoneLocal.h b/spine-cpp/spine-cpp/include/spine/BoneLocal.h new file mode 100644 index 000000000..47a17499d --- /dev/null +++ b/spine-cpp/spine-cpp/include/spine/BoneLocal.h @@ -0,0 +1,92 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated January 1, 2020. Replaces all prior versions. + * + * Copyright (c) 2013-2020, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, + * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef SPINE_BONELOCAL_H_ +#define SPINE_BONELOCAL_H_ + +#include +#include +#include +#include + +namespace spine { + /// Stores a bone's local pose. + class SP_API BoneLocal : public SpineObject, public Pose { + RTTI_DECL + + private: + float _x, _y, _rotation, _scaleX, _scaleY, _shearX, _shearY; + Inherit _inherit; + + public: + BoneLocal(); + virtual ~BoneLocal(); + + virtual void set(BoneLocal& pose) override; + + /// The local x translation. + float getX(); + void setX(float x); + + /// The local y translation. + float getY(); + void setY(float y); + + void setPosition(float x, float y); + + /// The local rotation in degrees, counter clockwise. + float getRotation(); + void setRotation(float rotation); + + /// The local scaleX. + float getScaleX(); + void setScaleX(float scaleX); + + /// The local scaleY. + float getScaleY(); + void setScaleY(float scaleY); + + void setScale(float scaleX, float scaleY); + void setScale(float scale); + + /// The local shearX. + float getShearX(); + void setShearX(float shearX); + + /// The local shearY. + float getShearY(); + void setShearY(float shearY); + + /// Determines how parent world transforms affect this bone. + Inherit getInherit(); + void setInherit(Inherit inherit); + }; +} + +#endif /* SPINE_BONELOCAL_H_ */ \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/Event.h b/spine-cpp/spine-cpp/include/spine/Event.h index b838a48bd..cf89eb46f 100644 --- a/spine-cpp/spine-cpp/include/spine/Event.h +++ b/spine-cpp/spine-cpp/include/spine/Event.h @@ -36,7 +36,10 @@ namespace spine { class EventData; -/// Stores the current pose values for an Event. + /// Stores the current pose values for an Event. + /// + /// See Timeline::apply(), AnimationStateListener::event(), and + /// @see https://esotericsoftware.com/spine-events Events in the Spine User Guide. class SP_API Event : public SpineObject { friend class SkeletonBinary; @@ -47,6 +50,7 @@ namespace spine { public: Event(float time, const EventData &data); + /// The event's setup pose data. const EventData &getData(); /// The animation time this event was keyed. diff --git a/spine-cpp/spine-cpp/include/spine/Posed.h b/spine-cpp/spine-cpp/include/spine/Posed.h new file mode 100644 index 000000000..a06c07fb3 --- /dev/null +++ b/spine-cpp/spine-cpp/include/spine/Posed.h @@ -0,0 +1,88 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, + * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef Spine_Posed_h +#define Spine_Posed_h + +#include + +namespace spine { + template + class SP_API Posed : public SpineObject { + public: + Posed(D& data, P& pose, A& constrained); + virtual ~Posed(); + + void setupPose(); + + /// The constraint's setup pose data. + D& getData(); + + P& getPose(); + + A& getAppliedPose(); + + protected: + D& _data; + P& _pose; + A& _constrained; + A* _applied; + }; + + template + Posed::Posed(D& data, P& pose, A& constrained) : _data(data), _pose(pose), _constrained(constrained) { + _applied = &pose; + } + + template + Posed::~Posed() { + } + + template + void Posed::setupPose() { + _pose.set(_data.setup); + } + + template + D& Posed::getData() { + return _data; + } + + template + P& Posed::getPose() { + return _pose; + } + + template + A& Posed::getAppliedPose() { + return *_applied; + } +} + +#endif /* Spine_Posed_h */ \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/PosedActive.h b/spine-cpp/spine-cpp/include/spine/PosedActive.h new file mode 100644 index 000000000..2968f6dd7 --- /dev/null +++ b/spine-cpp/spine-cpp/include/spine/PosedActive.h @@ -0,0 +1,71 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated January 1, 2020. Replaces all prior versions. + * + * Copyright (c) 2013-2020, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, + * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef SPINE_POSEDACTIVE_H_ +#define SPINE_POSEDACTIVE_H_ + +#include +#include + +namespace spine { + template + class SP_API PosedActive : public Posed { + protected: + bool _active; + + public: + PosedActive(D& data, P& pose, A& constrained); + virtual ~PosedActive(); + + /// Returns false when this constraint won't be updated by + /// Skeleton::updateWorldTransform() because a skin is required and the + /// active skin does not contain this item. + /// @see Skin::getBones() + /// @see Skin::getConstraints() + /// @see PosedData::getSkinRequired() + /// @see Skeleton::updateCache() + bool isActive(); + }; + + template + PosedActive::PosedActive(D& data, P& pose, A& constrained) : Posed(data, pose, constrained), _active(false) { + this->setupPose(); + } + + template + PosedActive::~PosedActive() { + } + + template + bool PosedActive::isActive() { + return _active; + } +} + +#endif /* SPINE_POSEDACTIVE_H_ */ \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/TransformConstraintPose.h b/spine-cpp/spine-cpp/include/spine/TransformConstraintPose.h new file mode 100644 index 000000000..5870e7827 --- /dev/null +++ b/spine-cpp/spine-cpp/include/spine/TransformConstraintPose.h @@ -0,0 +1,75 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, + * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef Spine_TransformConstraintPose_h +#define Spine_TransformConstraintPose_h + +#include +#include + +namespace spine { + /// Stores a pose for a transform constraint. + class SP_API TransformConstraintPose : public Pose { + RTTI_DECL + private: + float _mixRotate, _mixX, _mixY, _mixScaleX, _mixScaleY, _mixShearY; + + public: + TransformConstraintPose(); + virtual ~TransformConstraintPose(); + + virtual void set(TransformConstraintPose& pose) override; + + /// A percentage (0-1) that controls the mix between the constrained and unconstrained rotation. + float getMixRotate(); + void setMixRotate(float mixRotate); + + /// A percentage (0-1) that controls the mix between the constrained and unconstrained translation X. + float getMixX(); + void setMixX(float mixX); + + /// A percentage (0-1) that controls the mix between the constrained and unconstrained translation Y. + float getMixY(); + void setMixY(float mixY); + + /// A percentage (0-1) that controls the mix between the constrained and unconstrained scale X. + float getMixScaleX(); + void setMixScaleX(float mixScaleX); + + /// A percentage (0-1) that controls the mix between the constrained and unconstrained scale Y. + float getMixScaleY(); + void setMixScaleY(float mixScaleY); + + /// A percentage (0-1) that controls the mix between the constrained and unconstrained shear Y. + float getMixShearY(); + void setMixShearY(float mixShearY); + }; +} + +#endif \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/Updatable.h b/spine-cpp/spine-cpp/include/spine/Update.h similarity index 80% rename from spine-cpp/spine-cpp/include/spine/Updatable.h rename to spine-cpp/spine-cpp/include/spine/Update.h index dc5b4d375..71ff0d394 100644 --- a/spine-cpp/spine-cpp/include/spine/Updatable.h +++ b/spine-cpp/spine-cpp/include/spine/Update.h @@ -27,28 +27,27 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#ifndef Spine_Updatable_h -#define Spine_Updatable_h +#ifndef Spine_Update_h +#define Spine_Update_h +#include +#include #include #include -#include namespace spine { - class SP_API Updatable : public SpineObject { - RTTI_DECL + class Skeleton; + /// The interface for items updated by Skeleton::updateWorldTransform(). + class SP_API Update : public SpineObject { + RTTI_DECL public: - Updatable(); + Update(); + virtual ~Update(); - virtual ~Updatable(); - - virtual void update(Physics physics) = 0; - - virtual bool isActive() = 0; - - virtual void setActive(bool inValue) = 0; + /// @param physics Determines how physics and other non-deterministic updates are applied. + virtual void update(Skeleton& skeleton, Physics physics) = 0; }; } -#endif /* Spine_Updatable_h */ +#endif /* Spine_Update_h */ \ No newline at end of file diff --git a/spine-cpp/spine-cpp/include/spine/spine.h b/spine-cpp/spine-cpp/include/spine/spine.h index e617de641..ff04d49cf 100644 --- a/spine-cpp/spine-cpp/include/spine/spine.h +++ b/spine-cpp/spine-cpp/include/spine/spine.h @@ -41,8 +41,9 @@ #include #include #include -#include #include +#include +#include #include #include #include @@ -83,6 +84,8 @@ #include #include #include +#include +#include #include #include #include @@ -113,10 +116,11 @@ #include #include #include +#include #include #include #include -#include +#include #include #include #include diff --git a/spine-cpp/spine-cpp/src/spine/BoneLocal.cpp b/spine-cpp/spine-cpp/src/spine/BoneLocal.cpp new file mode 100644 index 000000000..b22c7542d --- /dev/null +++ b/spine-cpp/spine-cpp/src/spine/BoneLocal.cpp @@ -0,0 +1,131 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated January 1, 2020. Replaces all prior versions. + * + * Copyright (c) 2013-2020, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, + * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#include +#include + +using namespace spine; + +RTTI_IMPL_NOPARENT(BoneLocal) + +BoneLocal::BoneLocal() : _x(0), _y(0), _rotation(0), _scaleX(1), _scaleY(1), _shearX(0), _shearY(0), _inherit(Inherit_Normal) { +} + +BoneLocal::~BoneLocal() { +} + +void BoneLocal::set(BoneLocal& pose) { + _x = pose._x; + _y = pose._y; + _rotation = pose._rotation; + _scaleX = pose._scaleX; + _scaleY = pose._scaleY; + _shearX = pose._shearX; + _shearY = pose._shearY; + _inherit = pose._inherit; +} + +float BoneLocal::getX() { + return _x; +} + +void BoneLocal::setX(float x) { + _x = x; +} + +float BoneLocal::getY() { + return _y; +} + +void BoneLocal::setY(float y) { + _y = y; +} + +void BoneLocal::setPosition(float x, float y) { + _x = x; + _y = y; +} + +float BoneLocal::getRotation() { + return _rotation; +} + +void BoneLocal::setRotation(float rotation) { + _rotation = rotation; +} + +float BoneLocal::getScaleX() { + return _scaleX; +} + +void BoneLocal::setScaleX(float scaleX) { + _scaleX = scaleX; +} + +float BoneLocal::getScaleY() { + return _scaleY; +} + +void BoneLocal::setScaleY(float scaleY) { + _scaleY = scaleY; +} + +void BoneLocal::setScale(float scaleX, float scaleY) { + _scaleX = scaleX; + _scaleY = scaleY; +} + +void BoneLocal::setScale(float scale) { + _scaleX = scale; + _scaleY = scale; +} + +float BoneLocal::getShearX() { + return _shearX; +} + +void BoneLocal::setShearX(float shearX) { + _shearX = shearX; +} + +float BoneLocal::getShearY() { + return _shearY; +} + +void BoneLocal::setShearY(float shearY) { + _shearY = shearY; +} + +Inherit BoneLocal::getInherit() { + return _inherit; +} + +void BoneLocal::setInherit(Inherit inherit) { + _inherit = inherit; +} \ No newline at end of file diff --git a/spine-cpp/spine-cpp/src/spine/TransformConstraintPose.cpp b/spine-cpp/spine-cpp/src/spine/TransformConstraintPose.cpp new file mode 100644 index 000000000..04f9f919a --- /dev/null +++ b/spine-cpp/spine-cpp/src/spine/TransformConstraintPose.cpp @@ -0,0 +1,98 @@ +/****************************************************************************** + * Spine Runtimes License Agreement + * Last updated April 5, 2025. Replaces all prior versions. + * + * Copyright (c) 2013-2025, Esoteric Software LLC + * + * Integration of the Spine Runtimes into software or otherwise creating + * derivative works of the Spine Runtimes is permitted under the terms and + * conditions of Section 2 of the Spine Editor License Agreement: + * http://esotericsoftware.com/spine-editor-license + * + * Otherwise, it is permitted to integrate the Spine Runtimes into software + * or otherwise create derivative works of the Spine Runtimes (collectively, + * "Products"), provided that each user of the Products must obtain their own + * Spine Editor license and redistribution of the Products in any form must + * include this license and copyright notice. + * + * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, + * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#include + +using namespace spine; + +RTTI_IMPL_NOPARENT(TransformConstraintPose) + +TransformConstraintPose::TransformConstraintPose() : + _mixRotate(0), _mixX(0), _mixY(0), _mixScaleX(0), _mixScaleY(0), _mixShearY(0) { +} + +TransformConstraintPose::~TransformConstraintPose() { +} + +void TransformConstraintPose::set(TransformConstraintPose& pose) { + _mixRotate = pose._mixRotate; + _mixX = pose._mixX; + _mixY = pose._mixY; + _mixScaleX = pose._mixScaleX; + _mixScaleY = pose._mixScaleY; + _mixShearY = pose._mixShearY; +} + +float TransformConstraintPose::getMixRotate() { + return _mixRotate; +} + +void TransformConstraintPose::setMixRotate(float mixRotate) { + this->_mixRotate = mixRotate; +} + +float TransformConstraintPose::getMixX() { + return _mixX; +} + +void TransformConstraintPose::setMixX(float mixX) { + this->_mixX = mixX; +} + +float TransformConstraintPose::getMixY() { + return _mixY; +} + +void TransformConstraintPose::setMixY(float mixY) { + this->_mixY = mixY; +} + +float TransformConstraintPose::getMixScaleX() { + return _mixScaleX; +} + +void TransformConstraintPose::setMixScaleX(float mixScaleX) { + this->_mixScaleX = mixScaleX; +} + +float TransformConstraintPose::getMixScaleY() { + return _mixScaleY; +} + +void TransformConstraintPose::setMixScaleY(float mixScaleY) { + this->_mixScaleY = mixScaleY; +} + +float TransformConstraintPose::getMixShearY() { + return _mixShearY; +} + +void TransformConstraintPose::setMixShearY(float mixShearY) { + this->_mixShearY = mixShearY; +} \ No newline at end of file diff --git a/spine-cpp/spine-cpp/src/spine/Updatable.cpp b/spine-cpp/spine-cpp/src/spine/Update.cpp similarity index 93% rename from spine-cpp/spine-cpp/src/spine/Updatable.cpp rename to spine-cpp/spine-cpp/src/spine/Update.cpp index 8e874a272..81ee025dc 100644 --- a/spine-cpp/spine-cpp/src/spine/Updatable.cpp +++ b/spine-cpp/spine-cpp/src/spine/Update.cpp @@ -27,14 +27,14 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#include +#include using namespace spine; -RTTI_IMPL_NOPARENT(Updatable) +RTTI_IMPL_NOPARENT(Update) -Updatable::Updatable() { +Update::Update() { } -Updatable::~Updatable() { -} +Update::~Update() { +} \ No newline at end of file