[ue4][cpp] Switched to IWYU build for much improved rebuild times.

Cleaned up spine-cpp and removed UE4 specific code.
This commit is contained in:
badlogic 2022-03-25 12:20:57 +01:00
parent 5adf03afcf
commit 8910c458e8
88 changed files with 119 additions and 449 deletions

View File

@ -30,13 +30,15 @@
#ifndef Spine_HashMap_h #ifndef Spine_HashMap_h
#define Spine_HashMap_h #define Spine_HashMap_h
#include <spine/Extension.h>
#include <spine/Vector.h> #include <spine/Vector.h>
#include <spine/SpineObject.h> #include <spine/SpineObject.h>
// Required for new with line number and file name in MSVC // Required for new with line number and file name in MSVC
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(disable:4291) #pragma warning(disable:4291)
#pragma warning(disable:4251)
#endif #endif
namespace spine { namespace spine {

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/Animation.h> #include <spine/Animation.h>
#include <spine/Event.h> #include <spine/Event.h>
#include <spine/Skeleton.h> #include <spine/Skeleton.h>
@ -98,14 +94,14 @@ void Animation::setDuration(float inValue) {
int Animation::search(Vector<float> &frames, float target) { int Animation::search(Vector<float> &frames, float target) {
size_t n = (int) frames.size(); size_t n = (int) frames.size();
for (size_t i = 1; i < n; i++) { for (size_t i = 1; i < n; i++) {
if (frames[i] > target) return i - 1; if (frames[i] > target) return (int)(i - 1);
} }
return n - 1; return (int)(n - 1);
} }
int Animation::search(Vector<float> &frames, float target, int step) { int Animation::search(Vector<float> &frames, float target, int step) {
size_t n = frames.size(); size_t n = frames.size();
for (size_t i = step; i < n; i += step) for (size_t i = step; i < n; i += step)
if (frames[i] > target) return i - step; if (frames[i] > target) return (int)(i - step);
return n - step; return (int)(n - step);
} }

View File

@ -27,12 +27,8 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/Animation.h>
#include <spine/AnimationState.h> #include <spine/AnimationState.h>
#include <spine/Animation.h>
#include <spine/AnimationStateData.h> #include <spine/AnimationStateData.h>
#include <spine/AttachmentTimeline.h> #include <spine/AttachmentTimeline.h>
#include <spine/Bone.h> #include <spine/Bone.h>
@ -493,7 +489,7 @@ bool AnimationState::apply(Skeleton &skeleton) {
int setupState = _unkeyedState + Setup; int setupState = _unkeyedState + Setup;
Vector<Slot *> &slots = skeleton.getSlots(); Vector<Slot *> &slots = skeleton.getSlots();
for (int i = 0, n = slots.size(); i < n; i++) { for (int i = 0, n = (int)slots.size(); i < n; i++) {
Slot *slot = slots[i]; Slot *slot = slots[i];
if (slot->getAttachmentState() == setupState) { if (slot->getAttachmentState() == setupState) {
const String &attachmentName = slot->getData().getAttachmentName(); const String &attachmentName = slot->getData().getAttachmentName();
@ -955,7 +951,7 @@ TrackEntry *AnimationState::newTrackEntry(size_t trackIndex, Animation *animatio
TrackEntry *entryP = _trackEntryPool.obtain();// Pooling TrackEntry *entryP = _trackEntryPool.obtain();// Pooling
TrackEntry &entry = *entryP; TrackEntry &entry = *entryP;
entry._trackIndex = trackIndex; entry._trackIndex = (int)trackIndex;
entry._animation = animation; entry._animation = animation;
entry._loop = loop; entry._loop = loop;
entry._holdPrevious = 0; entry._holdPrevious = 0;

View File

@ -27,12 +27,8 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/Animation.h>
#include <spine/AnimationStateData.h> #include <spine/AnimationStateData.h>
#include <spine/Animation.h>
#include <spine/SkeletonData.h> #include <spine/SkeletonData.h>
using namespace spine; using namespace spine;

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/Atlas.h> #include <spine/Atlas.h>
#include <spine/ContainerUtil.h> #include <spine/ContainerUtil.h>
#include <spine/TextureLoader.h> #include <spine/TextureLoader.h>
@ -159,7 +155,7 @@ struct SimpleString {
} }
bool equals(const char *str) { bool equals(const char *str) {
int otherLen = strlen(str); int otherLen = (int)strlen(str);
if (length != otherLen) return false; if (length != otherLen) return false;
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
if (start[i] != str[i]) return false; if (start[i] != str[i]) return false;

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/AtlasAttachmentLoader.h> #include <spine/AtlasAttachmentLoader.h>
#include <spine/BoundingBoxAttachment.h> #include <spine/BoundingBoxAttachment.h>
#include <spine/ClippingAttachment.h> #include <spine/ClippingAttachment.h>
@ -50,7 +46,7 @@ namespace spine {
bool loadSequence(Atlas *atlas, const String &basePath, Sequence *sequence) { bool loadSequence(Atlas *atlas, const String &basePath, Sequence *sequence) {
Vector<TextureRegion *> &regions = sequence->getRegions(); Vector<TextureRegion *> &regions = sequence->getRegions();
for (int i = 0, n = regions.size(); i < n; i++) { for (int i = 0, n = (int)regions.size(); i < n; i++) {
String path = sequence->getPath(basePath, i); String path = sequence->getPath(basePath, i);
regions[i] = atlas->findRegion(path); regions[i] = atlas->findRegion(path);
if (!regions[i]) return false; if (!regions[i]) return false;

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/AttachmentLoader.h> #include <spine/AttachmentLoader.h>
#include <spine/BoundingBoxAttachment.h> #include <spine/BoundingBoxAttachment.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/AttachmentTimeline.h> #include <spine/AttachmentTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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;

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/ColorTimeline.h> #include <spine/ColorTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/ConstraintData.h> #include <spine/ConstraintData.h>
using namespace spine; using namespace spine;

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>
@ -115,7 +111,7 @@ void CurveTimeline1::setFrame(size_t frame, float time, float value) {
} }
float CurveTimeline1::getCurveValue(float time) { float CurveTimeline1::getCurveValue(float time) {
int i = _frames.size() - 2; int i = (int)_frames.size() - 2;
for (int ii = 2; ii <= i; ii += 2) { for (int ii = 2; ii <= i; ii += 2) {
if (_frames[ii] > time) { if (_frames[ii] > time) {
i = ii - 2; i = ii - 2;

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/DeformTimeline.h> #include <spine/DeformTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/DrawOrderTimeline.h> #include <spine/DrawOrderTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/EventTimeline.h> #include <spine/EventTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/Extension.h> #include <spine/Extension.h>
#include <spine/SpineString.h> #include <spine/SpineString.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/IkConstraint.h> #include <spine/IkConstraint.h>
#include <spine/Bone.h> #include <spine/Bone.h>
@ -292,7 +288,7 @@ void IkConstraint::update() {
} }
int IkConstraint::getOrder() { int IkConstraint::getOrder() {
return _data.getOrder(); return (int)_data.getOrder();
} }
IkConstraintData &IkConstraint::getData() { IkConstraintData &IkConstraint::getData() {

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/IkConstraintTimeline.h> #include <spine/IkConstraintTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -21,10 +21,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
/* Json */ /* Json */
/* JSON parser in CPP, from json.c in the spine-c runtime */ /* JSON parser in CPP, from json.c in the spine-c runtime */
@ -38,8 +34,8 @@ THE SOFTWARE.
#define _BSD_SOURCE #define _BSD_SOURCE
#endif #endif
#include <spine/Extension.h>
#include <spine/Json.h> #include <spine/Json.h>
#include <spine/Extension.h>
#include <spine/SpineString.h> #include <spine/SpineString.h>
#include <assert.h> #include <assert.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>

View File

@ -37,7 +37,7 @@ void spine::spDebug_printSkeletonData(SkeletonData *skeletonData) {
int i, n; int i, n;
spDebug_printBoneDatas(skeletonData->getBones()); spDebug_printBoneDatas(skeletonData->getBones());
for (i = 0, n = skeletonData->getAnimations().size(); i < n; i++) { for (i = 0, n = (int)skeletonData->getAnimations().size(); i < n; i++) {
spDebug_printAnimation(skeletonData->getAnimations()[i]); spDebug_printAnimation(skeletonData->getAnimations()[i]);
} }
} }
@ -69,7 +69,7 @@ void spine::spDebug_printAnimation(Animation *animation) {
int i, n; int i, n;
printf("Animation %s: %zu timelines\n", animation->getName().buffer(), animation->getTimelines().size()); printf("Animation %s: %zu timelines\n", animation->getName().buffer(), animation->getTimelines().size());
for (i = 0, n = animation->getTimelines().size(); i < n; i++) { for (i = 0, n = (int)animation->getTimelines().size(); i < n; i++) {
Timeline *timeline = animation->getTimelines()[i]; Timeline *timeline = animation->getTimelines()[i];
spDebug_printTimeline(timeline); spDebug_printTimeline(timeline);
} }
@ -77,7 +77,7 @@ void spine::spDebug_printAnimation(Animation *animation) {
void spine::spDebug_printBoneDatas(Vector<BoneData *> &boneDatas) { void spine::spDebug_printBoneDatas(Vector<BoneData *> &boneDatas) {
int i, n; int i, n;
for (i = 0, n = boneDatas.size(); i < n; i++) { for (i = 0, n = (int)boneDatas.size(); i < n; i++) {
spDebug_printBoneData(boneDatas[i]); spDebug_printBoneData(boneDatas[i]);
} }
} }
@ -94,7 +94,7 @@ void spine::spDebug_printSkeleton(Skeleton *skeleton) {
void spine::spDebug_printBones(Vector<Bone *> &bones) { void spine::spDebug_printBones(Vector<Bone *> &bones) {
int i, n; int i, n;
for (i = 0, n = bones.size(); i < n; i++) { for (i = 0, n = (int)bones.size(); i < n; i++) {
spDebug_printBone(bones[i]); spDebug_printBone(bones[i]);
} }
} }
@ -116,7 +116,7 @@ void spine::spDebug_printFloats(float *values, int numFloats) {
void spine::spDebug_printFloats(Vector<float> &values) { void spine::spDebug_printFloats(Vector<float> &values) {
int i, n; int i, n;
printf("(%zu) [", values.size()); printf("(%zu) [", values.size());
for (i = 0, n = values.size(); i < n; i++) { for (i = 0, n = (int)values.size(); i < n; i++) {
printf("%f, ", values[i]); printf("%f, ", values[i]);
} }
printf("]"); printf("]");

View File

@ -27,12 +27,8 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <math.h>
#include <spine/MathUtil.h> #include <spine/MathUtil.h>
#include <math.h>
#include <stdlib.h> #include <stdlib.h>
// Required for division by 0 in _isNaN on MSVC // Required for division by 0 in _isNaN on MSVC

View File

@ -27,12 +27,8 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/HasRendererObject.h>
#include <spine/MeshAttachment.h> #include <spine/MeshAttachment.h>
#include <spine/HasRendererObject.h>
using namespace spine; using namespace spine;
@ -57,7 +53,7 @@ void MeshAttachment::updateRegion() {
_uvs.setSize(_regionUVs.size(), 0); _uvs.setSize(_regionUVs.size(), 0);
} }
int i = 0, n = _regionUVs.size(); int i = 0, n = (int)_regionUVs.size();
float u = _region->u, v = _region->v; float u = _region->u, v = _region->v;
float width = 0, height = 0; float width = 0, height = 0;

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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;

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/PathConstraint.h> #include <spine/PathConstraint.h>
#include <spine/Bone.h> #include <spine/Bone.h>
@ -152,7 +148,7 @@ void PathConstraint::update() {
} }
} }
Vector<float> &positions = computeWorldPositions(*attachment, spacesCount, tangents); Vector<float> &positions = computeWorldPositions(*attachment, (int)spacesCount, tangents);
float boneX = positions[0]; float boneX = positions[0];
float boneY = positions[1]; float boneY = positions[1];
float offsetRotation = data.getOffsetRotation(); float offsetRotation = data.getOffsetRotation();
@ -225,7 +221,7 @@ void PathConstraint::update() {
} }
int PathConstraint::getOrder() { int PathConstraint::getOrder() {
return _data.getOrder(); return (int)_data.getOrder();
} }
float PathConstraint::getPosition() { float PathConstraint::getPosition() {
@ -292,7 +288,7 @@ PathConstraint::computeWorldPositions(PathAttachment &path, int spacesCount, boo
Vector<float> &out = _positions; Vector<float> &out = _positions;
Vector<float> &world = _world; Vector<float> &world = _world;
bool closed = path.isClosed(); bool closed = path.isClosed();
int verticesLength = path.getWorldVerticesLength(); int verticesLength = (int)path.getWorldVerticesLength();
int curveCount = verticesLength / 6; int curveCount = verticesLength / 6;
int prevCurve = NONE; int prevCurve = NONE;

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/PathConstraintMixTimeline.h> #include <spine/PathConstraintMixTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/PathConstraintPositionTimeline.h> #include <spine/PathConstraintPositionTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/PathConstraintSpacingTimeline.h> #include <spine/PathConstraintSpacingTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/RTTI.h> #include <spine/RTTI.h>
#include <spine/SpineString.h> #include <spine/SpineString.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/RotateTimeline.h> #include <spine/RotateTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/ScaleTimeline.h> #include <spine/ScaleTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -47,7 +47,7 @@ Sequence::~Sequence() {
} }
Sequence *Sequence::copy() { Sequence *Sequence::copy() {
Sequence *copy = new (__FILE__, __LINE__) Sequence(_regions.size()); Sequence *copy = new (__FILE__, __LINE__) Sequence((int)_regions.size());
for (size_t i = 0; i < _regions.size(); i++) { for (size_t i = 0; i < _regions.size(); i++) {
copy->_regions[i] = _regions[i]; copy->_regions[i] = _regions[i];
} }
@ -60,7 +60,7 @@ Sequence *Sequence::copy() {
void Sequence::apply(Slot *slot, Attachment *attachment) { void Sequence::apply(Slot *slot, Attachment *attachment) {
int index = slot->getSequenceIndex(); int index = slot->getSequenceIndex();
if (index == -1) index = _setupIndex; if (index == -1) index = _setupIndex;
if (index >= (int) _regions.size()) index = _regions.size() - 1; if (index >= (int) _regions.size()) index = (int)_regions.size() - 1;
TextureRegion *region = _regions[index]; TextureRegion *region = _regions[index];
if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) { if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) {
@ -86,7 +86,7 @@ String Sequence::getPath(const String &basePath, int index) {
String result(basePath); String result(basePath);
String frame; String frame;
frame.append(_start + index); frame.append(_start + index);
for (int i = _digits - frame.length(); i > 0; i--) for (int i = _digits - (int)frame.length(); i > 0; i--)
result.append("0"); result.append("0");
result.append(frame); result.append(frame);
return result; return result;

View File

@ -27,21 +27,15 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/Bone.h>
#include <spine/SequenceTimeline.h> #include <spine/SequenceTimeline.h>
#include <spine/Bone.h>
#include <spine/RegionAttachment.h> #include <spine/RegionAttachment.h>
#include <spine/MeshAttachment.h> #include <spine/MeshAttachment.h>
#include <spine/Event.h> #include <spine/Event.h>
#include <spine/Skeleton.h> #include <spine/Skeleton.h>
#include <spine/Attachment.h> #include <spine/Attachment.h>
#include <spine/PathConstraint.h>
#include <spine/PathConstraintData.h> #include <spine/PathConstraintData.h>
#include <spine/Slot.h> #include <spine/Slot.h>
#include <spine/SlotData.h>
#include <spine/Animation.h> #include <spine/Animation.h>
using namespace spine; using namespace spine;
@ -95,7 +89,7 @@ void SequenceTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vec
Sequence *sequence = NULL; Sequence *sequence = NULL;
if (_attachment->getRTTI().instanceOf(RegionAttachment::rtti)) sequence = ((RegionAttachment *) _attachment)->getSequence(); if (_attachment->getRTTI().instanceOf(RegionAttachment::rtti)) sequence = ((RegionAttachment *) _attachment)->getSequence();
if (_attachment->getRTTI().instanceOf(MeshAttachment::rtti)) sequence = ((MeshAttachment *) _attachment)->getSequence(); if (_attachment->getRTTI().instanceOf(MeshAttachment::rtti)) sequence = ((MeshAttachment *) _attachment)->getSequence();
int index = modeAndIndex >> 4, count = sequence->getRegions().size(); int index = modeAndIndex >> 4, count = (int)sequence->getRegions().size();
int mode = modeAndIndex & 0xf; int mode = modeAndIndex & 0xf;
if (mode != SequenceMode::hold) { if (mode != SequenceMode::hold) {
index += (int) (((time - before) / delay + 0.00001)); index += (int) (((time - before) / delay + 0.00001));

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/ShearTimeline.h> #include <spine/ShearTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/Skeleton.h> #include <spine/Skeleton.h>
#include <spine/Attachment.h> #include <spine/Attachment.h>
@ -372,7 +368,7 @@ void Skeleton::setAttachment(const String &slotName, const String &attachmentNam
if (slot->_data.getName() == slotName) { if (slot->_data.getName() == slotName) {
Attachment *attachment = NULL; Attachment *attachment = NULL;
if (attachmentName.length() > 0) { if (attachmentName.length() > 0) {
attachment = getAttachment(i, attachmentName); attachment = getAttachment((int)i, attachmentName);
assert(attachment != NULL); assert(attachment != NULL);
} }

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/SkeletonBinary.h> #include <spine/SkeletonBinary.h>
#include <spine/Animation.h> #include <spine/Animation.h>
@ -291,7 +287,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons
} }
/* Linked meshes. */ /* Linked meshes. */
for (int i = 0, n = _linkedMeshes.size(); i < n; ++i) { for (int i = 0, n = (int)_linkedMeshes.size(); i < n; ++i) {
LinkedMesh *linkedMesh = _linkedMeshes[i]; LinkedMesh *linkedMesh = _linkedMeshes[i];
Skin *skin = linkedMesh->_skin.length() == 0 ? skeletonData->getDefaultSkin() : skeletonData->findSkin(linkedMesh->_skin); Skin *skin = linkedMesh->_skin.length() == 0 ? skeletonData->getDefaultSkin() : skeletonData->findSkin(linkedMesh->_skin);
if (skin == NULL) { if (skin == NULL) {
@ -757,7 +753,7 @@ void SkeletonBinary::setBezier(DataInput *input, CurveTimeline *timeline, int be
Timeline *SkeletonBinary::readTimeline(DataInput *input, CurveTimeline1 *timeline, float scale) { Timeline *SkeletonBinary::readTimeline(DataInput *input, CurveTimeline1 *timeline, float scale) {
float time = readFloat(input); float time = readFloat(input);
float value = readFloat(input) * scale; float value = readFloat(input) * scale;
for (int frame = 0, bezier = 0, frameLast = timeline->getFrameCount() - 1;; frame++) { for (int frame = 0, bezier = 0, frameLast = (int)timeline->getFrameCount() - 1;; frame++) {
timeline->setFrame(frame, time, value); timeline->setFrame(frame, time, value);
if (frame == frameLast) break; if (frame == frameLast) break;
float time2 = readFloat(input); float time2 = readFloat(input);
@ -779,7 +775,7 @@ Timeline *SkeletonBinary::readTimeline2(DataInput *input, CurveTimeline2 *timeli
float time = readFloat(input); float time = readFloat(input);
float value1 = readFloat(input) * scale; float value1 = readFloat(input) * scale;
float value2 = readFloat(input) * scale; float value2 = readFloat(input) * scale;
for (int frame = 0, bezier = 0, frameLast = timeline->getFrameCount() - 1;; frame++) { for (int frame = 0, bezier = 0, frameLast = (int)timeline->getFrameCount() - 1;; frame++) {
timeline->setFrame(frame, time, value1, value2); timeline->setFrame(frame, time, value1, value2);
if (frame == frameLast) break; if (frame == frameLast) break;
float time2 = readFloat(input); float time2 = readFloat(input);
@ -1202,7 +1198,7 @@ Animation *SkeletonBinary::readAnimation(const String &name, DataInput *input, S
float mixRotate = readFloat(input); float mixRotate = readFloat(input);
float mixX = readFloat(input); float mixX = readFloat(input);
float mixY = readFloat(input); float mixY = readFloat(input);
for (int frame = 0, bezier = 0, frameLast = timeline->getFrameCount() - 1;; frame++) { for (int frame = 0, bezier = 0, frameLast = (int)timeline->getFrameCount() - 1;; frame++) {
timeline->setFrame(frame, time, mixRotate, mixX, mixY); timeline->setFrame(frame, time, mixRotate, mixX, mixY);
if (frame == frameLast) break; if (frame == frameLast) break;
float time2 = readFloat(input); float time2 = readFloat(input);
@ -1250,7 +1246,7 @@ Animation *SkeletonBinary::readAnimation(const String &name, DataInput *input, S
case ATTACHMENT_DEFORM: { case ATTACHMENT_DEFORM: {
bool weighted = attachment->_bones.size() > 0; bool weighted = attachment->_bones.size() > 0;
Vector<float> &vertices = attachment->_vertices; Vector<float> &vertices = attachment->_vertices;
int deformLength = weighted ? vertices.size() / 3 * 2 : vertices.size(); int deformLength = weighted ? (int)vertices.size() / 3 * 2 : (int)vertices.size();
int bezierCount = readVarint(input, true); int bezierCount = readVarint(input, true);
DeformTimeline *timeline = new (__FILE__, __LINE__) DeformTimeline(frameCount, bezierCount, slotIndex, DeformTimeline *timeline = new (__FILE__, __LINE__) DeformTimeline(frameCount, bezierCount, slotIndex,
@ -1340,15 +1336,15 @@ Animation *SkeletonBinary::readAnimation(const String &name, DataInput *input, S
size_t slotIndex = (size_t) readVarint(input, true); size_t slotIndex = (size_t) readVarint(input, true);
// Collect unchanged items. // Collect unchanged items.
while (originalIndex != slotIndex) while (originalIndex != slotIndex)
unchanged[unchangedIndex++] = originalIndex++; unchanged[unchangedIndex++] = (int)originalIndex++;
// Set changed items. // Set changed items.
size_t index = originalIndex; size_t index = originalIndex;
drawOrder[index + (size_t) readVarint(input, true)] = originalIndex++; drawOrder[index + (size_t) readVarint(input, true)] = (int)originalIndex++;
} }
// Collect remaining unchanged items. // Collect remaining unchanged items.
while (originalIndex < slotCount) { while (originalIndex < slotCount) {
unchanged[unchangedIndex++] = originalIndex++; unchanged[unchangedIndex++] = (int)originalIndex++;
} }
// Fill in unchanged items. // Fill in unchanged items.
@ -1386,7 +1382,7 @@ Animation *SkeletonBinary::readAnimation(const String &name, DataInput *input, S
} }
float duration = 0; float duration = 0;
for (int i = 0, n = timelines.size(); i < n; i++) { for (int i = 0, n = (int)timelines.size(); i < n; i++) {
duration = MathUtil::max(duration, (timelines[i])->getDuration()); duration = MathUtil::max(duration, (timelines[i])->getDuration());
} }
return new (__FILE__, __LINE__) Animation(String(name), timelines, duration); return new (__FILE__, __LINE__) Animation(String(name), timelines, duration);

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/SkeletonBounds.h> #include <spine/SkeletonBounds.h>
#include <spine/Bone.h> #include <spine/Bone.h>
@ -78,7 +74,7 @@ void SkeletonBounds::update(Skeleton &skeleton, bool updateAabb) {
Polygon &polygon = *polygonP; Polygon &polygon = *polygonP;
size_t count = boundingBox->getWorldVerticesLength(); size_t count = boundingBox->getWorldVerticesLength();
polygon._count = count; polygon._count = (int)count;
if (polygon._vertices.size() < count) { if (polygon._vertices.size() < count) {
polygon._vertices.setSize(count, 0); polygon._vertices.setSize(count, 0);
} }

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/SkeletonClipping.h> #include <spine/SkeletonClipping.h>
#include <spine/ClippingAttachment.h> #include <spine/ClippingAttachment.h>
@ -52,7 +48,7 @@ size_t SkeletonClipping::clipStart(Slot &slot, ClippingAttachment *clip) {
_clipAttachment = clip; _clipAttachment = clip;
int n = clip->getWorldVerticesLength(); int n = (int)clip->getWorldVerticesLength();
_clippingPolygon.setSize(n, 0); _clippingPolygon.setSize(n, 0);
clip->computeWorldVertices(slot, 0, n, _clippingPolygon, 0, 2); clip->computeWorldVertices(slot, 0, n, _clippingPolygon, 0, 2);
makeClockwise(_clippingPolygon); makeClockwise(_clippingPolygon);
@ -107,15 +103,15 @@ void SkeletonClipping::clipTriangles(float *vertices, unsigned short *triangles,
size_t i = 0; size_t i = 0;
continue_outer: continue_outer:
for (; i < trianglesLength; i += 3) { for (; i < trianglesLength; i += 3) {
int vertexOffset = triangles[i] * stride; int vertexOffset = triangles[i] * (int)stride;
float x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; float x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];
float u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; float u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];
vertexOffset = triangles[i + 1] * stride; vertexOffset = triangles[i + 1] * (int)stride;
float x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; float x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];
float u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; float u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];
vertexOffset = triangles[i + 2] * stride; vertexOffset = triangles[i + 2] * (int)stride;
float x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; float x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];
float u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; float u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];
@ -318,7 +314,7 @@ void SkeletonClipping::makeClockwise(Vector<float> &polygon) {
for (size_t i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { for (size_t i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {
float x = polygon[i], y = polygon[i + 1]; float x = polygon[i], y = polygon[i + 1];
int other = lastX - i; int other = (int)(lastX - i);
polygon[i] = polygon[other]; polygon[i] = polygon[other];
polygon[i + 1] = polygon[other + 1]; polygon[i + 1] = polygon[other + 1];
polygon[other] = x; polygon[other] = x;

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/SkeletonData.h> #include <spine/SkeletonData.h>
#include <spine/Animation.h> #include <spine/Animation.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/SkeletonJson.h> #include <spine/SkeletonJson.h>
#include <spine/Atlas.h> #include <spine/Atlas.h>
@ -715,7 +711,7 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) {
} }
/* Linked meshes. */ /* Linked meshes. */
int n = _linkedMeshes.size(); int n = (int)_linkedMeshes.size();
for (i = 0; i < n; ++i) { for (i = 0; i < n; ++i) {
LinkedMesh *linkedMesh = _linkedMeshes[i]; LinkedMesh *linkedMesh = _linkedMeshes[i];
Skin *skin = linkedMesh->_skin.length() == 0 ? skeletonData->getDefaultSkin() : skeletonData->findSkin(linkedMesh->_skin); Skin *skin = linkedMesh->_skin.length() == 0 ? skeletonData->getDefaultSkin() : skeletonData->findSkin(linkedMesh->_skin);
@ -1280,7 +1276,7 @@ Animation *SkeletonJson::readAnimation(Json *root, SkeletonData *skeletonData) {
VertexAttachment *vertexAttachment = static_cast<VertexAttachment *>(attachment); VertexAttachment *vertexAttachment = static_cast<VertexAttachment *>(attachment);
bool weighted = vertexAttachment->_bones.size() != 0; bool weighted = vertexAttachment->_bones.size() != 0;
Vector<float> &verts = vertexAttachment->_vertices; Vector<float> &verts = vertexAttachment->_vertices;
int deformLength = weighted ? verts.size() / 3 * 2 : verts.size(); int deformLength = weighted ? (int)verts.size() / 3 * 2 : (int)verts.size();
DeformTimeline *timeline = new (__FILE__, __LINE__) DeformTimeline(frames, DeformTimeline *timeline = new (__FILE__, __LINE__) DeformTimeline(frames,
frames, slotIndex, vertexAttachment); frames, slotIndex, vertexAttachment);
@ -1380,14 +1376,14 @@ Animation *SkeletonJson::readAnimation(Json *root, SkeletonData *skeletonData) {
/* Collect unchanged items. */ /* Collect unchanged items. */
while (originalIndex != (size_t) slotIndex) while (originalIndex != (size_t) slotIndex)
unchanged[unchangedIndex++] = originalIndex++; unchanged[unchangedIndex++] = (int)originalIndex++;
/* Set changed items. */ /* Set changed items. */
drawOrder2[originalIndex + Json::getInt(offsetMap, "offset", 0)] = originalIndex; drawOrder2[originalIndex + Json::getInt(offsetMap, "offset", 0)] = (int)originalIndex;
originalIndex++; originalIndex++;
} }
/* Collect remaining unchanged items. */ /* Collect remaining unchanged items. */
while (originalIndex < skeletonData->_slots.size()) while (originalIndex < (int)skeletonData->_slots.size())
unchanged[unchangedIndex++] = originalIndex++; unchanged[unchangedIndex++] = (int)originalIndex++;
/* Fill in unchanged items. */ /* Fill in unchanged items. */
for (ii = (int) skeletonData->_slots.size() - 1; ii >= 0; ii--) for (ii = (int) skeletonData->_slots.size() - 1; ii >= 0; ii--)
if (drawOrder2[ii] == -1) drawOrder2[ii] = unchanged[--unchangedIndex]; if (drawOrder2[ii] == -1) drawOrder2[ii] = unchanged[--unchangedIndex];

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>
@ -84,7 +80,7 @@ void Skin::AttachmentMap::remove(size_t slotIndex, const String &attachmentName)
int Skin::AttachmentMap::findInBucket(Vector<Entry> &bucket, const String &attachmentName) { int Skin::AttachmentMap::findInBucket(Vector<Entry> &bucket, const String &attachmentName) {
for (size_t i = 0; i < bucket.size(); i++) for (size_t i = 0; i < bucket.size(); i++)
if (bucket[i]._name == attachmentName) return i; if (bucket[i]._name == attachmentName) return (int)i;
return -1; return -1;
} }
@ -148,7 +144,7 @@ void Skin::attachAll(Skeleton &skeleton, Skin &oldSkin) {
Skin::AttachmentMap::Entries entries = oldSkin.getAttachments(); Skin::AttachmentMap::Entries entries = oldSkin.getAttachments();
while (entries.hasNext()) { while (entries.hasNext()) {
Skin::AttachmentMap::Entry &entry = entries.next(); Skin::AttachmentMap::Entry &entry = entries.next();
int slotIndex = entry._slotIndex; int slotIndex = (int)entry._slotIndex;
Slot *slot = slots[slotIndex]; Slot *slot = slots[slotIndex];
if (slot->getAttachment() == entry._attachment) { if (slot->getAttachment() == entry._attachment) {

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/Slot.h> #include <spine/Slot.h>
#include <spine/Attachment.h> #include <spine/Attachment.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>

View File

@ -27,12 +27,8 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/Extension.h>
#include <spine/SpineObject.h> #include <spine/SpineObject.h>
#include <spine/Extension.h>
using namespace spine; using namespace spine;

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/TextureLoader.h> #include <spine/TextureLoader.h>
namespace spine { namespace spine {

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/Timeline.h> #include <spine/Timeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/TransformConstraint.h> #include <spine/TransformConstraint.h>
#include <spine/Bone.h> #include <spine/Bone.h>
@ -82,7 +78,7 @@ void TransformConstraint::update() {
} }
int TransformConstraint::getOrder() { int TransformConstraint::getOrder() {
return _data.getOrder(); return (int)_data.getOrder();
} }
TransformConstraintData &TransformConstraint::getData() { TransformConstraintData &TransformConstraint::getData() {

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/TransformConstraintTimeline.h> #include <spine/TransformConstraintTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/TranslateTimeline.h> #include <spine/TranslateTimeline.h>
#include <spine/Event.h> #include <spine/Event.h>

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>
@ -49,15 +45,15 @@ Vector<int> &Triangulator::triangulate(Vector<float> &vertices) {
indices.clear(); indices.clear();
indices.ensureCapacity(vertexCount); indices.ensureCapacity(vertexCount);
indices.setSize(vertexCount, 0); indices.setSize(vertexCount, 0);
for (size_t i = 0; i < vertexCount; ++i) { for (int i = 0; i < vertexCount; ++i) {
indices[i] = i; indices[i] = i;
} }
Vector<bool> &isConcaveArray = _isConcaveArray; Vector<bool> &isConcaveArray = _isConcaveArray;
isConcaveArray.ensureCapacity(vertexCount); isConcaveArray.ensureCapacity(vertexCount);
isConcaveArray.setSize(vertexCount, 0); isConcaveArray.setSize(vertexCount, 0);
for (size_t i = 0, n = vertexCount; i < n; ++i) { for (int i = 0, n = (int)vertexCount; i < n; ++i) {
isConcaveArray[i] = isConcave(i, vertexCount, vertices, indices); isConcaveArray[i] = isConcave(i, (int)vertexCount, vertices, indices);
} }
Vector<int> &triangles = _triangles; Vector<int> &triangles = _triangles;
@ -113,10 +109,10 @@ Vector<int> &Triangulator::triangulate(Vector<float> &vertices) {
isConcaveArray.removeAt(i); isConcaveArray.removeAt(i);
vertexCount--; vertexCount--;
int previousIndex = (vertexCount + i - 1) % vertexCount; int previousIndex = (int)((vertexCount + i - 1) % vertexCount);
int nextIndex = i == vertexCount ? 0 : i; int nextIndex = (int)(i == vertexCount ? 0 : i);
isConcaveArray[previousIndex] = isConcave(previousIndex, vertexCount, vertices, indices); isConcaveArray[previousIndex] = isConcave(previousIndex, (int)vertexCount, vertices, indices);
isConcaveArray[nextIndex] = isConcave(nextIndex, vertexCount, vertices, indices); isConcaveArray[nextIndex] = isConcave(nextIndex, (int)vertexCount, vertices, indices);
} }
if (vertexCount == 3) { if (vertexCount == 3) {

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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;

View File

@ -27,10 +27,6 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE 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>
@ -87,7 +83,7 @@ void VertexAttachment::computeWorldVertices(Slot &slot, size_t start, size_t cou
int v = 0, skip = 0; int v = 0, skip = 0;
for (size_t i = 0; i < start; i += 2) { for (size_t i = 0; i < start; i += 2) {
int n = bones[v]; int n = (int)bones[v];
v += n + 1; v += n + 1;
skip += n; skip += n;
} }
@ -96,7 +92,7 @@ void VertexAttachment::computeWorldVertices(Slot &slot, size_t start, size_t cou
if (deformArray->size() == 0) { if (deformArray->size() == 0) {
for (size_t w = offset, b = skip * 3; w < count; w += stride) { for (size_t w = offset, b = skip * 3; w < count; w += stride) {
float wx = 0, wy = 0; float wx = 0, wy = 0;
int n = bones[v++]; int n = (int)bones[v++];
n += v; n += v;
for (; v < n; v++, b += 3) { for (; v < n; v++, b += 3) {
Bone *boneP = skeletonBones[bones[v]]; Bone *boneP = skeletonBones[bones[v]];
@ -113,7 +109,7 @@ void VertexAttachment::computeWorldVertices(Slot &slot, size_t start, size_t cou
} else { } else {
for (size_t w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { for (size_t w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {
float wx = 0, wy = 0; float wx = 0, wy = 0;
int n = bones[v++]; int n = (int)bones[v++];
n += v; n += v;
for (; v < n; v++, b += 3, f += 2) { for (; v < n; v++, b += 3, f += 2) {
Bone *boneP = skeletonBones[bones[v]]; Bone *boneP = skeletonBones[bones[v]];

View File

@ -27,13 +27,9 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#ifdef SPINE_UE4 #include <spine/VertexEffect.h>
#include "SpinePluginPrivatePCH.h"
#endif
#include <spine/MathUtil.h> #include <spine/MathUtil.h>
#include <spine/Skeleton.h> #include <spine/Skeleton.h>
#include <spine/VertexEffect.h>
using namespace spine; using namespace spine;

View File

@ -69,4 +69,5 @@ r.DefaultFeature.AmbientOcclusionStaticFraction=False
r.DefaultFeature.AutoExposure=False r.DefaultFeature.AutoExposure=False
r.UsePreExposure=False r.UsePreExposure=False
r.DefaultFeature.MotionBlur=False r.DefaultFeature.MotionBlur=False
r.TextureStreaming=False

View File

@ -27,18 +27,12 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include "SpineEditorPluginPrivatePCH.h" #include "SpineAtlasImportFactory.h"
#include "AssetRegistryModule.h" #include "AssetRegistryModule.h"
#include "AssetToolsModule.h" #include "AssetToolsModule.h"
#include "Developer/AssetTools/Public/IAssetTools.h" #include "Developer/AssetTools/Public/IAssetTools.h"
#include "Developer/DesktopPlatform/Public/DesktopPlatformModule.h"
#include "Developer/DesktopPlatform/Public/IDesktopPlatform.h"
#include "PackageTools.h" #include "PackageTools.h"
#include "SpineAtlasAsset.h" #include "SpineAtlasAsset.h"
#include <stdlib.h>
#include <string.h>
#include <string>
#define LOCTEXT_NAMESPACE "Spine" #define LOCTEXT_NAMESPACE "Spine"

View File

@ -27,9 +27,7 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include "SpineEditorPluginPrivatePCH.h" #include "SpineEditorPlugin.h"
#include "spine/spine.h"
class FSpineEditorPlugin : public ISpineEditorPlugin { class FSpineEditorPlugin : public ISpineEditorPlugin {
virtual void StartupModule() override; virtual void StartupModule() override;

View File

@ -1,33 +0,0 @@
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated September 24, 2021. Replaces all prior versions.
*
* Copyright (c) 2013-2021, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#include "SpineAtlasImportFactory.h"
#include "SpineEditorPlugin.h"
#include "SpinePlugin.h"
#include "SpineSkeletonImportFactory.h"

View File

@ -27,18 +27,11 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include "SpineEditorPluginPrivatePCH.h" #include "SpineSkeletonImportFactory.h"
#include "AssetRegistryModule.h"
#include "AssetToolsModule.h" #include "AssetToolsModule.h"
#include "Developer/AssetTools/Public/IAssetTools.h" #include "Developer/AssetTools/Public/IAssetTools.h"
#include "Developer/DesktopPlatform/Public/DesktopPlatformModule.h"
#include "Developer/DesktopPlatform/Public/IDesktopPlatform.h"
#include "PackageTools.h"
#include "SpineSkeletonDataAsset.h" #include "SpineSkeletonDataAsset.h"
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <string>
#define LOCTEXT_NAMESPACE "Spine" #define LOCTEXT_NAMESPACE "Spine"

View File

@ -1,17 +1,12 @@
using System;
using System.IO; using System.IO;
namespace UnrealBuildTool.Rules namespace UnrealBuildTool.Rules
{ {
public class SpineEditorPlugin : ModuleRules public class SpineEditorPlugin : ModuleRules
{ {
public SpineEditorPlugin(ReadOnlyTargetRules Target) : base(Target) public SpineEditorPlugin(ReadOnlyTargetRules target) : base(target)
{ {
PrivatePCHHeaderFile = "Private/SpineEditorPluginPrivatePCH.h"; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PCHUsage = PCHUsageMode.UseSharedPCHs;
#if UE_4_24_OR_LATER
DefaultBuildSettings = BuildSettingsVersion.V1;
#endif
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public")); PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public"));
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "../SpinePlugin/Public/spine-cpp/include")); PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "../SpinePlugin/Public/spine-cpp/include"));
@ -19,7 +14,7 @@ namespace UnrealBuildTool.Rules
PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private")); PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private"));
PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "../SpinePlugin/Public/spine-cpp/include")); PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "../SpinePlugin/Public/spine-cpp/include"));
PublicDependencyModuleNames.AddRange(new string[] { PublicDependencyModuleNames.AddRange(new [] {
"Core", "Core",
"CoreUObject", "CoreUObject",
"Engine", "Engine",
@ -27,12 +22,12 @@ namespace UnrealBuildTool.Rules
"SpinePlugin" "SpinePlugin"
}); });
PublicIncludePathModuleNames.AddRange(new string[] { PublicIncludePathModuleNames.AddRange(new [] {
"AssetTools", "AssetTools",
"AssetRegistry" "AssetRegistry"
}); });
DynamicallyLoadedModuleNames.AddRange(new string[] { DynamicallyLoadedModuleNames.AddRange(new [] {
"AssetTools", "AssetTools",
"AssetRegistry" "AssetRegistry"
}); });

View File

@ -27,18 +27,14 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include "SpinePluginPrivatePCH.h" #include "SSpineWidget.h"
#include "Framework/Application/SlateApplication.h" #include "Framework/Application/SlateApplication.h"
#include "Materials/MaterialInstanceDynamic.h" #include "Materials/MaterialInstanceDynamic.h"
#include "Materials/MaterialInterface.h" #include "Materials/MaterialInterface.h"
#include "Modules/ModuleManager.h"
#include "Rendering/DrawElements.h" #include "Rendering/DrawElements.h"
#include "Runtime/SlateRHIRenderer/Public/Interfaces/ISlateRHIRendererModule.h" #include "Runtime/SlateRHIRenderer/Public/Interfaces/ISlateRHIRendererModule.h"
#include "SSpineWidget.h"
#include "Slate/SMeshWidget.h" #include "Slate/SMeshWidget.h"
#include "Slate/SlateVectorArtData.h" #include "Slate/SlateVectorArtData.h"
#include "Slate/SlateVectorArtInstanceData.h"
#include "SlateMaterialBrush.h" #include "SlateMaterialBrush.h"
#include "SpineWidget.h" #include "SpineWidget.h"
#include <spine/spine.h> #include <spine/spine.h>

View File

@ -27,12 +27,13 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include "SpinePluginPrivatePCH.h" #include "SpineAtlasAsset.h"
#include "spine/spine.h" #include "spine/spine.h"
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <string> #include <string>
#include "EditorFramework/AssetImportData.h"
#define LOCTEXT_NAMESPACE "Spine" #define LOCTEXT_NAMESPACE "Spine"
using namespace spine; using namespace spine;

View File

@ -27,7 +27,9 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include "SpinePluginPrivatePCH.h" #include "SpineBoneDriverComponent.h"
#include "SpineSkeletonComponent.h"
#include "GameFramework/Actor.h"
USpineBoneDriverComponent::USpineBoneDriverComponent() { USpineBoneDriverComponent::USpineBoneDriverComponent() {
PrimaryComponentTick.bCanEverTick = true; PrimaryComponentTick.bCanEverTick = true;

View File

@ -27,7 +27,9 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include "SpinePluginPrivatePCH.h" #include "SpineBoneFollowerComponent.h"
#include "SpineSkeletonComponent.h"
#include "GameFramework/Actor.h"
USpineBoneFollowerComponent::USpineBoneFollowerComponent() { USpineBoneFollowerComponent::USpineBoneFollowerComponent() {
PrimaryComponentTick.bCanEverTick = true; PrimaryComponentTick.bCanEverTick = true;

View File

@ -27,7 +27,7 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include "SpinePluginPrivatePCH.h" #include "SpinePlugin.h"
#include "spine/Extension.h" #include "spine/Extension.h"
DEFINE_LOG_CATEGORY(SpineLog); DEFINE_LOG_CATEGORY(SpineLog);

View File

@ -1,38 +0,0 @@
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated September 24, 2021. Replaces all prior versions.
*
* Copyright (c) 2013-2021, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#include "SpineAtlasAsset.h"
#include "SpineBoneDriverComponent.h"
#include "SpineBoneFollowerComponent.h"
#include "SpinePlugin.h"
#include "SpineSkeletonAnimationComponent.h"
#include "SpineSkeletonComponent.h"
#include "SpineSkeletonDataAsset.h"
#include "SpineSkeletonRendererComponent.h"
#include "SpineWidget.h"

View File

@ -27,7 +27,8 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include "SpinePluginPrivatePCH.h" #include "SpineSkeletonAnimationComponent.h"
#include "SpineAtlasAsset.h"
#define LOCTEXT_NAMESPACE "Spine" #define LOCTEXT_NAMESPACE "Spine"

View File

@ -27,7 +27,9 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include "SpinePluginPrivatePCH.h" #include "SpineSkeletonComponent.h"
#include "SpineSkeletonRendererComponent.h"
#include "SpineAtlasAsset.h"
#include "spine/spine.h" #include "spine/spine.h"

View File

@ -27,12 +27,12 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include "SpineSkeletonDataAsset.h"
#include "SpinePlugin.h"
#include "Runtime/Core/Public/Misc/MessageDialog.h" #include "Runtime/Core/Public/Misc/MessageDialog.h"
#include "SpinePluginPrivatePCH.h" #include "EditorFramework/AssetImportData.h"
#include "spine/spine.h" #include "spine/spine.h"
#include "spine/Version.h" #include "spine/Version.h"
#include <stdlib.h>
#include <string.h>
#include <string> #include <string>
#define LOCTEXT_NAMESPACE "Spine" #define LOCTEXT_NAMESPACE "Spine"

View File

@ -27,10 +27,12 @@
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/ *****************************************************************************/
#include "Engine.h" #include "SpineSkeletonRendererComponent.h"
#include "SpinePluginPrivatePCH.h"
#include "SpineAtlasAsset.h"
#include "Materials/MaterialInstanceDynamic.h"
#include "spine/spine.h" #include "spine/spine.h"
#include <stdlib.h> #include "UObject/ConstructorHelpers.h"
#define LOCTEXT_NAMESPACE "Spine" #define LOCTEXT_NAMESPACE "Spine"

View File

@ -28,9 +28,8 @@
*****************************************************************************/ *****************************************************************************/
#include "SpineWidget.h" #include "SpineWidget.h"
#include "Engine.h"
#include "SSpineWidget.h" #include "SSpineWidget.h"
#include "SpinePluginPrivatePCH.h" #include "SpineSkeletonAnimationComponent.h"
#include "spine/spine.h" #include "spine/spine.h"
#define LOCTEXT_NAMESPACE "Spine" #define LOCTEXT_NAMESPACE "Spine"
@ -249,7 +248,7 @@ void USpineWidget::GetSkins(TArray<FString> &Skins) {
bool USpineWidget::HasSkin(const FString skinName) { bool USpineWidget::HasSkin(const FString skinName) {
CheckState(); CheckState();
if (skeleton) { if (skeleton) {
return skeleton->getData()->findAnimation(TCHAR_TO_UTF8(*skinName)) != nullptr; return skeleton->getData()->findSkin(TCHAR_TO_UTF8(*skinName)) != nullptr;
} }
return false; return false;
} }
@ -257,6 +256,10 @@ bool USpineWidget::HasSkin(const FString skinName) {
bool USpineWidget::SetAttachment(const FString slotName, const FString attachmentName) { bool USpineWidget::SetAttachment(const FString slotName, const FString attachmentName) {
CheckState(); CheckState();
if (skeleton) { if (skeleton) {
if (attachmentName.IsEmpty()) {
skeleton->setAttachment(TCHAR_TO_UTF8(*slotName), NULL);
return true;
}
if (!skeleton->getAttachment(TCHAR_TO_UTF8(*slotName), TCHAR_TO_UTF8(*attachmentName))) return false; if (!skeleton->getAttachment(TCHAR_TO_UTF8(*slotName), TCHAR_TO_UTF8(*attachmentName))) return false;
skeleton->setAttachment(TCHAR_TO_UTF8(*slotName), TCHAR_TO_UTF8(*attachmentName)); skeleton->setAttachment(TCHAR_TO_UTF8(*slotName), TCHAR_TO_UTF8(*attachmentName));
return true; return true;

View File

@ -30,7 +30,7 @@
#pragma once #pragma once
// clang-format off // clang-format off
#include "Engine.h" #include "Engine/Texture2D.h"
#include "spine/spine.h" #include "spine/spine.h"
#include "SpineAtlasAsset.generated.h" #include "SpineAtlasAsset.generated.h"
// clang-format on // clang-format on

View File

@ -30,6 +30,7 @@
#pragma once #pragma once
#include "Components/ActorComponent.h" #include "Components/ActorComponent.h"
#include "Components/SceneComponent.h"
#include "SpineBoneFollowerComponent.generated.h" #include "SpineBoneFollowerComponent.generated.h"

View File

@ -30,7 +30,6 @@
#pragma once #pragma once
// clang-format off // clang-format off
#include "Engine.h"
#include "spine/spine.h" #include "spine/spine.h"
#include "SpineSkeletonDataAsset.generated.h" #include "SpineSkeletonDataAsset.generated.h"
// clang-format on // clang-format on

View File

@ -31,13 +31,14 @@
// clang-format off // clang-format off
#include "Runtime/UMG/Public/UMG.h" #include "Runtime/UMG/Public/UMG.h"
#include "Runtime/UMG/Public/UMGStyle.h"
#include "SpineSkeletonDataAsset.h" #include "SpineSkeletonDataAsset.h"
#include "SpineSkeletonAnimationComponent.h"
#include "spine/spine.h" #include "spine/spine.h"
#include "SpineWidget.generated.h" #include "SpineWidget.generated.h"
// clang-format on // clang-format on
class SSpineWidget; class SSpineWidget;
class USpineWidget;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSpineWidgetBeforeUpdateWorldTransformDelegate, USpineWidget *, skeleton); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSpineWidgetBeforeUpdateWorldTransformDelegate, USpineWidget *, skeleton);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSpineWidgetAfterUpdateWorldTransformDelegate, USpineWidget *, skeleton); DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSpineWidgetAfterUpdateWorldTransformDelegate, USpineWidget *, skeleton);

View File

@ -5,13 +5,9 @@ namespace UnrealBuildTool.Rules
{ {
public class SpinePlugin : ModuleRules public class SpinePlugin : ModuleRules
{ {
public SpinePlugin(ReadOnlyTargetRules Target) : base(Target) public SpinePlugin(ReadOnlyTargetRules target) : base(target)
{ {
PrivatePCHHeaderFile = "Private/SpinePluginPrivatePCH.h"; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PCHUsage = PCHUsageMode.UseSharedPCHs;
#if UE_4_24_OR_LATER
DefaultBuildSettings = BuildSettingsVersion.V1;
#endif
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public")); PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public"));
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public/spine-cpp/include")); PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public/spine-cpp/include"));
@ -20,7 +16,6 @@ namespace UnrealBuildTool.Rules
PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Public/spine-cpp/include")); PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Public/spine-cpp/include"));
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "ProceduralMeshComponent", "UMG", "Slate", "SlateCore" }); PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "ProceduralMeshComponent", "UMG", "Slate", "SlateCore" });
PublicDefinitions.Add("SPINE_UE4");
} }
} }
} }

View File

@ -7,6 +7,7 @@ public class SpineUE4Target : TargetRules
{ {
public SpineUE4Target(TargetInfo Target) : base(Target) public SpineUE4Target(TargetInfo Target) : base(Target)
{ {
DefaultBuildSettings = BuildSettingsVersion.V2;
Type = TargetType.Game; Type = TargetType.Game;
ExtraModuleNames.AddRange(new string[] { "SpineUE4" }); ExtraModuleNames.AddRange(new string[] { "SpineUE4" });
} }

View File

@ -1,12 +1,10 @@
// Fill out your copyright notice in the Description page of Project Settings.
using UnrealBuildTool; using UnrealBuildTool;
using System.Collections.Generic;
public class SpineUE4EditorTarget : TargetRules public class SpineUE4EditorTarget : TargetRules
{ {
public SpineUE4EditorTarget(TargetInfo Target) : base(Target) public SpineUE4EditorTarget(TargetInfo target) : base(target)
{ {
DefaultBuildSettings = BuildSettingsVersion.V2;
Type = TargetType.Editor; Type = TargetType.Editor;
ExtraModuleNames.AddRange(new string[] { "SpineUE4" }); ExtraModuleNames.AddRange(new string[] { "SpineUE4" });
} }