mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ue4] Fixed up spine-cpp for use in UE4.
This commit is contained in:
parent
7899277aec
commit
1454f8a97a
@ -35,7 +35,7 @@
|
|||||||
#include <spine/MixBlend.h>
|
#include <spine/MixBlend.h>
|
||||||
#include <spine/MixDirection.h>
|
#include <spine/MixDirection.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class Timeline;
|
class Timeline;
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
#include <spine/Pool.h>
|
#include <spine/Pool.h>
|
||||||
#include <spine/MixBlend.h>
|
#include <spine/MixBlend.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
#include <spine/HasRendererObject.h>
|
#include <spine/HasRendererObject.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
@ -381,6 +381,9 @@ namespace spine {
|
|||||||
void setTimeScale(float inValue);
|
void setTimeScale(float inValue);
|
||||||
|
|
||||||
void setListener(AnimationStateListener listener);
|
void setListener(AnimationStateListener listener);
|
||||||
|
|
||||||
|
void disableQueue();
|
||||||
|
void enableQueue();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int Subsequent, First, Dip, DipMix;
|
static const int Subsequent, First, Dip, DipMix;
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <spine/HashMap.h>
|
#include <spine/HashMap.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
#include <spine/Vector.h>
|
#include <spine/Vector.h>
|
||||||
#include <spine/Extension.h>
|
#include <spine/Extension.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
#include <spine/HasRendererObject.h>
|
#include <spine/HasRendererObject.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
@ -114,6 +114,8 @@ public:
|
|||||||
/// @return The region, or NULL.
|
/// @return The region, or NULL.
|
||||||
AtlasRegion *findRegion(const String &name);
|
AtlasRegion *findRegion(const String &name);
|
||||||
|
|
||||||
|
Vector<AtlasPage*> &getPages();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Vector<AtlasPage *> _pages;
|
Vector<AtlasPage *> _pages;
|
||||||
Vector<AtlasRegion *> _regions;
|
Vector<AtlasRegion *> _regions;
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <spine/AttachmentLoader.h>
|
#include <spine/AttachmentLoader.h>
|
||||||
#include <spine/Vector.h>
|
#include <spine/Vector.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <spine/RTTI.h>
|
#include <spine/RTTI.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class Attachment : public SpineObject {
|
class Attachment : public SpineObject {
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <spine/RTTI.h>
|
#include <spine/RTTI.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class Skin;
|
class Skin;
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
#include <spine/Vector.h>
|
#include <spine/Vector.h>
|
||||||
#include <spine/MixBlend.h>
|
#include <spine/MixBlend.h>
|
||||||
#include <spine/MixDirection.h>
|
#include <spine/MixDirection.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class Skeleton;
|
class Skeleton;
|
||||||
|
|||||||
@ -221,6 +221,9 @@ public:
|
|||||||
/// Returns the magnitide (always positive) of the world scale Y.
|
/// Returns the magnitide (always positive) of the world scale Y.
|
||||||
float getWorldScaleY();
|
float getWorldScaleY();
|
||||||
|
|
||||||
|
bool isAppliedValid();
|
||||||
|
void setAppliedValid(bool valid);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool yDown;
|
static bool yDown;
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <spine/TransformMode.h>
|
#include <spine/TransformMode.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class BoneData : public SpineObject {
|
class BoneData : public SpineObject {
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
#include <spine/Vector.h>
|
#include <spine/Vector.h>
|
||||||
#include <spine/HashMap.h>
|
#include <spine/HashMap.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,7 @@ public:
|
|||||||
for (std::map<void*, Allocation>::iterator it = _allocated.begin(); it != _allocated.end(); it++) {
|
for (std::map<void*, Allocation>::iterator it = _allocated.begin(); it != _allocated.end(); it++) {
|
||||||
printf("\"%s:%i (%zu bytes at %p)\n", it->second.fileName, it->second.line, it->second.size, it->second.address);
|
printf("\"%s:%i (%zu bytes at %p)\n", it->second.fileName, it->second.line, it->second.size, it->second.address);
|
||||||
}
|
}
|
||||||
printf("allocations: %lu, reallocations: %lu, frees: %lu\n", _allocations, _reallocations, _frees);
|
printf("allocations: %zu, reallocations: %zu, frees: %zu\n", _allocations, _reallocations, _frees);
|
||||||
if (_allocated.empty()) printf("No leaks detected");
|
if (_allocated.empty()) printf("No leaks detected");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
#define Spine_Event_h
|
#define Spine_Event_h
|
||||||
|
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class EventData;
|
class EventData;
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
#define Spine_EventData_h
|
#define Spine_EventData_h
|
||||||
|
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
/// Stores the setup pose values for an Event.
|
/// Stores the setup pose values for an Event.
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <spine/Vector.h>
|
#include <spine/Vector.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class BoneData;
|
class BoneData;
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
#define Spine_LinkedMesh_h
|
#define Spine_LinkedMesh_h
|
||||||
|
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class MeshAttachment;
|
class MeshAttachment;
|
||||||
|
|||||||
@ -37,15 +37,16 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
static const float PI = 3.1415926535897932385f;
|
float PI = 3.1415926535897932385f;
|
||||||
static const float PI_2 = PI * 2;
|
float PI_2 = PI * 2;
|
||||||
static const float DEG_RAD = (PI / 180.0f);
|
float DEG_RAD = (PI / 180.0f);
|
||||||
static const float RAD_DEG = (180.0f / PI);
|
float RAD_DEG = (180.0f / PI);
|
||||||
|
|
||||||
class MathUtil : public SpineObject {
|
class MathUtil : public SpineObject {
|
||||||
public:
|
private:
|
||||||
MathUtil();
|
MathUtil();
|
||||||
|
|
||||||
|
public:
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static inline T min(T a, T b) { return a < b ? a : b; }
|
static inline T min(T a, T b) { return a < b ? a : b; }
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
#include <spine/RotateMode.h>
|
#include <spine/RotateMode.h>
|
||||||
#include <spine/Vector.h>
|
#include <spine/Vector.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class BoneData;
|
class BoneData;
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
#include <spine/Vector.h>
|
#include <spine/Vector.h>
|
||||||
#include <spine/MathUtil.h>
|
#include <spine/MathUtil.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
#include <spine/Color.h>
|
#include <spine/Color.h>
|
||||||
|
|
||||||
#include <limits> // std::numeric_limits
|
#include <limits> // std::numeric_limits
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
#include <spine/TransformMode.h>
|
#include <spine/TransformMode.h>
|
||||||
#include <spine/Vector.h>
|
#include <spine/Vector.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
#include <spine/Color.h>
|
#include <spine/Color.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
#define Spine_SkeletonData_h
|
#define Spine_SkeletonData_h
|
||||||
|
|
||||||
#include <spine/Vector.h>
|
#include <spine/Vector.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class BoneData;
|
class BoneData;
|
||||||
@ -82,7 +82,7 @@ public:
|
|||||||
Skin *findSkin(const String &skinName);
|
Skin *findSkin(const String &skinName);
|
||||||
|
|
||||||
/// @return May be NULL.
|
/// @return May be NULL.
|
||||||
EventData *findEvent(const String &eventDataName);
|
spine::EventData *findEvent(const String &eventDataName);
|
||||||
|
|
||||||
/// @return May be NULL.
|
/// @return May be NULL.
|
||||||
Animation *findAnimation(const String &animationName);
|
Animation *findAnimation(const String &animationName);
|
||||||
@ -119,7 +119,7 @@ public:
|
|||||||
|
|
||||||
void setDefaultSkin(Skin *inValue);
|
void setDefaultSkin(Skin *inValue);
|
||||||
|
|
||||||
Vector<EventData *> &getEvents();
|
Vector<spine::EventData *> &getEvents();
|
||||||
|
|
||||||
Vector<Animation *> &getAnimations();
|
Vector<Animation *> &getAnimations();
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <spine/Vector.h>
|
#include <spine/Vector.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class CurveTimeline;
|
class CurveTimeline;
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
#define Spine_Skin_h
|
#define Spine_Skin_h
|
||||||
|
|
||||||
#include <spine/Vector.h>
|
#include <spine/Vector.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class Attachment;
|
class Attachment;
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <spine/BlendMode.h>
|
#include <spine/BlendMode.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
#include <spine/Color.h>
|
#include <spine/Color.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
#define Spine_TextureLoader_h
|
#define Spine_TextureLoader_h
|
||||||
|
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class AtlasPage;
|
class AtlasPage;
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <spine/Vector.h>
|
#include <spine/Vector.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
class BoneData;
|
class BoneData;
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
#include <spine/Extension.h>
|
#include <spine/Extension.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|||||||
@ -50,6 +50,7 @@
|
|||||||
#include <spine/Constraint.h>
|
#include <spine/Constraint.h>
|
||||||
#include <spine/ContainerUtil.h>
|
#include <spine/ContainerUtil.h>
|
||||||
#include <spine/CurveTimeline.h>
|
#include <spine/CurveTimeline.h>
|
||||||
|
#include <spine/Debug.h>
|
||||||
#include <spine/DeformTimeline.h>
|
#include <spine/DeformTimeline.h>
|
||||||
#include <spine/DrawOrderTimeline.h>
|
#include <spine/DrawOrderTimeline.h>
|
||||||
#include <spine/Event.h>
|
#include <spine/Event.h>
|
||||||
@ -57,6 +58,7 @@
|
|||||||
#include <spine/EventTimeline.h>
|
#include <spine/EventTimeline.h>
|
||||||
#include <spine/Extension.h>
|
#include <spine/Extension.h>
|
||||||
#include <spine/HashMap.h>
|
#include <spine/HashMap.h>
|
||||||
|
#include <spine/HasRendererObject.h>
|
||||||
#include <spine/IkConstraint.h>
|
#include <spine/IkConstraint.h>
|
||||||
#include <spine/IkConstraintData.h>
|
#include <spine/IkConstraintData.h>
|
||||||
#include <spine/IkConstraintTimeline.h>
|
#include <spine/IkConstraintTimeline.h>
|
||||||
@ -64,8 +66,8 @@
|
|||||||
#include <spine/LinkedMesh.h>
|
#include <spine/LinkedMesh.h>
|
||||||
#include <spine/MathUtil.h>
|
#include <spine/MathUtil.h>
|
||||||
#include <spine/MeshAttachment.h>
|
#include <spine/MeshAttachment.h>
|
||||||
#include <spine/MixDirection.h>
|
|
||||||
#include <spine/MixBlend.h>
|
#include <spine/MixBlend.h>
|
||||||
|
#include <spine/MixDirection.h>
|
||||||
#include <spine/PathAttachment.h>
|
#include <spine/PathAttachment.h>
|
||||||
#include <spine/PathConstraint.h>
|
#include <spine/PathConstraint.h>
|
||||||
#include <spine/PathConstraintData.h>
|
#include <spine/PathConstraintData.h>
|
||||||
@ -90,8 +92,9 @@
|
|||||||
#include <spine/Skin.h>
|
#include <spine/Skin.h>
|
||||||
#include <spine/Slot.h>
|
#include <spine/Slot.h>
|
||||||
#include <spine/SlotData.h>
|
#include <spine/SlotData.h>
|
||||||
|
#include <spine/SpacingMode.h>
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
#include <spine/TextureLoader.h>
|
#include <spine/TextureLoader.h>
|
||||||
#include <spine/Timeline.h>
|
#include <spine/Timeline.h>
|
||||||
#include <spine/TimelineType.h>
|
#include <spine/TimelineType.h>
|
||||||
|
|||||||
@ -28,8 +28,11 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <spine/Animation.h>
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <spine/Animation.h>
|
||||||
#include <spine/Timeline.h>
|
#include <spine/Timeline.h>
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
#include <spine/Event.h>
|
#include <spine/Event.h>
|
||||||
|
|||||||
@ -28,14 +28,16 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <spine/AnimationState.h>
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <spine/AnimationState.h>
|
||||||
#include <spine/Animation.h>
|
#include <spine/Animation.h>
|
||||||
#include <spine/Event.h>
|
#include <spine/Event.h>
|
||||||
#include <spine/AnimationStateData.h>
|
#include <spine/AnimationStateData.h>
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
#include <spine/RotateTimeline.h>
|
#include <spine/RotateTimeline.h>
|
||||||
|
|
||||||
#include <spine/SkeletonData.h>
|
#include <spine/SkeletonData.h>
|
||||||
#include <spine/Bone.h>
|
#include <spine/Bone.h>
|
||||||
#include <spine/BoneData.h>
|
#include <spine/BoneData.h>
|
||||||
@ -659,6 +661,13 @@ void AnimationState::setListener(AnimationStateListener inValue) {
|
|||||||
_listener = inValue;
|
_listener = inValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AnimationState::disableQueue() {
|
||||||
|
_queue->_drainDisabled = true;
|
||||||
|
}
|
||||||
|
void AnimationState::enableQueue() {
|
||||||
|
_queue->_drainDisabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
Animation *AnimationState::getEmptyAnimation() {
|
Animation *AnimationState::getEmptyAnimation() {
|
||||||
static Vector<Timeline *> timelines;
|
static Vector<Timeline *> timelines;
|
||||||
static Animation ret(String("<empty>"), timelines, 0);
|
static Animation ret(String("<empty>"), timelines, 0);
|
||||||
|
|||||||
@ -28,8 +28,11 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <spine/AnimationStateData.h>
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <spine/AnimationStateData.h>
|
||||||
#include <spine/SkeletonData.h>
|
#include <spine/SkeletonData.h>
|
||||||
#include <spine/Animation.h>
|
#include <spine/Animation.h>
|
||||||
|
|
||||||
|
|||||||
@ -28,10 +28,12 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/Atlas.h>
|
#include <spine/Atlas.h>
|
||||||
|
|
||||||
#include <spine/TextureLoader.h>
|
#include <spine/TextureLoader.h>
|
||||||
|
|
||||||
#include <spine/ContainerUtil.h>
|
#include <spine/ContainerUtil.h>
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -92,6 +94,10 @@ AtlasRegion *Atlas::findRegion(const String &name) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vector<AtlasPage*> &Atlas::getPages() {
|
||||||
|
return _pages;
|
||||||
|
}
|
||||||
|
|
||||||
void Atlas::load(const char *begin, int length, const char *dir) {
|
void Atlas::load(const char *begin, int length, const char *dir) {
|
||||||
static const char *formatNames[] = {"", "Alpha", "Intensity", "LuminanceAlpha", "RGB565", "RGBA4444", "RGB888",
|
static const char *formatNames[] = {"", "Alpha", "Intensity", "LuminanceAlpha", "RGB565", "RGBA4444", "RGB888",
|
||||||
"RGBA8888"};
|
"RGBA8888"};
|
||||||
|
|||||||
@ -28,8 +28,11 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
******************************************************S**********************/
|
******************************************************S**********************/
|
||||||
|
|
||||||
#include <spine/AtlasAttachmentLoader.h>
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <spine/AtlasAttachmentLoader.h>
|
||||||
#include <spine/Skin.h>
|
#include <spine/Skin.h>
|
||||||
#include <spine/RegionAttachment.h>
|
#include <spine/RegionAttachment.h>
|
||||||
#include <spine/MeshAttachment.h>
|
#include <spine/MeshAttachment.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/Attachment.h>
|
#include <spine/Attachment.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/AttachmentLoader.h>
|
#include <spine/AttachmentLoader.h>
|
||||||
|
|
||||||
#include <spine/Skin.h>
|
#include <spine/Skin.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/AttachmentTimeline.h>
|
#include <spine/AttachmentTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/Bone.h>
|
#include <spine/Bone.h>
|
||||||
|
|
||||||
#include <spine/BoneData.h>
|
#include <spine/BoneData.h>
|
||||||
@ -505,6 +509,13 @@ float Bone::getWorldScaleY() {
|
|||||||
return MathUtil::sqrt(_b * _b + _d * _d);
|
return MathUtil::sqrt(_b * _b + _d * _d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Bone::isAppliedValid() {
|
||||||
|
return _appliedValid;
|
||||||
|
}
|
||||||
|
void Bone::setAppliedValid(bool valid) {
|
||||||
|
_appliedValid = valid;
|
||||||
|
}
|
||||||
|
|
||||||
void Bone::updateAppliedTransform() {
|
void Bone::updateAppliedTransform() {
|
||||||
Bone *parent = _parent;
|
Bone *parent = _parent;
|
||||||
_appliedValid = 1;
|
_appliedValid = 1;
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/BoneData.h>
|
#include <spine/BoneData.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/BoundingBoxAttachment.h>
|
#include <spine/BoundingBoxAttachment.h>
|
||||||
|
|
||||||
using namespace spine;
|
using namespace spine;
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/ClippingAttachment.h>
|
#include <spine/ClippingAttachment.h>
|
||||||
|
|
||||||
#include <spine/SlotData.h>
|
#include <spine/SlotData.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/ColorTimeline.h>
|
#include <spine/ColorTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/Constraint.h>
|
#include <spine/Constraint.h>
|
||||||
|
|
||||||
using namespace spine;
|
using namespace spine;
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/CurveTimeline.h>
|
#include <spine/CurveTimeline.h>
|
||||||
|
|
||||||
#include <spine/MathUtil.h>
|
#include <spine/MathUtil.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/DeformTimeline.h>
|
#include <spine/DeformTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/DrawOrderTimeline.h>
|
#include <spine/DrawOrderTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,13 +28,15 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/Event.h>
|
#include <spine/Event.h>
|
||||||
|
|
||||||
#include <spine/EventData.h>
|
#include <spine/EventData.h>
|
||||||
|
|
||||||
using namespace spine;
|
spine::Event::Event(float time, const spine::EventData &data) :
|
||||||
|
|
||||||
Event::Event(float time, const EventData &data) :
|
|
||||||
_data(data),
|
_data(data),
|
||||||
_time(time),
|
_time(time),
|
||||||
_intValue(0),
|
_intValue(0),
|
||||||
@ -42,34 +44,34 @@ Event::Event(float time, const EventData &data) :
|
|||||||
_stringValue() {
|
_stringValue() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const EventData &Event::getData() {
|
const spine::EventData &spine::Event::getData() {
|
||||||
return _data;
|
return _data;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Event::getTime() {
|
float spine::Event::getTime() {
|
||||||
return _time;
|
return _time;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Event::getIntValue() {
|
int spine::Event::getIntValue() {
|
||||||
return _intValue;
|
return _intValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Event::setIntValue(int inValue) {
|
void spine::Event::setIntValue(int inValue) {
|
||||||
_intValue = inValue;
|
_intValue = inValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Event::getFloatValue() {
|
float spine::Event::getFloatValue() {
|
||||||
return _floatValue;
|
return _floatValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Event::setFloatValue(float inValue) {
|
void spine::Event::setFloatValue(float inValue) {
|
||||||
_floatValue = inValue;
|
_floatValue = inValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const String &Event::getStringValue() {
|
const spine::String &spine::Event::getStringValue() {
|
||||||
return _stringValue;
|
return _stringValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Event::setStringValue(const String &inValue) {
|
void spine::Event::setStringValue(const spine::String &inValue) {
|
||||||
_stringValue = inValue;
|
_stringValue = inValue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,45 +28,47 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/EventData.h>
|
#include <spine/EventData.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
using namespace spine;
|
spine::EventData::EventData(const spine::String &name) :
|
||||||
|
|
||||||
EventData::EventData(const String &name) :
|
|
||||||
_name(name),
|
_name(name),
|
||||||
_intValue(0),
|
_intValue((int)0),
|
||||||
_floatValue(0),
|
_floatValue(0.0f)
|
||||||
_stringValue() {
|
{
|
||||||
assert(_name.length() > 0);
|
assert(_name.length() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The name of the event, which is unique within the skeleton.
|
/// The name of the event, which is unique within the skeleton.
|
||||||
const String &EventData::getName() const {
|
const spine::String &spine::EventData::getName() const {
|
||||||
return _name;
|
return _name;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EventData::getIntValue() {
|
int spine::EventData::getIntValue() {
|
||||||
return _intValue;
|
return _intValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventData::setIntValue(int inValue) {
|
void spine::EventData::setIntValue(int inValue) {
|
||||||
_intValue = inValue;
|
_intValue = inValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
float EventData::getFloatValue() {
|
float spine::EventData::getFloatValue() {
|
||||||
return _floatValue;
|
return _floatValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventData::setFloatValue(float inValue) {
|
void spine::EventData::setFloatValue(float inValue) {
|
||||||
_floatValue = inValue;
|
_floatValue = inValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const String &EventData::getStringValue() {
|
const spine::String &spine::EventData::getStringValue() {
|
||||||
return _stringValue;
|
return _stringValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventData::setStringValue(const String &inValue) {
|
void spine::EventData::setStringValue(const spine::String &inValue) {
|
||||||
_stringValue = inValue;
|
this->_stringValue = inValue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/EventTimeline.h>
|
#include <spine/EventTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,8 +28,12 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/Extension.h>
|
#include <spine/Extension.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/IkConstraint.h>
|
#include <spine/IkConstraint.h>
|
||||||
|
|
||||||
#include <spine/IkConstraintData.h>
|
#include <spine/IkConstraintData.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/IkConstraintData.h>
|
#include <spine/IkConstraintData.h>
|
||||||
|
|
||||||
#include <spine/BoneData.h>
|
#include <spine/BoneData.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/IkConstraintTimeline.h>
|
#include <spine/IkConstraintTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Json */
|
/* Json */
|
||||||
/* JSON parser in CPP, shamelessly ripped from json.c in the spine-c runtime */
|
/* JSON parser in CPP, shamelessly ripped from json.c in the spine-c runtime */
|
||||||
|
|
||||||
@ -43,7 +47,7 @@
|
|||||||
|
|
||||||
#include <spine/Json.h>
|
#include <spine/Json.h>
|
||||||
#include <spine/Extension.h>
|
#include <spine/Extension.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
@ -140,7 +144,7 @@ const char *Json::skip(const char *inValue) {
|
|||||||
const char *Json::parseValue(Json *item, const char *value) {
|
const char *Json::parseValue(Json *item, const char *value) {
|
||||||
/* Referenced by constructor, parseArray(), and parseObject(). */
|
/* Referenced by constructor, parseArray(), and parseObject(). */
|
||||||
/* Always called with the result of skip(). */
|
/* Always called with the result of skip(). */
|
||||||
#if SPINE_JSON_DEBUG /* Checked at entry to graph, constructor, and after every parse call. */
|
#ifdef SPINE_JSON_DEBUG /* Checked at entry to graph, constructor, and after every parse call. */
|
||||||
if (!value) {
|
if (!value) {
|
||||||
/* Fail on null. */
|
/* Fail on null. */
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -390,7 +394,7 @@ const char *Json::parseNumber(Json *item, const char *num) {
|
|||||||
const char *Json::parseArray(Json *item, const char *value) {
|
const char *Json::parseArray(Json *item, const char *value) {
|
||||||
Json *child;
|
Json *child;
|
||||||
|
|
||||||
#if SPINE_JSON_DEBUG /* unnecessary, only callsite (parse_value) verifies this */
|
#ifdef SPINE_JSON_DEBUG /* unnecessary, only callsite (parse_value) verifies this */
|
||||||
if (*value != '[') {
|
if (*value != '[') {
|
||||||
ep = value;
|
ep = value;
|
||||||
return 0;
|
return 0;
|
||||||
@ -446,7 +450,7 @@ const char *Json::parseArray(Json *item, const char *value) {
|
|||||||
const char *Json::parseObject(Json *item, const char *value) {
|
const char *Json::parseObject(Json *item, const char *value) {
|
||||||
Json *child;
|
Json *child;
|
||||||
|
|
||||||
#if SPINE_JSON_DEBUG /* unnecessary, only callsite (parse_value) verifies this */
|
#ifdef SPINE_JSON_DEBUG /* unnecessary, only callsite (parse_value) verifies this */
|
||||||
if (*value != '{') {
|
if (*value != '{') {
|
||||||
ep = value;
|
ep = value;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/LinkedMesh.h>
|
#include <spine/LinkedMesh.h>
|
||||||
|
|
||||||
#include <spine/MeshAttachment.h>
|
#include <spine/MeshAttachment.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/MathUtil.h>
|
#include <spine/MathUtil.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/MeshAttachment.h>
|
#include <spine/MeshAttachment.h>
|
||||||
#include <spine/HasRendererObject.h>
|
#include <spine/HasRendererObject.h>
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/PathAttachment.h>
|
#include <spine/PathAttachment.h>
|
||||||
|
|
||||||
using namespace spine;
|
using namespace spine;
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/PathConstraint.h>
|
#include <spine/PathConstraint.h>
|
||||||
|
|
||||||
#include <spine/PathConstraintData.h>
|
#include <spine/PathConstraintData.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/PathConstraintData.h>
|
#include <spine/PathConstraintData.h>
|
||||||
|
|
||||||
#include <spine/BoneData.h>
|
#include <spine/BoneData.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/PathConstraintMixTimeline.h>
|
#include <spine/PathConstraintMixTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/PathConstraintPositionTimeline.h>
|
#include <spine/PathConstraintPositionTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/PathConstraintSpacingTimeline.h>
|
#include <spine/PathConstraintSpacingTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/PointAttachment.h>
|
#include <spine/PointAttachment.h>
|
||||||
|
|
||||||
#include <spine/Bone.h>
|
#include <spine/Bone.h>
|
||||||
|
|||||||
@ -28,8 +28,12 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/RTTI.h>
|
#include <spine/RTTI.h>
|
||||||
#include <spine/String.h>
|
#include <spine/SpineString.h>
|
||||||
|
|
||||||
using namespace spine;
|
using namespace spine;
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/RegionAttachment.h>
|
#include <spine/RegionAttachment.h>
|
||||||
|
|
||||||
#include <spine/Bone.h>
|
#include <spine/Bone.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/RotateTimeline.h>
|
#include <spine/RotateTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/ScaleTimeline.h>
|
#include <spine/ScaleTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/ShearTimeline.h>
|
#include <spine/ShearTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|
||||||
#include <spine/SkeletonData.h>
|
#include <spine/SkeletonData.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/SkeletonBinary.h>
|
#include <spine/SkeletonBinary.h>
|
||||||
|
|
||||||
#include <spine/SkeletonData.h>
|
#include <spine/SkeletonData.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/SkeletonBounds.h>
|
#include <spine/SkeletonBounds.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/SkeletonClipping.h>
|
#include <spine/SkeletonClipping.h>
|
||||||
|
|
||||||
#include <spine/Slot.h>
|
#include <spine/Slot.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/SkeletonData.h>
|
#include <spine/SkeletonData.h>
|
||||||
|
|
||||||
#include <spine/BoneData.h>
|
#include <spine/BoneData.h>
|
||||||
@ -88,7 +92,7 @@ Skin *SkeletonData::findSkin(const String &skinName) {
|
|||||||
return ContainerUtil::findWithName(_skins, skinName);
|
return ContainerUtil::findWithName(_skins, skinName);
|
||||||
}
|
}
|
||||||
|
|
||||||
EventData *SkeletonData::findEvent(const String &eventDataName) {
|
spine::EventData *SkeletonData::findEvent(const String &eventDataName) {
|
||||||
return ContainerUtil::findWithName(_events, eventDataName);
|
return ContainerUtil::findWithName(_events, eventDataName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +144,7 @@ void SkeletonData::setDefaultSkin(Skin *inValue) {
|
|||||||
_defaultSkin = inValue;
|
_defaultSkin = inValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<EventData *> &SkeletonData::getEvents() {
|
Vector<spine::EventData *> &SkeletonData::getEvents() {
|
||||||
return _events;
|
return _events;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/SkeletonJson.h>
|
#include <spine/SkeletonJson.h>
|
||||||
|
|
||||||
#include <spine/CurveTimeline.h>
|
#include <spine/CurveTimeline.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/Skin.h>
|
#include <spine/Skin.h>
|
||||||
|
|
||||||
#include <spine/Attachment.h>
|
#include <spine/Attachment.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/Slot.h>
|
#include <spine/Slot.h>
|
||||||
|
|
||||||
#include <spine/SlotData.h>
|
#include <spine/SlotData.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/SlotData.h>
|
#include <spine/SlotData.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/SpineObject.h>
|
#include <spine/SpineObject.h>
|
||||||
#include <spine/Extension.h>
|
#include <spine/Extension.h>
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/TextureLoader.h>
|
#include <spine/TextureLoader.h>
|
||||||
|
|
||||||
namespace spine {
|
namespace spine {
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/Timeline.h>
|
#include <spine/Timeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/TransformConstraint.h>
|
#include <spine/TransformConstraint.h>
|
||||||
|
|
||||||
#include <spine/TransformConstraintData.h>
|
#include <spine/TransformConstraintData.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/TransformConstraintData.h>
|
#include <spine/TransformConstraintData.h>
|
||||||
|
|
||||||
#include <spine/BoneData.h>
|
#include <spine/BoneData.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/TransformConstraintTimeline.h>
|
#include <spine/TransformConstraintTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/TranslateTimeline.h>
|
#include <spine/TranslateTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/Triangulator.h>
|
#include <spine/Triangulator.h>
|
||||||
|
|
||||||
#include <spine/MathUtil.h>
|
#include <spine/MathUtil.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/TwoColorTimeline.h>
|
#include <spine/TwoColorTimeline.h>
|
||||||
|
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/Updatable.h>
|
#include <spine/Updatable.h>
|
||||||
|
|
||||||
using namespace spine;
|
using namespace spine;
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/VertexAttachment.h>
|
#include <spine/VertexAttachment.h>
|
||||||
|
|
||||||
#include <spine/Slot.h>
|
#include <spine/Slot.h>
|
||||||
|
|||||||
@ -28,6 +28,10 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef SPINE_UE4
|
||||||
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <spine/VertexEffect.h>
|
#include <spine/VertexEffect.h>
|
||||||
#include <spine/MathUtil.h>
|
#include <spine/MathUtil.h>
|
||||||
#include <spine/Skeleton.h>
|
#include <spine/Skeleton.h>
|
||||||
|
|||||||
@ -43,6 +43,8 @@
|
|||||||
|
|
||||||
#define LOCTEXT_NAMESPACE "Spine"
|
#define LOCTEXT_NAMESPACE "Spine"
|
||||||
|
|
||||||
|
using namespace spine;
|
||||||
|
|
||||||
USpineAtlasAssetFactory::USpineAtlasAssetFactory (const FObjectInitializer& objectInitializer): Super(objectInitializer) {
|
USpineAtlasAssetFactory::USpineAtlasAssetFactory (const FObjectInitializer& objectInitializer): Super(objectInitializer) {
|
||||||
bCreateNew = false;
|
bCreateNew = false;
|
||||||
bEditAfterNew = true;
|
bEditAfterNew = true;
|
||||||
@ -128,16 +130,16 @@ UTexture2D* resolveTexture (USpineAtlasAsset* Asset, const FString& PageFileName
|
|||||||
}
|
}
|
||||||
|
|
||||||
void USpineAtlasAssetFactory::LoadAtlas (USpineAtlasAsset* Asset, const FString& CurrentSourcePath, const FString& LongPackagePath) {
|
void USpineAtlasAssetFactory::LoadAtlas (USpineAtlasAsset* Asset, const FString& CurrentSourcePath, const FString& LongPackagePath) {
|
||||||
spAtlas* atlas = Asset->GetAtlas(true);
|
Atlas* atlas = Asset->GetAtlas(true);
|
||||||
Asset->atlasPages.Empty();
|
Asset->atlasPages.Empty();
|
||||||
|
|
||||||
const FString targetTexturePath = LongPackagePath / TEXT("Textures");
|
const FString targetTexturePath = LongPackagePath / TEXT("Textures");
|
||||||
|
|
||||||
spAtlasPage* page = atlas->pages;
|
Vector<AtlasPage*> &pages = atlas->getPages();
|
||||||
while (page) {
|
for (size_t i = 0, n = pages.size(); i < n; i++) {
|
||||||
const FString sourceTextureFilename = FPaths::Combine(*CurrentSourcePath, UTF8_TO_TCHAR(page->name));
|
AtlasPage* page = pages[i];
|
||||||
|
const FString sourceTextureFilename = FPaths::Combine(*CurrentSourcePath, UTF8_TO_TCHAR(page->name.buffer()));
|
||||||
UTexture2D* texture = resolveTexture(Asset, sourceTextureFilename, targetTexturePath);
|
UTexture2D* texture = resolveTexture(Asset, sourceTextureFilename, targetTexturePath);
|
||||||
page = page->next;
|
|
||||||
Asset->atlasPages.Add(texture);
|
Asset->atlasPages.Add(texture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,6 +36,8 @@
|
|||||||
|
|
||||||
#define LOCTEXT_NAMESPACE "Spine"
|
#define LOCTEXT_NAMESPACE "Spine"
|
||||||
|
|
||||||
|
using namespace spine;
|
||||||
|
|
||||||
FString USpineAtlasAsset::GetRawData () const {
|
FString USpineAtlasAsset::GetRawData () const {
|
||||||
return rawData;
|
return rawData;
|
||||||
}
|
}
|
||||||
@ -87,27 +89,26 @@ void USpineAtlasAsset::Serialize (FArchive& Ar) {
|
|||||||
|
|
||||||
void USpineAtlasAsset::BeginDestroy () {
|
void USpineAtlasAsset::BeginDestroy () {
|
||||||
if (atlas) {
|
if (atlas) {
|
||||||
spAtlas_dispose(atlas);
|
delete atlas;
|
||||||
atlas = nullptr;
|
atlas = nullptr;
|
||||||
}
|
}
|
||||||
Super::BeginDestroy();
|
Super::BeginDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
spAtlas* USpineAtlasAsset::GetAtlas (bool ForceReload) {
|
Atlas* USpineAtlasAsset::GetAtlas (bool ForceReload) {
|
||||||
if (!atlas || ForceReload) {
|
if (!atlas || ForceReload) {
|
||||||
if (atlas) {
|
if (atlas) {
|
||||||
spAtlas_dispose(atlas);
|
delete atlas;
|
||||||
atlas = nullptr;
|
atlas = nullptr;
|
||||||
}
|
}
|
||||||
std::string t = TCHAR_TO_UTF8(*rawData);
|
std::string t = TCHAR_TO_UTF8(*rawData);
|
||||||
atlas = spAtlas_create(t.c_str(), strlen(t.c_str()), "", nullptr);
|
|
||||||
spAtlasPage* page = atlas->pages;
|
atlas = new (__FILE__, __LINE__) Atlas(t.c_str(), strlen(t.c_str()), "", nullptr);
|
||||||
int i = 0;
|
Vector<AtlasPage*> &pages = atlas->getPages();
|
||||||
while (page) {
|
for (size_t i = 0, n = pages.size(), j = 0; i < n; i++) {
|
||||||
int num = atlasPages.Num();
|
AtlasPage* page = pages[i];
|
||||||
if (atlasPages.Num() > 0 && atlasPages.Num() > i)
|
if (atlasPages.Num() > 0 && atlasPages.Num() > i)
|
||||||
page->rendererObject = atlasPages[i++];
|
page->setRendererObject(atlasPages[j++]);
|
||||||
page = page->next;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this->atlas;
|
return this->atlas;
|
||||||
|
|||||||
@ -37,39 +37,10 @@ class FSpinePlugin : public SpinePlugin {
|
|||||||
|
|
||||||
IMPLEMENT_MODULE( FSpinePlugin, SpinePlugin )
|
IMPLEMENT_MODULE( FSpinePlugin, SpinePlugin )
|
||||||
|
|
||||||
// These should be filled with UE4's specific allocator functions.
|
|
||||||
extern "C" {
|
|
||||||
void _spSetMalloc( void* ( *_malloc ) ( size_t size ) );
|
|
||||||
void _spSetFree( void( *_free ) ( void* ptr ) );
|
|
||||||
void _spSetRealloc( void* ( *_realloc ) ( void* ptr, size_t size ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
static void * SpineMalloc( size_t size ) {
|
|
||||||
return FMemory::Malloc( size );
|
|
||||||
}
|
|
||||||
|
|
||||||
static void * SpineRealloc( void* ptr, size_t size ) {
|
|
||||||
return FMemory::Realloc( ptr, size );
|
|
||||||
}
|
|
||||||
|
|
||||||
void FSpinePlugin::StartupModule() {
|
void FSpinePlugin::StartupModule() {
|
||||||
// Needed for consoles, see https://github.com/EsotericSoftware/spine-runtimes/pull/1089
|
|
||||||
#if !UE_EDITOR && !PLATFORM_WINDOWS && !PLATFORM_MAC && !PLATFORM_LINUX && !PLATFORM_IOS && !PLATFORM_ANDROID && !PLATFORM_HTML5
|
|
||||||
_spSetMalloc( &SpineMalloc );
|
|
||||||
_spSetRealloc( &SpineRealloc );
|
|
||||||
_spSetFree( FMemory::Free );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FSpinePlugin::ShutdownModule() { }
|
void FSpinePlugin::ShutdownModule() { }
|
||||||
|
|
||||||
// These are not used in the Spine UE4 plugin, see SpineAtlasAsset on how atlas page textures
|
|
||||||
// are loaded, See SpineSkeletonRendererComponent on how these textures are used for rendering.
|
|
||||||
extern "C" {
|
|
||||||
void _spAtlasPage_createTexture (spAtlasPage* self, const char* path) { }
|
|
||||||
void _spAtlasPage_disposeTexture (spAtlasPage* self) { }
|
|
||||||
char* _spUtil_readFile (const char* path, int* length) { return 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,38 +32,40 @@
|
|||||||
|
|
||||||
#define LOCTEXT_NAMESPACE "Spine"
|
#define LOCTEXT_NAMESPACE "Spine"
|
||||||
|
|
||||||
void UTrackEntry::SetTrackEntry(spTrackEntry* entry) {
|
using namespace spine;
|
||||||
|
|
||||||
|
void UTrackEntry::SetTrackEntry(TrackEntry* entry) {
|
||||||
this->entry = entry;
|
this->entry = entry;
|
||||||
if (entry) entry->rendererObject = (void*)this;
|
if (entry) entry->setRendererObject((void*)this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void callback(spAnimationState* state, spEventType type, spTrackEntry* entry, spEvent* event) {
|
void callback(AnimationState* state, EventType type, TrackEntry* entry, Event* event) {
|
||||||
USpineSkeletonAnimationComponent* component = (USpineSkeletonAnimationComponent*)state->rendererObject;
|
USpineSkeletonAnimationComponent* component = (USpineSkeletonAnimationComponent*)state->getRendererObject();
|
||||||
|
|
||||||
if (entry->rendererObject) {
|
if (entry->getRendererObject()) {
|
||||||
UTrackEntry* uEntry = (UTrackEntry*)entry->rendererObject;
|
UTrackEntry* uEntry = (UTrackEntry*)entry->getRendererObject();
|
||||||
if (type == SP_ANIMATION_START) {
|
if (type == EventType_Start) {
|
||||||
component->AnimationStart.Broadcast(uEntry);
|
component->AnimationStart.Broadcast(uEntry);
|
||||||
uEntry->AnimationStart.Broadcast(uEntry);
|
uEntry->AnimationStart.Broadcast(uEntry);
|
||||||
}
|
}
|
||||||
else if (type == SP_ANIMATION_INTERRUPT) {
|
else if (type == EventType_Interrupt) {
|
||||||
component->AnimationInterrupt.Broadcast(uEntry);
|
component->AnimationInterrupt.Broadcast(uEntry);
|
||||||
uEntry->AnimationInterrupt.Broadcast(uEntry);
|
uEntry->AnimationInterrupt.Broadcast(uEntry);
|
||||||
} else if (type == SP_ANIMATION_EVENT) {
|
} else if (type == EventType_Event) {
|
||||||
FSpineEvent evt;
|
FSpineEvent evt;
|
||||||
evt.SetEvent(event);
|
evt.SetEvent(event);
|
||||||
component->AnimationEvent.Broadcast(uEntry, evt);
|
component->AnimationEvent.Broadcast(uEntry, evt);
|
||||||
uEntry->AnimationEvent.Broadcast(uEntry, evt);
|
uEntry->AnimationEvent.Broadcast(uEntry, evt);
|
||||||
}
|
}
|
||||||
else if (type == SP_ANIMATION_COMPLETE) {
|
else if (type == EventType_Complete) {
|
||||||
component->AnimationComplete.Broadcast(uEntry);
|
component->AnimationComplete.Broadcast(uEntry);
|
||||||
uEntry->AnimationComplete.Broadcast(uEntry);
|
uEntry->AnimationComplete.Broadcast(uEntry);
|
||||||
}
|
}
|
||||||
else if (type == SP_ANIMATION_END) {
|
else if (type == EventType_End) {
|
||||||
component->AnimationEnd.Broadcast(uEntry);
|
component->AnimationEnd.Broadcast(uEntry);
|
||||||
uEntry->AnimationEnd.Broadcast(uEntry);
|
uEntry->AnimationEnd.Broadcast(uEntry);
|
||||||
}
|
}
|
||||||
else if (type == SP_ANIMATION_DISPOSE) {
|
else if (type == EventType_Dispose) {
|
||||||
component->AnimationDispose.Broadcast(uEntry);
|
component->AnimationDispose.Broadcast(uEntry);
|
||||||
uEntry->AnimationDispose.Broadcast(uEntry);
|
uEntry->AnimationDispose.Broadcast(uEntry);
|
||||||
uEntry->SetTrackEntry(nullptr);
|
uEntry->SetTrackEntry(nullptr);
|
||||||
@ -93,10 +95,10 @@ void USpineSkeletonAnimationComponent::InternalTick(float DeltaTime, bool CallDe
|
|||||||
CheckState();
|
CheckState();
|
||||||
|
|
||||||
if (state) {
|
if (state) {
|
||||||
spAnimationState_update(state, DeltaTime);
|
state->update(DeltaTime);
|
||||||
spAnimationState_apply(state, skeleton);
|
state->apply(*skeleton);
|
||||||
if (CallDelegates) BeforeUpdateWorldTransform.Broadcast(this);
|
if (CallDelegates) BeforeUpdateWorldTransform.Broadcast(this);
|
||||||
spSkeleton_updateWorldTransform(skeleton);
|
skeleton->updateWorldTransform();
|
||||||
if (CallDelegates) AfterUpdateWorldTransform.Broadcast(this);
|
if (CallDelegates) AfterUpdateWorldTransform.Broadcast(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -106,12 +108,12 @@ void USpineSkeletonAnimationComponent::CheckState () {
|
|||||||
DisposeState();
|
DisposeState();
|
||||||
|
|
||||||
if (Atlas && SkeletonData) {
|
if (Atlas && SkeletonData) {
|
||||||
spSkeletonData* data = SkeletonData->GetSkeletonData(Atlas->GetAtlas(false), false);
|
spine::SkeletonData *data = SkeletonData->GetSkeletonData(Atlas->GetAtlas(false), false);
|
||||||
skeleton = spSkeleton_create(data);
|
skeleton = new (__FILE__, __LINE__) Skeleton(data);
|
||||||
spAnimationStateData* stateData = SkeletonData->GetAnimationStateData(Atlas->GetAtlas(false));
|
AnimationStateData* stateData = SkeletonData->GetAnimationStateData(Atlas->GetAtlas(false));
|
||||||
state = spAnimationState_create(stateData);
|
state = new (__FILE__, __LINE__) AnimationState(stateData);
|
||||||
state->rendererObject = (void*)this;
|
state->setRendererObject((void*)this);
|
||||||
state->listener = callback;
|
state->setListener(callback);
|
||||||
trackEntries.Empty();
|
trackEntries.Empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,12 +124,12 @@ void USpineSkeletonAnimationComponent::CheckState () {
|
|||||||
|
|
||||||
void USpineSkeletonAnimationComponent::DisposeState () {
|
void USpineSkeletonAnimationComponent::DisposeState () {
|
||||||
if (state) {
|
if (state) {
|
||||||
spAnimationState_dispose(state);
|
delete state;
|
||||||
state = nullptr;
|
state = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skeleton) {
|
if (skeleton) {
|
||||||
spSkeleton_dispose(skeleton);
|
delete skeleton;
|
||||||
skeleton = nullptr;
|
skeleton = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,27 +143,21 @@ void USpineSkeletonAnimationComponent::FinishDestroy () {
|
|||||||
|
|
||||||
void USpineSkeletonAnimationComponent::SetTimeScale(float timeScale) {
|
void USpineSkeletonAnimationComponent::SetTimeScale(float timeScale) {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (state) state->timeScale = timeScale;
|
if (state) state->setTimeScale(timeScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
float USpineSkeletonAnimationComponent::GetTimeScale() {
|
float USpineSkeletonAnimationComponent::GetTimeScale() {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (state) return state->timeScale;
|
if (state) return state->getTimeScale();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we need to disable the queue when setting or adding animations, see #1037
|
|
||||||
extern "C" {
|
|
||||||
void _spAnimationState_disableQueue(spAnimationState* state);
|
|
||||||
void _spAnimationState_enableQueue(spAnimationState* state);
|
|
||||||
}
|
|
||||||
|
|
||||||
UTrackEntry* USpineSkeletonAnimationComponent::SetAnimation (int trackIndex, FString animationName, bool loop) {
|
UTrackEntry* USpineSkeletonAnimationComponent::SetAnimation (int trackIndex, FString animationName, bool loop) {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (state && spSkeletonData_findAnimation(skeleton->data, TCHAR_TO_UTF8(*animationName))) {
|
if (state && skeleton->getData()->findAnimation(TCHAR_TO_UTF8(*animationName))) {
|
||||||
_spAnimationState_disableQueue(state);
|
state->disableQueue();
|
||||||
spTrackEntry* entry = spAnimationState_setAnimationByName(state, trackIndex, TCHAR_TO_UTF8(*animationName), loop ? 1 : 0);
|
TrackEntry* entry = state->setAnimation(trackIndex, TCHAR_TO_UTF8(*animationName), loop);
|
||||||
_spAnimationState_enableQueue(state);
|
state->enableQueue();
|
||||||
UTrackEntry* uEntry = NewObject<UTrackEntry>();
|
UTrackEntry* uEntry = NewObject<UTrackEntry>();
|
||||||
uEntry->SetTrackEntry(entry);
|
uEntry->SetTrackEntry(entry);
|
||||||
trackEntries.Add(uEntry);
|
trackEntries.Add(uEntry);
|
||||||
@ -172,10 +168,10 @@ UTrackEntry* USpineSkeletonAnimationComponent::SetAnimation (int trackIndex, FSt
|
|||||||
|
|
||||||
UTrackEntry* USpineSkeletonAnimationComponent::AddAnimation (int trackIndex, FString animationName, bool loop, float delay) {
|
UTrackEntry* USpineSkeletonAnimationComponent::AddAnimation (int trackIndex, FString animationName, bool loop, float delay) {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (state && spSkeletonData_findAnimation(skeleton->data, TCHAR_TO_UTF8(*animationName))) {
|
if (state && skeleton->getData()->findAnimation(TCHAR_TO_UTF8(*animationName))) {
|
||||||
_spAnimationState_disableQueue(state);
|
state->disableQueue();
|
||||||
spTrackEntry* entry = spAnimationState_addAnimationByName(state, trackIndex, TCHAR_TO_UTF8(*animationName), loop ? 1 : 0, delay);
|
TrackEntry* entry = state->addAnimation(trackIndex, TCHAR_TO_UTF8(*animationName), loop, delay);
|
||||||
_spAnimationState_enableQueue(state);
|
state->enableQueue();
|
||||||
UTrackEntry* uEntry = NewObject<UTrackEntry>();
|
UTrackEntry* uEntry = NewObject<UTrackEntry>();
|
||||||
uEntry->SetTrackEntry(entry);
|
uEntry->SetTrackEntry(entry);
|
||||||
trackEntries.Add(uEntry);
|
trackEntries.Add(uEntry);
|
||||||
@ -186,7 +182,7 @@ UTrackEntry* USpineSkeletonAnimationComponent::AddAnimation (int trackIndex, FSt
|
|||||||
UTrackEntry* USpineSkeletonAnimationComponent::SetEmptyAnimation (int trackIndex, float mixDuration) {
|
UTrackEntry* USpineSkeletonAnimationComponent::SetEmptyAnimation (int trackIndex, float mixDuration) {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (state) {
|
if (state) {
|
||||||
spTrackEntry* entry = spAnimationState_setEmptyAnimation(state, trackIndex, mixDuration);
|
TrackEntry* entry = state->setEmptyAnimation(trackIndex, mixDuration);
|
||||||
UTrackEntry* uEntry = NewObject<UTrackEntry>();
|
UTrackEntry* uEntry = NewObject<UTrackEntry>();
|
||||||
uEntry->SetTrackEntry(entry);
|
uEntry->SetTrackEntry(entry);
|
||||||
trackEntries.Add(uEntry);
|
trackEntries.Add(uEntry);
|
||||||
@ -197,7 +193,7 @@ UTrackEntry* USpineSkeletonAnimationComponent::SetEmptyAnimation (int trackIndex
|
|||||||
UTrackEntry* USpineSkeletonAnimationComponent::AddEmptyAnimation (int trackIndex, float mixDuration, float delay) {
|
UTrackEntry* USpineSkeletonAnimationComponent::AddEmptyAnimation (int trackIndex, float mixDuration, float delay) {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (state) {
|
if (state) {
|
||||||
spTrackEntry* entry = spAnimationState_addEmptyAnimation(state, trackIndex, mixDuration, delay);
|
TrackEntry* entry = state->addEmptyAnimation(trackIndex, mixDuration, delay);
|
||||||
UTrackEntry* uEntry = NewObject<UTrackEntry>();
|
UTrackEntry* uEntry = NewObject<UTrackEntry>();
|
||||||
uEntry->SetTrackEntry(entry);
|
uEntry->SetTrackEntry(entry);
|
||||||
trackEntries.Add(uEntry);
|
trackEntries.Add(uEntry);
|
||||||
@ -208,9 +204,9 @@ UTrackEntry* USpineSkeletonAnimationComponent::AddEmptyAnimation (int trackIndex
|
|||||||
UTrackEntry* USpineSkeletonAnimationComponent::GetCurrent (int trackIndex) {
|
UTrackEntry* USpineSkeletonAnimationComponent::GetCurrent (int trackIndex) {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (state) {
|
if (state) {
|
||||||
spTrackEntry* entry = spAnimationState_getCurrent(state, trackIndex);
|
TrackEntry* entry = state->getCurrent(trackIndex);
|
||||||
if (entry->rendererObject) {
|
if (entry->getRendererObject()) {
|
||||||
return (UTrackEntry*)entry->rendererObject;
|
return (UTrackEntry*)entry->getRendererObject();
|
||||||
} else {
|
} else {
|
||||||
UTrackEntry* uEntry = NewObject<UTrackEntry>();
|
UTrackEntry* uEntry = NewObject<UTrackEntry>();
|
||||||
uEntry->SetTrackEntry(entry);
|
uEntry->SetTrackEntry(entry);
|
||||||
@ -223,14 +219,14 @@ UTrackEntry* USpineSkeletonAnimationComponent::GetCurrent (int trackIndex) {
|
|||||||
void USpineSkeletonAnimationComponent::ClearTracks () {
|
void USpineSkeletonAnimationComponent::ClearTracks () {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (state) {
|
if (state) {
|
||||||
spAnimationState_clearTracks(state);
|
state->clearTracks();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void USpineSkeletonAnimationComponent::ClearTrack (int trackIndex) {
|
void USpineSkeletonAnimationComponent::ClearTrack (int trackIndex) {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (state) {
|
if (state) {
|
||||||
spAnimationState_clearTrack(state, trackIndex);
|
state->clearTrack(trackIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,8 +30,12 @@
|
|||||||
|
|
||||||
#include "SpinePluginPrivatePCH.h"
|
#include "SpinePluginPrivatePCH.h"
|
||||||
|
|
||||||
|
#include "spine/spine.h"
|
||||||
|
|
||||||
#define LOCTEXT_NAMESPACE "Spine"
|
#define LOCTEXT_NAMESPACE "Spine"
|
||||||
|
|
||||||
|
using namespace spine;
|
||||||
|
|
||||||
USpineSkeletonComponent::USpineSkeletonComponent () {
|
USpineSkeletonComponent::USpineSkeletonComponent () {
|
||||||
PrimaryComponentTick.bCanEverTick = true;
|
PrimaryComponentTick.bCanEverTick = true;
|
||||||
bTickInEditor = true;
|
bTickInEditor = true;
|
||||||
@ -40,22 +44,31 @@ USpineSkeletonComponent::USpineSkeletonComponent () {
|
|||||||
|
|
||||||
bool USpineSkeletonComponent::SetSkin(const FString& skinName) {
|
bool USpineSkeletonComponent::SetSkin(const FString& skinName) {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (skeleton) return spSkeleton_setSkinByName(skeleton, TCHAR_TO_UTF8(*skinName)) != 0;
|
if (skeleton) {
|
||||||
|
Skin* skin = skeleton->getData()->findSkin(TCHAR_TO_UTF8(*skinName));
|
||||||
|
if (!skin) return false;
|
||||||
|
skeleton->setSkin(skin);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool USpineSkeletonComponent::SetAttachment (const FString& slotName, const FString& attachmentName) {
|
bool USpineSkeletonComponent::SetAttachment (const FString& slotName, const FString& attachmentName) {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (skeleton) return spSkeleton_setAttachment(skeleton, TCHAR_TO_UTF8(*slotName), TCHAR_TO_UTF8(*attachmentName)) != 0;
|
if (skeleton) {
|
||||||
|
if (!skeleton->getAttachment(TCHAR_TO_UTF8(*slotName), TCHAR_TO_UTF8(*attachmentName))) return false;
|
||||||
|
skeleton->setAttachment(TCHAR_TO_UTF8(*slotName), TCHAR_TO_UTF8(*attachmentName));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
FTransform USpineSkeletonComponent::GetBoneWorldTransform (const FString& BoneName) {
|
FTransform USpineSkeletonComponent::GetBoneWorldTransform (const FString& BoneName) {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (skeleton) {
|
if (skeleton) {
|
||||||
spBone* bone = spSkeleton_findBone(skeleton, TCHAR_TO_UTF8(*BoneName));
|
Bone* bone = skeleton->findBone(TCHAR_TO_UTF8(*BoneName));
|
||||||
if (!bone) return FTransform();
|
if (!bone) return FTransform();
|
||||||
if (!bone->appliedValid) this->InternalTick(0, false);
|
if (!bone->isAppliedValid()) this->InternalTick(0, false);
|
||||||
|
|
||||||
// Need to fetch the renderer component to get world transform of actor plus
|
// Need to fetch the renderer component to get world transform of actor plus
|
||||||
// offset by renderer component and its parent component(s). If no renderer
|
// offset by renderer component and its parent component(s). If no renderer
|
||||||
@ -68,12 +81,12 @@ FTransform USpineSkeletonComponent::GetBoneWorldTransform (const FString& BoneNa
|
|||||||
else baseTransform = owner->GetActorTransform();
|
else baseTransform = owner->GetActorTransform();
|
||||||
}
|
}
|
||||||
|
|
||||||
FVector position(bone->worldX, 0, bone->worldY);
|
FVector position(bone->getWorldX(), 0, bone->getWorldY());
|
||||||
FMatrix localTransform;
|
FMatrix localTransform;
|
||||||
localTransform.SetIdentity();
|
localTransform.SetIdentity();
|
||||||
localTransform.SetAxis(2, FVector(bone->a, 0, bone->c));
|
localTransform.SetAxis(2, FVector(bone->getA(), 0, bone->getC()));
|
||||||
localTransform.SetAxis(0, FVector(bone->b, 0, bone->d));
|
localTransform.SetAxis(0, FVector(bone->getB(), 0, bone->getD()));
|
||||||
localTransform.SetOrigin(FVector(bone->worldX, 0, bone->worldY));
|
localTransform.SetOrigin(FVector(bone->getWorldX(), 0, bone->getWorldY()));
|
||||||
localTransform = localTransform * baseTransform.ToMatrixWithScale();
|
localTransform = localTransform * baseTransform.ToMatrixWithScale();
|
||||||
|
|
||||||
FTransform result;
|
FTransform result;
|
||||||
@ -86,9 +99,9 @@ FTransform USpineSkeletonComponent::GetBoneWorldTransform (const FString& BoneNa
|
|||||||
void USpineSkeletonComponent::SetBoneWorldPosition (const FString& BoneName, const FVector& position) {
|
void USpineSkeletonComponent::SetBoneWorldPosition (const FString& BoneName, const FVector& position) {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (skeleton) {
|
if (skeleton) {
|
||||||
spBone* bone = spSkeleton_findBone(skeleton, TCHAR_TO_UTF8(*BoneName));
|
Bone* bone = skeleton->findBone(TCHAR_TO_UTF8(*BoneName));
|
||||||
if (!bone) return;
|
if (!bone) return;
|
||||||
if (!bone->appliedValid) this->InternalTick(0, false);
|
if (!bone->isAppliedValid()) this->InternalTick(0, false);
|
||||||
|
|
||||||
// Need to fetch the renderer component to get world transform of actor plus
|
// Need to fetch the renderer component to get world transform of actor plus
|
||||||
// offset by renderer component and its parent component(s). If no renderer
|
// offset by renderer component and its parent component(s). If no renderer
|
||||||
@ -104,57 +117,57 @@ void USpineSkeletonComponent::SetBoneWorldPosition (const FString& BoneName, con
|
|||||||
baseTransform = baseTransform.Inverse();
|
baseTransform = baseTransform.Inverse();
|
||||||
FVector localPosition = baseTransform.TransformPosition(position);
|
FVector localPosition = baseTransform.TransformPosition(position);
|
||||||
float localX = 0, localY = 0;
|
float localX = 0, localY = 0;
|
||||||
if (bone->parent) {
|
if (bone->getParent()) {
|
||||||
spBone_worldToLocal(bone->parent, localPosition.X, localPosition.Z, &localX, &localY);
|
bone->getParent()->worldToLocal(localPosition.X, localPosition.Z, localX, localY);
|
||||||
} else {
|
} else {
|
||||||
spBone_worldToLocal(bone, localPosition.X, localPosition.Z, &localX, &localY);
|
bone->worldToLocal(localPosition.X, localPosition.Z, localX, localY);
|
||||||
}
|
}
|
||||||
bone->x = localX;
|
bone->setX(localX);
|
||||||
bone->y = localY;
|
bone->setY(localY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void USpineSkeletonComponent::UpdateWorldTransform() {
|
void USpineSkeletonComponent::UpdateWorldTransform() {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (skeleton) {
|
if (skeleton) {
|
||||||
spSkeleton_updateWorldTransform(skeleton);
|
skeleton->updateWorldTransform();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void USpineSkeletonComponent::SetToSetupPose () {
|
void USpineSkeletonComponent::SetToSetupPose () {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (skeleton) spSkeleton_setToSetupPose(skeleton);
|
if (skeleton) skeleton->setToSetupPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
void USpineSkeletonComponent::SetBonesToSetupPose () {
|
void USpineSkeletonComponent::SetBonesToSetupPose () {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (skeleton) spSkeleton_setBonesToSetupPose(skeleton);
|
if (skeleton) skeleton->setBonesToSetupPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
void USpineSkeletonComponent::SetSlotsToSetupPose () {
|
void USpineSkeletonComponent::SetSlotsToSetupPose () {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (skeleton) spSkeleton_setSlotsToSetupPose(skeleton);
|
if (skeleton) skeleton->setSlotsToSetupPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
void USpineSkeletonComponent::SetFlipX (bool flipX) {
|
void USpineSkeletonComponent::SetFlipX (bool flipX) {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (skeleton) skeleton->flipX = flipX ? 1 : 0;
|
if (skeleton) skeleton->setFlipX(flipX);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool USpineSkeletonComponent::GetFlipX() {
|
bool USpineSkeletonComponent::GetFlipX() {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (skeleton) return skeleton->flipX != 0;
|
if (skeleton) return skeleton->getFlipX();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void USpineSkeletonComponent::SetFlipY(bool flipY) {
|
void USpineSkeletonComponent::SetFlipY(bool flipY) {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (skeleton) skeleton->flipY = flipY ? 1 : 0;
|
if (skeleton) skeleton->setFlipY(flipY);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool USpineSkeletonComponent::GetFlipY() {
|
bool USpineSkeletonComponent::GetFlipY() {
|
||||||
CheckState();
|
CheckState();
|
||||||
if (skeleton) return skeleton->flipY != 0;
|
if (skeleton) return skeleton->getFlipY();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +185,7 @@ void USpineSkeletonComponent::InternalTick(float DeltaTime, bool CallDelegates)
|
|||||||
|
|
||||||
if (skeleton) {
|
if (skeleton) {
|
||||||
if (CallDelegates) BeforeUpdateWorldTransform.Broadcast(this);
|
if (CallDelegates) BeforeUpdateWorldTransform.Broadcast(this);
|
||||||
spSkeleton_updateWorldTransform(skeleton);
|
skeleton->updateWorldTransform();
|
||||||
if (CallDelegates) AfterUpdateWorldTransform.Broadcast(this);
|
if (CallDelegates) AfterUpdateWorldTransform.Broadcast(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -182,8 +195,8 @@ void USpineSkeletonComponent::CheckState () {
|
|||||||
DisposeState();
|
DisposeState();
|
||||||
|
|
||||||
if (Atlas && SkeletonData) {
|
if (Atlas && SkeletonData) {
|
||||||
spSkeletonData* data = SkeletonData->GetSkeletonData(Atlas->GetAtlas(false), false);
|
spine::SkeletonData* data = SkeletonData->GetSkeletonData(Atlas->GetAtlas(false), false);
|
||||||
skeleton = spSkeleton_create(data);
|
skeleton = new (__FILE__, __LINE__) Skeleton(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastAtlas = Atlas;
|
lastAtlas = Atlas;
|
||||||
@ -193,7 +206,7 @@ void USpineSkeletonComponent::CheckState () {
|
|||||||
|
|
||||||
void USpineSkeletonComponent::DisposeState () {
|
void USpineSkeletonComponent::DisposeState () {
|
||||||
if (skeleton) {
|
if (skeleton) {
|
||||||
spSkeleton_dispose(skeleton);
|
delete skeleton;
|
||||||
skeleton = nullptr;
|
skeleton = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,6 +36,8 @@
|
|||||||
|
|
||||||
#define LOCTEXT_NAMESPACE "Spine"
|
#define LOCTEXT_NAMESPACE "Spine"
|
||||||
|
|
||||||
|
using namespace spine;
|
||||||
|
|
||||||
FName USpineSkeletonDataAsset::GetSkeletonDataFileName () const {
|
FName USpineSkeletonDataAsset::GetSkeletonDataFileName () const {
|
||||||
#if WITH_EDITORONLY_DATA
|
#if WITH_EDITORONLY_DATA
|
||||||
TArray<FString> files;
|
TArray<FString> files;
|
||||||
@ -83,34 +85,34 @@ void USpineSkeletonDataAsset::Serialize (FArchive& Ar) {
|
|||||||
|
|
||||||
void USpineSkeletonDataAsset::BeginDestroy () {
|
void USpineSkeletonDataAsset::BeginDestroy () {
|
||||||
if (this->skeletonData) {
|
if (this->skeletonData) {
|
||||||
spSkeletonData_dispose(this->skeletonData);
|
delete this->skeletonData;
|
||||||
this->skeletonData = nullptr;
|
this->skeletonData = nullptr;
|
||||||
}
|
}
|
||||||
if (this->animationStateData) {
|
if (this->animationStateData) {
|
||||||
spAnimationStateData_dispose(this->animationStateData);
|
delete this->animationStateData;
|
||||||
this->animationStateData = nullptr;
|
this->animationStateData = nullptr;
|
||||||
}
|
}
|
||||||
Super::BeginDestroy();
|
Super::BeginDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
spSkeletonData* USpineSkeletonDataAsset::GetSkeletonData (spAtlas* Atlas, bool ForceReload) {
|
SkeletonData* USpineSkeletonDataAsset::GetSkeletonData (Atlas* Atlas, bool ForceReload) {
|
||||||
if (!skeletonData || ForceReload) {
|
if (!skeletonData || ForceReload) {
|
||||||
if (skeletonData) {
|
if (skeletonData) {
|
||||||
spSkeletonData_dispose(skeletonData);
|
delete skeletonData;
|
||||||
skeletonData = nullptr;
|
skeletonData = nullptr;
|
||||||
}
|
}
|
||||||
int dataLen = rawData.Num();
|
int dataLen = rawData.Num();
|
||||||
if (skeletonDataFileName.GetPlainNameString().Contains(TEXT(".json"))) {
|
if (skeletonDataFileName.GetPlainNameString().Contains(TEXT(".json"))) {
|
||||||
spSkeletonJson* json = spSkeletonJson_create(Atlas);
|
SkeletonJson* json = new (__FILE__, __LINE__) SkeletonJson(Atlas);
|
||||||
this->skeletonData = spSkeletonJson_readSkeletonData(json, (const char*)rawData.GetData());
|
this->skeletonData = json->readSkeletonData((const char*)rawData.GetData());
|
||||||
spSkeletonJson_dispose(json);
|
delete json;
|
||||||
} else {
|
} else {
|
||||||
spSkeletonBinary* binary = spSkeletonBinary_create(Atlas);
|
SkeletonBinary* binary = new (__FILE__, __LINE__) SkeletonBinary(Atlas);
|
||||||
this->skeletonData = spSkeletonBinary_readSkeletonData(binary, (const unsigned char*)rawData.GetData(), (int)rawData.Num());
|
this->skeletonData = binary->readSkeletonData((const unsigned char*)rawData.GetData(), (int)rawData.Num());
|
||||||
spSkeletonBinary_dispose(binary);
|
delete binary;
|
||||||
}
|
}
|
||||||
if (animationStateData) {
|
if (animationStateData) {
|
||||||
spAnimationStateData_dispose(animationStateData);
|
delete animationStateData;
|
||||||
GetAnimationStateData(Atlas);
|
GetAnimationStateData(Atlas);
|
||||||
}
|
}
|
||||||
lastAtlas = Atlas;
|
lastAtlas = Atlas;
|
||||||
@ -118,19 +120,19 @@ spSkeletonData* USpineSkeletonDataAsset::GetSkeletonData (spAtlas* Atlas, bool F
|
|||||||
return this->skeletonData;
|
return this->skeletonData;
|
||||||
}
|
}
|
||||||
|
|
||||||
spAnimationStateData* USpineSkeletonDataAsset::GetAnimationStateData(spAtlas* atlas) {
|
AnimationStateData* USpineSkeletonDataAsset::GetAnimationStateData(Atlas* atlas) {
|
||||||
if (!animationStateData) {
|
if (!animationStateData) {
|
||||||
spSkeletonData* skeletonData = GetSkeletonData(atlas, false);
|
SkeletonData* skeletonData = GetSkeletonData(atlas, false);
|
||||||
animationStateData = spAnimationStateData_create(skeletonData);
|
animationStateData = new (__FILE__, __LINE__) AnimationStateData(skeletonData);
|
||||||
}
|
}
|
||||||
for (auto& data : MixData) {
|
for (auto& data : MixData) {
|
||||||
if (!data.From.IsEmpty() && !data.To.IsEmpty()) {
|
if (!data.From.IsEmpty() && !data.To.IsEmpty()) {
|
||||||
const char* fromChar = TCHAR_TO_UTF8(*data.From);
|
const char* fromChar = TCHAR_TO_UTF8(*data.From);
|
||||||
const char* toChar = TCHAR_TO_UTF8(*data.To);
|
const char* toChar = TCHAR_TO_UTF8(*data.To);
|
||||||
spAnimationStateData_setMixByName(animationStateData, fromChar, toChar, data.Mix);
|
animationStateData->setMix(fromChar, toChar, data.Mix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
animationStateData->defaultMix = DefaultMix;
|
animationStateData->setDefaultMix(DefaultMix);
|
||||||
return this->animationStateData;
|
return this->animationStateData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,8 @@
|
|||||||
|
|
||||||
#define LOCTEXT_NAMESPACE "Spine"
|
#define LOCTEXT_NAMESPACE "Spine"
|
||||||
|
|
||||||
|
using namespace spine;
|
||||||
|
|
||||||
USpineSkeletonRendererComponent::USpineSkeletonRendererComponent (const FObjectInitializer& ObjectInitializer)
|
USpineSkeletonRendererComponent::USpineSkeletonRendererComponent (const FObjectInitializer& ObjectInitializer)
|
||||||
: URuntimeMeshComponent(ObjectInitializer) {
|
: URuntimeMeshComponent(ObjectInitializer) {
|
||||||
PrimaryComponentTick.bCanEverTick = true;
|
PrimaryComponentTick.bCanEverTick = true;
|
||||||
@ -55,13 +57,10 @@ USpineSkeletonRendererComponent::USpineSkeletonRendererComponent (const FObjectI
|
|||||||
|
|
||||||
TextureParameterName = FName(TEXT("SpriteTexture"));
|
TextureParameterName = FName(TEXT("SpriteTexture"));
|
||||||
|
|
||||||
worldVertices = spFloatArray_create(1024 * 2);
|
worldVertices.ensureCapacity(1024 * 2);
|
||||||
clipper = spSkeletonClipping_create();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void USpineSkeletonRendererComponent::FinishDestroy() {
|
void USpineSkeletonRendererComponent::FinishDestroy() {
|
||||||
if (clipper) spSkeletonClipping_dispose(clipper);
|
|
||||||
if (worldVertices) spFloatArray_dispose(worldVertices);
|
|
||||||
Super::FinishDestroy();
|
Super::FinishDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +77,7 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick
|
|||||||
USpineSkeletonComponent* skeleton = Cast<USpineSkeletonComponent>(owner->GetComponentByClass(skeletonClass));
|
USpineSkeletonComponent* skeleton = Cast<USpineSkeletonComponent>(owner->GetComponentByClass(skeletonClass));
|
||||||
|
|
||||||
if (skeleton && !skeleton->IsBeingDestroyed() && skeleton->GetSkeleton() && skeleton->Atlas) {
|
if (skeleton && !skeleton->IsBeingDestroyed() && skeleton->GetSkeleton() && skeleton->Atlas) {
|
||||||
spColor_setFromFloats(&skeleton->GetSkeleton()->color, Color.R, Color.G, Color.B, Color.A);
|
skeleton->GetSkeleton()->getColor().set(Color.R, Color.G, Color.B, Color.A);
|
||||||
|
|
||||||
if (atlasNormalBlendMaterials.Num() != skeleton->Atlas->atlasPages.Num()) {
|
if (atlasNormalBlendMaterials.Num() != skeleton->Atlas->atlasPages.Num()) {
|
||||||
atlasNormalBlendMaterials.SetNum(0);
|
atlasNormalBlendMaterials.SetNum(0);
|
||||||
@ -89,9 +88,9 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick
|
|||||||
pageToMultiplyBlendMaterial.Empty();
|
pageToMultiplyBlendMaterial.Empty();
|
||||||
atlasScreenBlendMaterials.SetNum(0);
|
atlasScreenBlendMaterials.SetNum(0);
|
||||||
pageToScreenBlendMaterial.Empty();
|
pageToScreenBlendMaterial.Empty();
|
||||||
|
|
||||||
spAtlasPage* currPage = skeleton->Atlas->GetAtlas(false)->pages;
|
|
||||||
for (int i = 0; i < skeleton->Atlas->atlasPages.Num(); i++) {
|
for (int i = 0; i < skeleton->Atlas->atlasPages.Num(); i++) {
|
||||||
|
AtlasPage* currPage = skeleton->Atlas->GetAtlas(false)->getPages()[i];
|
||||||
|
|
||||||
UMaterialInstanceDynamic* material = UMaterialInstanceDynamic::Create(NormalBlendMaterial, owner);
|
UMaterialInstanceDynamic* material = UMaterialInstanceDynamic::Create(NormalBlendMaterial, owner);
|
||||||
material->SetTextureParameterValue(TextureParameterName, skeleton->Atlas->atlasPages[i]);
|
material->SetTextureParameterValue(TextureParameterName, skeleton->Atlas->atlasPages[i]);
|
||||||
@ -111,18 +110,17 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick
|
|||||||
material = UMaterialInstanceDynamic::Create(ScreenBlendMaterial, owner);
|
material = UMaterialInstanceDynamic::Create(ScreenBlendMaterial, owner);
|
||||||
material->SetTextureParameterValue(TextureParameterName, skeleton->Atlas->atlasPages[i]);
|
material->SetTextureParameterValue(TextureParameterName, skeleton->Atlas->atlasPages[i]);
|
||||||
atlasScreenBlendMaterials.Add(material);
|
atlasScreenBlendMaterials.Add(material);
|
||||||
pageToScreenBlendMaterial.Add(currPage, material);
|
pageToScreenBlendMaterial.Add(currPage, material);
|
||||||
|
|
||||||
currPage = currPage->next;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pageToNormalBlendMaterial.Empty();
|
pageToNormalBlendMaterial.Empty();
|
||||||
pageToAdditiveBlendMaterial.Empty();
|
pageToAdditiveBlendMaterial.Empty();
|
||||||
pageToMultiplyBlendMaterial.Empty();
|
pageToMultiplyBlendMaterial.Empty();
|
||||||
pageToScreenBlendMaterial.Empty();
|
pageToScreenBlendMaterial.Empty();
|
||||||
|
|
||||||
spAtlasPage* currPage = skeleton->Atlas->GetAtlas(false)->pages;
|
|
||||||
for (int i = 0; i < skeleton->Atlas->atlasPages.Num(); i++) {
|
for (int i = 0; i < skeleton->Atlas->atlasPages.Num(); i++) {
|
||||||
|
AtlasPage* currPage = skeleton->Atlas->GetAtlas(false)->getPages()[i];
|
||||||
|
|
||||||
UTexture2D* texture = skeleton->Atlas->atlasPages[i];
|
UTexture2D* texture = skeleton->Atlas->atlasPages[i];
|
||||||
UTexture* oldTexture = nullptr;
|
UTexture* oldTexture = nullptr;
|
||||||
|
|
||||||
@ -157,8 +155,6 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick
|
|||||||
atlasScreenBlendMaterials[i] = material;
|
atlasScreenBlendMaterials[i] = material;
|
||||||
}
|
}
|
||||||
pageToScreenBlendMaterial.Add(currPage, atlasScreenBlendMaterials[i]);
|
pageToScreenBlendMaterial.Add(currPage, atlasScreenBlendMaterials[i]);
|
||||||
|
|
||||||
currPage = currPage->next;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UpdateMesh(skeleton->GetSkeleton());
|
UpdateMesh(skeleton->GetSkeleton());
|
||||||
@ -189,7 +185,7 @@ void USpineSkeletonRendererComponent::Flush (int &Idx, TArray<FVector> &Vertices
|
|||||||
Idx++;
|
Idx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) {
|
void USpineSkeletonRendererComponent::UpdateMesh(Skeleton* Skeleton) {
|
||||||
TArray<FVector> vertices;
|
TArray<FVector> vertices;
|
||||||
TArray<int32> indices;
|
TArray<int32> indices;
|
||||||
TArray<FVector2D> uvs;
|
TArray<FVector2D> uvs;
|
||||||
@ -205,43 +201,42 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) {
|
|||||||
float depthOffset = 0;
|
float depthOffset = 0;
|
||||||
unsigned short quadIndices[] = { 0, 1, 2, 0, 2, 3 };
|
unsigned short quadIndices[] = { 0, 1, 2, 0, 2, 3 };
|
||||||
|
|
||||||
for (int i = 0; i < Skeleton->slotsCount; ++i) {
|
for (int i = 0; i < Skeleton->getSlots().size(); ++i) {
|
||||||
float* attachmentVertices = worldVertices->items;
|
Vector<float> &attachmentVertices = worldVertices;
|
||||||
unsigned short* attachmentIndices = nullptr;
|
unsigned short* attachmentIndices = nullptr;
|
||||||
int numVertices;
|
int numVertices;
|
||||||
int numIndices;
|
int numIndices;
|
||||||
spAtlasRegion* attachmentAtlasRegion = nullptr;
|
AtlasRegion* attachmentAtlasRegion = nullptr;
|
||||||
spColor attachmentColor;
|
spine::Color attachmentColor;
|
||||||
spColor_setFromFloats(&attachmentColor, 1, 1, 1, 1);
|
attachmentColor.set(1, 1, 1, 1);
|
||||||
float* attachmentUvs = nullptr;
|
float* attachmentUvs = nullptr;
|
||||||
|
|
||||||
spSlot* slot = Skeleton->drawOrder[i];
|
Slot* slot = Skeleton->getDrawOrder()[i];
|
||||||
spAttachment* attachment = slot->attachment;
|
Attachment* attachment = slot->getAttachment();
|
||||||
if (!attachment) continue;
|
if (!attachment) continue;
|
||||||
if (attachment->type != SP_ATTACHMENT_REGION && attachment->type != SP_ATTACHMENT_MESH && attachment->type != SP_ATTACHMENT_CLIPPING) continue;
|
if (!attachment->getRTTI().isExactly(RegionAttachment::rtti) && !attachment->getRTTI().isExactly(MeshAttachment::rtti) && !attachment->getRTTI().isExactly(ClippingAttachment::rtti)) continue;
|
||||||
|
|
||||||
if (attachment->type == SP_ATTACHMENT_REGION) {
|
if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) {
|
||||||
spRegionAttachment* regionAttachment = (spRegionAttachment*)attachment;
|
RegionAttachment* regionAttachment = (RegionAttachment*)attachment;
|
||||||
spColor_setFromColor(&attachmentColor, ®ionAttachment->color);
|
attachmentColor.set(regionAttachment->getColor());
|
||||||
attachmentAtlasRegion = (spAtlasRegion*)regionAttachment->rendererObject;
|
attachmentAtlasRegion = (AtlasRegion*)regionAttachment->getRendererObject();
|
||||||
spRegionAttachment_computeWorldVertices(regionAttachment, slot->bone, attachmentVertices, 0, 2);
|
regionAttachment->computeWorldVertices(slot->getBone(), attachmentVertices, 0, 2);
|
||||||
attachmentIndices = quadIndices;
|
attachmentIndices = quadIndices;
|
||||||
attachmentUvs = regionAttachment->uvs;
|
attachmentUvs = regionAttachment->getUVs().buffer();
|
||||||
numVertices = 4;
|
numVertices = 4;
|
||||||
numIndices = 6;
|
numIndices = 6;
|
||||||
} else if (attachment->type == SP_ATTACHMENT_MESH) {
|
} else if (attachment->getRTTI().isExactly(MeshAttachment::rtti)) {
|
||||||
spMeshAttachment* mesh = (spMeshAttachment*)attachment;
|
MeshAttachment* mesh = (MeshAttachment*)attachment;
|
||||||
spColor_setFromColor(&attachmentColor, &mesh->color);
|
attachmentColor.set(mesh->getColor());
|
||||||
attachmentAtlasRegion = (spAtlasRegion*)mesh->rendererObject;
|
attachmentAtlasRegion = (AtlasRegion*)mesh->getRendererObject();
|
||||||
if (mesh->super.worldVerticesLength > worldVertices->size) spFloatArray_setSize(worldVertices, mesh->super.worldVerticesLength);
|
mesh->computeWorldVertices(*slot, 0, mesh->getWorldVerticesLength(), attachmentVertices, 0, 2);
|
||||||
spVertexAttachment_computeWorldVertices(&mesh->super, slot, 0, mesh->super.worldVerticesLength, attachmentVertices, 0, 2);
|
attachmentIndices = mesh->getTriangles().buffer();
|
||||||
attachmentIndices = mesh->triangles;
|
attachmentUvs = mesh->getUVs().buffer();
|
||||||
attachmentUvs = mesh->uvs;
|
numVertices = mesh->getWorldVerticesLength() >> 1;
|
||||||
numVertices = mesh->super.worldVerticesLength >> 1;
|
numIndices = mesh->getTriangles().size();
|
||||||
numIndices = mesh->trianglesCount;
|
|
||||||
} else /* clipping */ {
|
} else /* clipping */ {
|
||||||
spClippingAttachment* clip = (spClippingAttachment*)slot->attachment;
|
ClippingAttachment* clip = (ClippingAttachment*)attachment;
|
||||||
spSkeletonClipping_clipStart(clipper, slot, clip);
|
clipper.clipStart(*slot, clip);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,20 +244,20 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) {
|
|||||||
// to the correct skeleton data yet, we won't find any regions.
|
// to the correct skeleton data yet, we won't find any regions.
|
||||||
// ignore regions for which we can't find a material
|
// ignore regions for which we can't find a material
|
||||||
UMaterialInstanceDynamic* material = nullptr;
|
UMaterialInstanceDynamic* material = nullptr;
|
||||||
switch (slot->data->blendMode) {
|
switch (slot->getData().getBlendMode()) {
|
||||||
case SP_BLEND_MODE_NORMAL:
|
case BlendMode_Normal:
|
||||||
if (!pageToNormalBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!pageToNormalBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
||||||
material = pageToNormalBlendMaterial[attachmentAtlasRegion->page];
|
material = pageToNormalBlendMaterial[attachmentAtlasRegion->page];
|
||||||
break;
|
break;
|
||||||
case SP_BLEND_MODE_ADDITIVE:
|
case BlendMode_Additive:
|
||||||
if (!pageToAdditiveBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!pageToAdditiveBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
||||||
material = pageToAdditiveBlendMaterial[attachmentAtlasRegion->page];
|
material = pageToAdditiveBlendMaterial[attachmentAtlasRegion->page];
|
||||||
break;
|
break;
|
||||||
case SP_BLEND_MODE_MULTIPLY:
|
case BlendMode_Multiply:
|
||||||
if (!pageToMultiplyBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!pageToMultiplyBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
||||||
material = pageToMultiplyBlendMaterial[attachmentAtlasRegion->page];
|
material = pageToMultiplyBlendMaterial[attachmentAtlasRegion->page];
|
||||||
break;
|
break;
|
||||||
case SP_BLEND_MODE_SCREEN:
|
case BlendMode_Screen:
|
||||||
if (!pageToScreenBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
if (!pageToScreenBlendMaterial.Contains(attachmentAtlasRegion->page)) continue;
|
||||||
material = pageToScreenBlendMaterial[attachmentAtlasRegion->page];
|
material = pageToScreenBlendMaterial[attachmentAtlasRegion->page];
|
||||||
break;
|
break;
|
||||||
@ -271,14 +266,14 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) {
|
|||||||
material = pageToNormalBlendMaterial[attachmentAtlasRegion->page];
|
material = pageToNormalBlendMaterial[attachmentAtlasRegion->page];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spSkeletonClipping_isClipping(clipper)) {
|
if (clipper.isClipping()) {
|
||||||
spSkeletonClipping_clipTriangles(clipper, attachmentVertices, numVertices << 1, attachmentIndices, numIndices, attachmentUvs, 2);
|
clipper.clipTriangles(attachmentVertices.buffer(), attachmentIndices, numIndices, attachmentUvs, 2);
|
||||||
attachmentVertices = clipper->clippedVertices->items;
|
attachmentVertices = clipper.getClippedVertices();
|
||||||
numVertices = clipper->clippedVertices->size >> 1;
|
numVertices = clipper.getClippedVertices().size() >> 1;
|
||||||
attachmentIndices = clipper->clippedTriangles->items;
|
attachmentIndices = clipper.getClippedTriangles().buffer();
|
||||||
numIndices = clipper->clippedTriangles->size;
|
numIndices = clipper.getClippedTriangles().size();
|
||||||
attachmentUvs = clipper->clippedUVs->items;
|
attachmentUvs = clipper.getClippedUVs().buffer();
|
||||||
if (clipper->clippedTriangles->size == 0) continue;
|
if (clipper.getClippedTriangles().size() == 0) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastMaterial != material) {
|
if (lastMaterial != material) {
|
||||||
@ -289,14 +284,14 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) {
|
|||||||
|
|
||||||
SetMaterial(meshSection, material);
|
SetMaterial(meshSection, material);
|
||||||
|
|
||||||
uint8 r = static_cast<uint8>(Skeleton->color.r * slot->color.r * attachmentColor.r * 255);
|
uint8 r = static_cast<uint8>(Skeleton->getColor().r * slot->getColor().r * attachmentColor.r * 255);
|
||||||
uint8 g = static_cast<uint8>(Skeleton->color.g * slot->color.g * attachmentColor.g * 255);
|
uint8 g = static_cast<uint8>(Skeleton->getColor().g * slot->getColor().g * attachmentColor.g * 255);
|
||||||
uint8 b = static_cast<uint8>(Skeleton->color.b * slot->color.b * attachmentColor.b * 255);
|
uint8 b = static_cast<uint8>(Skeleton->getColor().b * slot->getColor().b * attachmentColor.b * 255);
|
||||||
uint8 a = static_cast<uint8>(Skeleton->color.a * slot->color.a * attachmentColor.a * 255);
|
uint8 a = static_cast<uint8>(Skeleton->getColor().a * slot->getColor().a * attachmentColor.a * 255);
|
||||||
|
|
||||||
float dr = slot->darkColor ? slot->darkColor->r : 0.0f;
|
float dr = slot->hasDarkColor() ? slot->getDarkColor().r : 0.0f;
|
||||||
float dg = slot->darkColor ? slot->darkColor->g : 0.0f;
|
float dg = slot->hasDarkColor() ? slot->getDarkColor().g : 0.0f;
|
||||||
float db = slot->darkColor ? slot->darkColor->b : 0.0f;
|
float db = slot->hasDarkColor() ? slot->getDarkColor().b : 0.0f;
|
||||||
|
|
||||||
for (int j = 0; j < numVertices << 1; j += 2) {
|
for (int j = 0; j < numVertices << 1; j += 2) {
|
||||||
colors.Add(FColor(r, g, b, a));
|
colors.Add(FColor(r, g, b, a));
|
||||||
@ -312,11 +307,11 @@ void USpineSkeletonRendererComponent::UpdateMesh(spSkeleton* Skeleton) {
|
|||||||
idx += numVertices;
|
idx += numVertices;
|
||||||
depthOffset += this->DepthOffset;
|
depthOffset += this->DepthOffset;
|
||||||
|
|
||||||
spSkeletonClipping_clipEnd(clipper, slot);
|
clipper.clipEnd(*slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
Flush(meshSection, vertices, indices, uvs, colors, darkColors, lastMaterial);
|
Flush(meshSection, vertices, indices, uvs, colors, darkColors, lastMaterial);
|
||||||
spSkeletonClipping_clipEnd2(clipper);
|
clipper.clipEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef LOCTEXT_NAMESPACE
|
#undef LOCTEXT_NAMESPACE
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class SPINEPLUGIN_API USpineAtlasAsset: public UObject {
|
|||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
spAtlas* GetAtlas (bool ForceReload = false);
|
spine::Atlas* GetAtlas (bool ForceReload = false);
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
TArray<UTexture2D*> atlasPages;
|
TArray<UTexture2D*> atlasPages;
|
||||||
@ -51,7 +51,7 @@ public:
|
|||||||
virtual void BeginDestroy () override;
|
virtual void BeginDestroy () override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
spAtlas* atlas = nullptr;
|
spine::Atlas* atlas = nullptr;
|
||||||
|
|
||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
FString rawData;
|
FString rawData;
|
||||||
|
|||||||
@ -40,14 +40,14 @@ struct SPINEPLUGIN_API FSpineEvent {
|
|||||||
GENERATED_BODY();
|
GENERATED_BODY();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void SetEvent(spEvent* event) {
|
void SetEvent(spine::Event* event) {
|
||||||
Name = FString(UTF8_TO_TCHAR(event->data->name));
|
Name = FString(UTF8_TO_TCHAR(event->getData().getName().buffer()));
|
||||||
if (event->stringValue) {
|
if (!event->getStringValue().isEmpty()) {
|
||||||
StringValue = FString(UTF8_TO_TCHAR(event->stringValue));
|
StringValue = FString(UTF8_TO_TCHAR(event->getStringValue().buffer()));
|
||||||
}
|
}
|
||||||
this->IntValue = event->intValue;
|
this->IntValue = event->getIntValue();
|
||||||
this->FloatValue = event->floatValue;
|
this->FloatValue = event->getFloatValue();
|
||||||
this->Time = event->time;
|
this->Time = event->getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadonly)
|
UPROPERTY(BlueprintReadonly)
|
||||||
@ -81,101 +81,81 @@ public:
|
|||||||
|
|
||||||
UTrackEntry () { }
|
UTrackEntry () { }
|
||||||
|
|
||||||
void SetTrackEntry (spTrackEntry* entry);
|
void SetTrackEntry (spine::TrackEntry* entry);
|
||||||
spTrackEntry* GetTrackEntry() { return entry; }
|
spine::TrackEntry* GetTrackEntry() { return entry; }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
int GetTrackIndex () { return entry ? entry->trackIndex : 0; }
|
int GetTrackIndex () { return entry ? entry->getTrackIndex() : 0; }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
bool GetLoop () { return entry ? entry->loop != 0 : false; }
|
bool GetLoop () { return entry ? entry->getLoop() : false; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetLoop (bool loop) { if (entry) entry->loop = loop ? 1 : 0; }
|
void SetLoop(bool loop) { if (entry) entry->setLoop(loop); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
float GetEventThreshold () { return entry ? entry->eventThreshold : 0; }
|
float GetEventThreshold () { return entry ? entry->getEventThreshold() : 0; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetEventThreshold(float eventThreshold) { if (entry) entry->eventThreshold = eventThreshold; }
|
void SetEventThreshold(float eventThreshold) { if (entry) entry->setEventThreshold(eventThreshold); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
float GetAttachmentThreshold() { return entry ? entry->attachmentThreshold : 0; }
|
float GetAttachmentThreshold() { return entry ? entry->getAttachmentThreshold() : 0; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetAttachmentThreshold(float attachmentThreshold) { if (entry) entry->attachmentThreshold = attachmentThreshold; }
|
void SetAttachmentThreshold(float attachmentThreshold) { if (entry) entry->setAttachmentThreshold(attachmentThreshold); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
float GetDrawOrderThreshold() { return entry ? entry->drawOrderThreshold : 0; }
|
float GetDrawOrderThreshold() { return entry ? entry->getDrawOrderThreshold() : 0; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetDrawOrderThreshold(float drawOrderThreshold) { if (entry) entry->drawOrderThreshold = drawOrderThreshold; }
|
void SetDrawOrderThreshold(float drawOrderThreshold) { if (entry) entry->setDrawOrderThreshold(drawOrderThreshold); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
float GetAnimationStart() { return entry ? entry->animationStart : 0; }
|
float GetAnimationStart() { return entry ? entry->getAnimationStart() : 0; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetAnimationStart(float animationStart) { if (entry) entry->animationStart = animationStart; }
|
void SetAnimationStart(float animationStart) { if (entry) entry->setAnimationStart(animationStart); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
float GetAnimationEnd() { return entry ? entry->animationEnd : 0; }
|
float GetAnimationEnd() { return entry ? entry->getAnimationEnd() : 0; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetAnimationEnd(float animationEnd) { if (entry) entry->animationEnd = animationEnd; }
|
void SetAnimationEnd(float animationEnd) { if (entry) entry->setAnimationEnd(animationEnd); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
float GetAnimationLast() { return entry ? entry->animationLast : 0; }
|
float GetAnimationLast() { return entry ? entry->getAnimationLast() : 0; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetAnimationLast(float animationLast) { if (entry) entry->animationLast = animationLast; }
|
void SetAnimationLast(float animationLast) { if (entry) entry->setAnimationLast(animationLast); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
float GetNextAnimationLast() { return entry ? entry->nextAnimationLast : 0; }
|
float GetDelay() { return entry ? entry->getDelay() : 0; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetNextAnimationLast(float nextAnimationLast) { if (entry) entry->nextAnimationLast = nextAnimationLast; }
|
void SetDelay(float delay) { if (entry) entry->setDelay(delay); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
float GetDelay() { return entry ? entry->delay : 0; }
|
float GetTrackTime() { return entry ? entry->getTrackTime() : 0; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetDelay(float delay) { if (entry) entry->delay = delay; }
|
void SetTrackTime(float trackTime) { if (entry) entry->setTrackTime(trackTime); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
float GetTrackTime() { return entry ? entry->trackTime : 0; }
|
float GetTrackEnd() { return entry ? entry->getTrackEnd() : 0; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetTrackTime(float trackTime) { if (entry) entry->trackTime = trackTime; }
|
void SetTrackEnd(float trackEnd) { if (entry) entry->setTrackEnd(trackEnd); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
float GetTrackLast() { return entry ? entry->trackLast : 0; }
|
float GetTimeScale() { return entry ? entry->getTimeScale() : 0; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetTrackLast(float trackLast) { if (entry) entry->trackLast = trackLast; }
|
void SetTimeScale(float timeScale) { if (entry) entry->setTimeScale(timeScale); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
float GetNextTrackLast() { return entry ? entry->nextTrackLast : 0; }
|
float GetAlpha() { return entry ? entry->getAlpha() : 0; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetNextTrackLast(float nextTrackLast) { if (entry) entry->nextTrackLast = nextTrackLast; }
|
void SetAlpha(float alpha) { if (entry) entry->setAlpha(alpha); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
float GetTrackEnd() { return entry ? entry->trackEnd : 0; }
|
float GetMixTime() { return entry ? entry->getMixTime() : 0; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetTrackEnd(float trackEnd) { if (entry) entry->trackEnd = trackEnd; }
|
void SetMixTime(float mixTime) { if (entry) entry->setMixTime(mixTime); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
float GetTimeScale() { return entry ? entry->timeScale : 0; }
|
float GetMixDuration() { return entry ? entry->getMixDuration() : 0; }
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
||||||
void SetTimeScale(float timeScale) { if (entry) entry->timeScale = timeScale; }
|
void SetMixDuration(float mixDuration) { if (entry) entry->setMixDuration(mixDuration); }
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
|
||||||
float GetAlpha() { return entry ? entry->alpha : 0; }
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
|
||||||
void SetAlpha(float alpha) { if (entry) entry->alpha = alpha; }
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
|
||||||
float GetMixTime() { return entry ? entry->mixTime : 0; }
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
|
||||||
void SetMixTime(float mixTime) { if (entry) entry->mixTime = mixTime; }
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
|
||||||
float GetMixDuration() { return entry ? entry->mixDuration : 0; }
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
|
||||||
void SetMixDuration(float mixDuration) { if (entry) entry->mixDuration = mixDuration; }
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
|
||||||
float GetInterruptAlpha() { return entry ? entry->interruptAlpha : 0; }
|
|
||||||
UFUNCTION(BlueprintCallable, Category="Components|Spine|TrackEntry")
|
|
||||||
void SetInterruptAlpha(float interruptAlpha) { if (entry) entry->interruptAlpha = interruptAlpha; }
|
|
||||||
|
|
||||||
UPROPERTY(BlueprintAssignable, Category = "Components|Spine|TrackEntry")
|
UPROPERTY(BlueprintAssignable, Category = "Components|Spine|TrackEntry")
|
||||||
FSpineAnimationStartDelegate AnimationStart;
|
FSpineAnimationStartDelegate AnimationStart;
|
||||||
@ -196,7 +176,7 @@ public:
|
|||||||
FSpineAnimationDisposeDelegate AnimationDispose;
|
FSpineAnimationDisposeDelegate AnimationDispose;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
spTrackEntry* entry = nullptr;
|
spine::TrackEntry* entry = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
class USpineAtlasAsset;
|
class USpineAtlasAsset;
|
||||||
@ -205,7 +185,7 @@ class SPINEPLUGIN_API USpineSkeletonAnimationComponent: public USpineSkeletonCom
|
|||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
spAnimationState* GetAnimationState () { return state; };
|
spine::AnimationState* GetAnimationState () { return state; };
|
||||||
|
|
||||||
USpineSkeletonAnimationComponent ();
|
USpineSkeletonAnimationComponent ();
|
||||||
|
|
||||||
@ -269,7 +249,7 @@ protected:
|
|||||||
virtual void InternalTick(float DeltaTime, bool CallDelegates = true) override;
|
virtual void InternalTick(float DeltaTime, bool CallDelegates = true) override;
|
||||||
virtual void DisposeState () override;
|
virtual void DisposeState () override;
|
||||||
|
|
||||||
spAnimationState* state;
|
spine::AnimationState* state;
|
||||||
|
|
||||||
// keep track of track entries so they won't get GCed while
|
// keep track of track entries so they won't get GCed while
|
||||||
// in transit within a blueprint
|
// in transit within a blueprint
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public:
|
|||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Spine)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Spine)
|
||||||
USpineSkeletonDataAsset* SkeletonData;
|
USpineSkeletonDataAsset* SkeletonData;
|
||||||
|
|
||||||
spSkeleton* GetSkeleton () { return skeleton; };
|
spine::Skeleton* GetSkeleton () { return skeleton; };
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "Components|Spine|Skeleton")
|
UFUNCTION(BlueprintCallable, Category = "Components|Spine|Skeleton")
|
||||||
bool SetSkin (const FString& SkinName);
|
bool SetSkin (const FString& SkinName);
|
||||||
@ -109,7 +109,7 @@ protected:
|
|||||||
virtual void InternalTick(float DeltaTime, bool CallDelegates = true);
|
virtual void InternalTick(float DeltaTime, bool CallDelegates = true);
|
||||||
virtual void DisposeState ();
|
virtual void DisposeState ();
|
||||||
|
|
||||||
spSkeleton* skeleton;
|
spine::Skeleton* skeleton;
|
||||||
USpineAtlasAsset* lastAtlas = nullptr;
|
USpineAtlasAsset* lastAtlas = nullptr;
|
||||||
USpineSkeletonDataAsset* lastData = nullptr;
|
USpineSkeletonDataAsset* lastData = nullptr;
|
||||||
};
|
};
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user