Merge branch '4.2' into spine-android
@ -165,6 +165,7 @@
|
||||
- SkeletonGraphic Materials: Since the addition of new material sets for the `CanvasGroupCompatible` parameters, the default SkeletonGraphic materials all have `CanvasGroup Compatible` disabled. Please assign the respective material from the `CanvasGroupCompatible` material subdirectory if you want `CanvasGroup Compatible` enabled at your SkeletonGraphic.
|
||||
- SkeletonGraphic: The parameter `SkeletonGraphic.MeshGenerator.settings.canvasGroupTintBlack` was changed to `canvasGroupCompatible` to help with auto-detecting correct Vertex Data and Material settings. Set the parameter to true if the SkeletonGraphic component is located below a `CanvasGroup` component. The parameter value is automatically migrated from `canvasGroupTintBlack`.
|
||||
- Inspector: String attribute `SpineSkin()` now allows to include `<None>` in the list of parameters. Previously the `includeNone=true` parameter of the `SpineSkin()` attribute defaulted to `true` but was ignored. Now it defaults to `false` and has an effect on the list. Only the Inspector GUI is affected by this behaviour change.
|
||||
- `SkeletonGraphicRenderTexture` example component: `protected RawImage quadRawImage` was changed to `protected SkeletonSubmeshGraphic quadMaskableGraphic` for a bugfix. This is only relevant for subclasses of `SkeletonGraphicRenderTexture` or when querying the `RawImage` component via e.g. `skeletonGraphicRenderTexture.quad.GetComponent<RawImage>()`.
|
||||
|
||||
- **Changes of default values**
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 369 KiB After Width: | Height: | Size: 379 KiB |
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 351 KiB |
BIN
examples/mix-and-match/mix-and-match-pro.spine
Executable file → Normal file
@ -161,7 +161,12 @@ void spBone_updateWorldTransformWith(spBone *self, float x, float y, float rotat
|
||||
float za = (pa * cosine + pb * sine) / sx;
|
||||
float zc = (pc * cosine + pd * sine) / sy;
|
||||
float s = SQRT(za * za + zc * zc);
|
||||
if (self->data->inherit == SP_INHERIT_NOSCALE && (pa * pd - pb * pc < 0) != (sx < 0 != sy < 0))
|
||||
if (s > 0.00001f) s = 1 / s;
|
||||
za *= s;
|
||||
zc *= s;
|
||||
s = SQRT(za * za + zc * zc);
|
||||
if (self->inherit == SP_INHERIT_NOSCALE &&
|
||||
(pa * pd - pb * pc < 0) != (sx < 0 != sy < 0))
|
||||
s = -s;
|
||||
rotation = PI / 2 + ATAN2(zc, za);
|
||||
float zb = COS(rotation) * s;
|
||||
|
||||
@ -1369,6 +1369,8 @@ spSkeletonData *spSkeletonBinary_readSkeletonData(spSkeletonBinary *self, const
|
||||
skeletonData->version = 0;
|
||||
} else {
|
||||
if (!string_starts_with(skeletonData->version, SPINE_VERSION_STRING)) {
|
||||
FREE(input);
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
char errorMsg[255];
|
||||
snprintf(errorMsg, 255, "Skeleton version %s does not match runtime version %s", skeletonData->version, SPINE_VERSION_STRING);
|
||||
_spSkeletonBinary_setError(self, errorMsg, NULL);
|
||||
@ -1596,6 +1598,8 @@ spSkeletonData *spSkeletonBinary_readSkeletonData(spSkeletonBinary *self, const
|
||||
/* Default skin. */
|
||||
skeletonData->defaultSkin = spSkeletonBinary_readSkin(self, input, -1, skeletonData, nonessential);
|
||||
if (self->attachmentLoader->error1) {
|
||||
FREE(input);
|
||||
spSkin_dispose(skeletonData->defaultSkin);
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonBinary_setError(self, self->attachmentLoader->error1, self->attachmentLoader->error2);
|
||||
return NULL;
|
||||
@ -1614,6 +1618,8 @@ spSkeletonData *spSkeletonBinary_readSkeletonData(spSkeletonBinary *self, const
|
||||
for (i = skeletonData->defaultSkin ? 1 : 0; i < skeletonData->skinsCount; ++i) {
|
||||
spSkin *skin = spSkeletonBinary_readSkin(self, input, 0, skeletonData, nonessential);
|
||||
if (self->attachmentLoader->error1) {
|
||||
FREE(input);
|
||||
skeletonData->skinsCount = i + 1;
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonBinary_setError(self, self->attachmentLoader->error1, self->attachmentLoader->error2);
|
||||
return NULL;
|
||||
@ -1672,6 +1678,7 @@ spSkeletonData *spSkeletonBinary_readSkeletonData(spSkeletonBinary *self, const
|
||||
FREE(name);
|
||||
if (!animation) {
|
||||
FREE(input);
|
||||
skeletonData->animationsCount = i + 1;
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonBinary_setError(self, "Animation corrupted: ", name);
|
||||
return NULL;
|
||||
|
||||
@ -1177,7 +1177,6 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
slots = Json_getItem(root, "slots");
|
||||
if (slots) {
|
||||
Json *slotMap;
|
||||
skeletonData->slotsCount = slots->size;
|
||||
skeletonData->slots = MALLOC(spSlotData *, slots->size);
|
||||
for (slotMap = slots->child, i = 0; slotMap; slotMap = slotMap->next, ++i) {
|
||||
spSlotData *data;
|
||||
@ -1237,6 +1236,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
data->visible = Json_getInt(slotMap, "visible", -1);
|
||||
data->path = pathName;
|
||||
skeletonData->slots[i] = data;
|
||||
skeletonData->slotsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1244,7 +1244,6 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
ik = Json_getItem(root, "ik");
|
||||
if (ik) {
|
||||
Json *constraintMap;
|
||||
skeletonData->ikConstraintsCount = ik->size;
|
||||
skeletonData->ikConstraints = MALLOC(spIkConstraintData *, ik->size);
|
||||
for (constraintMap = ik->child, i = 0; constraintMap; constraintMap = constraintMap->next, ++i) {
|
||||
const char *targetName;
|
||||
@ -1259,6 +1258,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
for (boneMap = boneMap->child, ii = 0; boneMap; boneMap = boneMap->next, ++ii) {
|
||||
data->bones[ii] = spSkeletonData_findBone(skeletonData, boneMap->valueString);
|
||||
if (!data->bones[ii]) {
|
||||
spIkConstraintData_dispose(data);
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonJson_setError(self, root, "IK bone not found: ", boneMap->valueString);
|
||||
return NULL;
|
||||
@ -1268,6 +1268,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
targetName = Json_getString(constraintMap, "target", 0);
|
||||
data->target = spSkeletonData_findBone(skeletonData, targetName);
|
||||
if (!data->target) {
|
||||
spIkConstraintData_dispose(data);
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonJson_setError(self, root, "Target bone not found: ", targetName);
|
||||
return NULL;
|
||||
@ -1281,6 +1282,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
data->softness = Json_getFloat(constraintMap, "softness", 0) * self->scale;
|
||||
|
||||
skeletonData->ikConstraints[i] = data;
|
||||
skeletonData->ikConstraintsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1288,7 +1290,6 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
transform = Json_getItem(root, "transform");
|
||||
if (transform) {
|
||||
Json *constraintMap;
|
||||
skeletonData->transformConstraintsCount = transform->size;
|
||||
skeletonData->transformConstraints = MALLOC(spTransformConstraintData *, transform->size);
|
||||
for (constraintMap = transform->child, i = 0; constraintMap; constraintMap = constraintMap->next, ++i) {
|
||||
const char *name;
|
||||
@ -1304,6 +1305,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
for (boneMap = boneMap->child, ii = 0; boneMap; boneMap = boneMap->next, ++ii) {
|
||||
data->bones[ii] = spSkeletonData_findBone(skeletonData, boneMap->valueString);
|
||||
if (!data->bones[ii]) {
|
||||
spTransformConstraintData_dispose(data);
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonJson_setError(self, root, "Transform bone not found: ", boneMap->valueString);
|
||||
return NULL;
|
||||
@ -1313,6 +1315,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
name = Json_getString(constraintMap, "target", 0);
|
||||
data->target = spSkeletonData_findBone(skeletonData, name);
|
||||
if (!data->target) {
|
||||
spTransformConstraintData_dispose(data);
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonJson_setError(self, root, "Target bone not found: ", name);
|
||||
return NULL;
|
||||
@ -1335,6 +1338,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
data->mixShearY = Json_getFloat(constraintMap, "mixShearY", 1);
|
||||
|
||||
skeletonData->transformConstraints[i] = data;
|
||||
skeletonData->transformConstraintsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1342,7 +1346,6 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
pathJson = Json_getItem(root, "path");
|
||||
if (pathJson) {
|
||||
Json *constraintMap;
|
||||
skeletonData->pathConstraintsCount = pathJson->size;
|
||||
skeletonData->pathConstraints = MALLOC(spPathConstraintData *, pathJson->size);
|
||||
for (constraintMap = pathJson->child, i = 0; constraintMap; constraintMap = constraintMap->next, ++i) {
|
||||
const char *name;
|
||||
@ -1358,6 +1361,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
for (boneMap = boneMap->child, ii = 0; boneMap; boneMap = boneMap->next, ++ii) {
|
||||
data->bones[ii] = spSkeletonData_findBone(skeletonData, boneMap->valueString);
|
||||
if (!data->bones[ii]) {
|
||||
spPathConstraintData_dispose(data);
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonJson_setError(self, root, "Path bone not found: ", boneMap->valueString);
|
||||
return NULL;
|
||||
@ -1367,6 +1371,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
name = Json_getString(constraintMap, "target", 0);
|
||||
data->target = spSkeletonData_findSlot(skeletonData, name);
|
||||
if (!data->target) {
|
||||
spPathConstraintData_dispose(data);
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonJson_setError(self, root, "Target slot not found: ", name);
|
||||
return NULL;
|
||||
@ -1404,6 +1409,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
data->mixY = Json_getFloat(constraintMap, "mixY", data->mixX);
|
||||
|
||||
skeletonData->pathConstraints[i] = data;
|
||||
skeletonData->pathConstraintsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1471,6 +1477,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
for (skinPart = skinPart->child; skinPart; skinPart = skinPart->next) {
|
||||
spBoneData *bone = spSkeletonData_findBone(skeletonData, skinPart->valueString);
|
||||
if (!bone) {
|
||||
spSkin_dispose(skin);
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonJson_setError(self, root, "Skin bone constraint not found: ", skinPart->valueString);
|
||||
return NULL;
|
||||
@ -1485,6 +1492,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
spIkConstraintData *constraint = spSkeletonData_findIkConstraint(skeletonData,
|
||||
skinPart->valueString);
|
||||
if (!constraint) {
|
||||
spSkin_dispose(skin);
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonJson_setError(self, root, "Skin IK constraint not found: ", skinPart->valueString);
|
||||
return NULL;
|
||||
@ -1499,6 +1507,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
spPathConstraintData *constraint = spSkeletonData_findPathConstraint(skeletonData,
|
||||
skinPart->valueString);
|
||||
if (!constraint) {
|
||||
spSkin_dispose(skin);
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonJson_setError(self, root, "Skin path constraint not found: ", skinPart->valueString);
|
||||
return NULL;
|
||||
@ -1513,6 +1522,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
spTransformConstraintData *constraint = spSkeletonData_findTransformConstraint(skeletonData,
|
||||
skinPart->valueString);
|
||||
if (!constraint) {
|
||||
spSkin_dispose(skin);
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonJson_setError(self, root, "Skin transform constraint not found: ",
|
||||
skinPart->valueString);
|
||||
@ -1766,13 +1776,13 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
spSkin *skin = !linkedMesh->skin ? skeletonData->defaultSkin : spSkeletonData_findSkin(skeletonData, linkedMesh->skin);
|
||||
if (!skin) {
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonJson_setError(self, 0, "Skin not found: ", linkedMesh->skin);
|
||||
_spSkeletonJson_setError(self, root, "Skin not found: ", linkedMesh->skin);
|
||||
return NULL;
|
||||
}
|
||||
parent = spSkin_getAttachment(skin, linkedMesh->slotIndex, linkedMesh->parent);
|
||||
if (!parent) {
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonJson_setError(self, 0, "Parent mesh not found: ", linkedMesh->parent);
|
||||
_spSkeletonJson_setError(self, root, "Parent mesh not found: ", linkedMesh->parent);
|
||||
return NULL;
|
||||
}
|
||||
linkedMesh->mesh->super.timelineAttachment = linkedMesh->inheritTimeline ? parent
|
||||
@ -1815,6 +1825,7 @@ spSkeletonData *spSkeletonJson_readSkeletonData(spSkeletonJson *self, const char
|
||||
spAnimation *animation = _spSkeletonJson_readAnimation(self, animationMap, skeletonData);
|
||||
if (!animation) {
|
||||
spSkeletonData_dispose(skeletonData);
|
||||
_spSkeletonJson_setError(self, root, "Animation broken: ", animationMap->name);
|
||||
return NULL;
|
||||
}
|
||||
skeletonData->animations[skeletonData->animationsCount++] = animation;
|
||||
|
||||
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 351 KiB |
@ -460,17 +460,11 @@ namespace spine {
|
||||
trianglesTwoColor.indices = twoColorBatch->allocateIndices(trianglesTwoColor.indexCount);
|
||||
memcpy(trianglesTwoColor.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size());
|
||||
|
||||
#if COCOS2D_VERSION < 0x00040000
|
||||
TwoColorTrianglesCommand *batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags);
|
||||
#else
|
||||
TwoColorTrianglesCommand *batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture, _programState, blendFunc, trianglesTwoColor, transform, transformFlags);
|
||||
#endif
|
||||
|
||||
const float *verts = _clipper->getClippedVertices().buffer();
|
||||
const float *uvs = _clipper->getClippedUVs().buffer();
|
||||
|
||||
V3F_C4B_C4B_T2F *vertex = batchedTriangles->getTriangles().verts;
|
||||
for (int v = 0, vn = batchedTriangles->getTriangles().vertCount, vv = 0; v < vn; ++v, vv += 2, ++vertex) {
|
||||
V3F_C4B_C4B_T2F *vertex = trianglesTwoColor.verts;
|
||||
for (int v = 0, vn = trianglesTwoColor.vertCount, vv = 0; v < vn; ++v, vv += 2, ++vertex) {
|
||||
vertex->position.x = verts[vv];
|
||||
vertex->position.y = verts[vv + 1];
|
||||
vertex->texCoords.u = uvs[vv];
|
||||
@ -478,19 +472,24 @@ namespace spine {
|
||||
vertex->color = color4B;
|
||||
vertex->color2 = darkColor4B;
|
||||
}
|
||||
} else {
|
||||
|
||||
#if COCOS2D_VERSION < 0x00040000
|
||||
TwoColorTrianglesCommand *batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags);
|
||||
TwoColorTrianglesCommand *batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags);
|
||||
#else
|
||||
TwoColorTrianglesCommand *batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture, _programState, blendFunc, trianglesTwoColor, transform, transformFlags);
|
||||
lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture, _programState, blendFunc, trianglesTwoColor, transform, transformFlags);
|
||||
#endif
|
||||
|
||||
V3F_C4B_C4B_T2F *vertex = batchedTriangles->getTriangles().verts;
|
||||
for (int v = 0, vn = batchedTriangles->getTriangles().vertCount; v < vn; ++v, ++vertex) {
|
||||
vertex->color = color4B;
|
||||
} else {
|
||||
V3F_C4B_C4B_T2F* vertex = trianglesTwoColor.verts;
|
||||
for (int v = 0, vn = trianglesTwoColor.vertCount; v < vn; ++v, ++vertex)
|
||||
{
|
||||
vertex->color = color4B;
|
||||
vertex->color2 = darkColor4B;
|
||||
}
|
||||
#if COCOS2D_VERSION < 0x00040000
|
||||
lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags);
|
||||
#else
|
||||
lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, texture, _programState, blendFunc, trianglesTwoColor, transform, transformFlags);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
_clipper->clipEnd(*slot);
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "spine-cpp-light.h"
|
||||
#include "spine-cpp-lite.h"
|
||||
#include <spine/spine.h>
|
||||
#include <spine/Version.h>
|
||||
#include <spine/Debug.h>
|
||||
@ -200,7 +200,7 @@ spine::SpineExtension *spine::getDefaultExtension() {
|
||||
return defaultExtension;
|
||||
}
|
||||
|
||||
void spine_enable_debug_extension(int32_t enable) {
|
||||
void spine_enable_debug_extension(spine_bool enable) {
|
||||
initExtensions();
|
||||
SpineExtension::setInstance(enable ? debugExtension : defaultExtension);
|
||||
}
|
||||
@ -1022,25 +1022,25 @@ void spine_animation_state_clear_track(spine_animation_state state, int32_t trac
|
||||
_state->clearTrack(trackIndex);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_set_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, int32_t loop) {
|
||||
spine_track_entry spine_animation_state_set_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, spine_bool loop) {
|
||||
if (state == nullptr) return nullptr;
|
||||
AnimationState *_state = (AnimationState *) state;
|
||||
return (spine_track_entry) _state->setAnimation(trackIndex, animationName, loop);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_set_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, int32_t loop) {
|
||||
spine_track_entry spine_animation_state_set_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, spine_bool loop) {
|
||||
if (state == nullptr) return nullptr;
|
||||
AnimationState *_state = (AnimationState *) state;
|
||||
return (spine_track_entry) _state->setAnimation(trackIndex, (Animation *) animation, loop);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_add_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, int32_t loop, float delay) {
|
||||
spine_track_entry spine_animation_state_add_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, spine_bool loop, float delay) {
|
||||
if (state == nullptr) return nullptr;
|
||||
AnimationState *_state = (AnimationState *) state;
|
||||
return (spine_track_entry) _state->addAnimation(trackIndex, animationName, loop, delay);
|
||||
}
|
||||
|
||||
spine_track_entry spine_animation_state_add_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, int32_t loop, float delay) {
|
||||
spine_track_entry spine_animation_state_add_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, spine_bool loop, float delay) {
|
||||
if (state == nullptr) return nullptr;
|
||||
AnimationState *_state = (AnimationState *) state;
|
||||
return (spine_track_entry) _state->addAnimation(trackIndex, (Animation *) animation, loop, delay);
|
||||
@ -1142,49 +1142,49 @@ spine_track_entry spine_track_entry_get_previous(spine_track_entry entry) {
|
||||
return (spine_track_entry) _entry->getPrevious();
|
||||
}
|
||||
|
||||
int32_t spine_track_entry_get_loop(spine_track_entry entry) {
|
||||
spine_bool spine_track_entry_get_loop(spine_track_entry entry) {
|
||||
if (entry == nullptr) return 0;
|
||||
TrackEntry *_entry = (TrackEntry *) entry;
|
||||
return _entry->getLoop() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_track_entry_set_loop(spine_track_entry entry, int32_t loop) {
|
||||
void spine_track_entry_set_loop(spine_track_entry entry, spine_bool loop) {
|
||||
if (entry == nullptr) return;
|
||||
TrackEntry *_entry = (TrackEntry *) entry;
|
||||
_entry->setLoop(loop);
|
||||
}
|
||||
|
||||
int32_t spine_track_entry_get_hold_previous(spine_track_entry entry) {
|
||||
spine_bool spine_track_entry_get_hold_previous(spine_track_entry entry) {
|
||||
if (entry == nullptr) return 0;
|
||||
TrackEntry *_entry = (TrackEntry *) entry;
|
||||
return _entry->getHoldPrevious() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_track_entry_set_hold_previous(spine_track_entry entry, int32_t holdPrevious) {
|
||||
void spine_track_entry_set_hold_previous(spine_track_entry entry, spine_bool holdPrevious) {
|
||||
if (entry == nullptr) return;
|
||||
TrackEntry *_entry = (TrackEntry *) entry;
|
||||
_entry->setHoldPrevious(holdPrevious);
|
||||
}
|
||||
|
||||
int32_t spine_track_entry_get_reverse(spine_track_entry entry) {
|
||||
spine_bool spine_track_entry_get_reverse(spine_track_entry entry) {
|
||||
if (entry == nullptr) return 0;
|
||||
TrackEntry *_entry = (TrackEntry *) entry;
|
||||
return _entry->getReverse() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_track_entry_set_reverse(spine_track_entry entry, int32_t reverse) {
|
||||
void spine_track_entry_set_reverse(spine_track_entry entry, spine_bool reverse) {
|
||||
if (entry == nullptr) return;
|
||||
TrackEntry *_entry = (TrackEntry *) entry;
|
||||
_entry->setReverse(reverse);
|
||||
}
|
||||
|
||||
int32_t spine_track_entry_get_shortest_rotation(spine_track_entry entry) {
|
||||
spine_bool spine_track_entry_get_shortest_rotation(spine_track_entry entry) {
|
||||
if (entry == nullptr) return 0;
|
||||
TrackEntry *_entry = (TrackEntry *) entry;
|
||||
return _entry->getShortestRotation() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_track_entry_set_shortest_rotation(spine_track_entry entry, int32_t shortestRotation) {
|
||||
void spine_track_entry_set_shortest_rotation(spine_track_entry entry, spine_bool shortestRotation) {
|
||||
if (entry == nullptr) return;
|
||||
TrackEntry *_entry = (TrackEntry *) entry;
|
||||
_entry->setShortestRotation(shortestRotation);
|
||||
@ -1346,7 +1346,7 @@ spine_track_entry spine_track_entry_get_next(spine_track_entry entry) {
|
||||
return (spine_track_entry) _entry->getNext();
|
||||
}
|
||||
|
||||
int32_t spine_track_entry_is_complete(spine_track_entry entry) {
|
||||
spine_bool spine_track_entry_is_complete(spine_track_entry entry) {
|
||||
if (entry == nullptr) return 0;
|
||||
TrackEntry *_entry = (TrackEntry *) entry;
|
||||
return _entry->isComplete() ? -1 : 0;
|
||||
@ -1905,13 +1905,13 @@ void spine_slot_data_set_dark_color(spine_slot_data slot, float r, float g, floa
|
||||
_slot->getDarkColor().set(r, g, b, a);
|
||||
}
|
||||
|
||||
int32_t spine_slot_data_has_dark_color(spine_slot_data slot) {
|
||||
spine_bool spine_slot_data_has_dark_color(spine_slot_data slot) {
|
||||
if (slot == nullptr) return 0;
|
||||
SlotData *_slot = (SlotData *) slot;
|
||||
return _slot->hasDarkColor() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_slot_data_set_has_dark_color(spine_slot_data slot, int32_t hasDarkColor) {
|
||||
void spine_slot_data_set_has_dark_color(spine_slot_data slot, spine_bool hasDarkColor) {
|
||||
if (slot == nullptr) return;
|
||||
SlotData *_slot = (SlotData *) slot;
|
||||
_slot->setHasDarkColor(hasDarkColor);
|
||||
@ -1941,13 +1941,13 @@ void spine_slot_data_set_blend_mode(spine_slot_data slot, spine_blend_mode blend
|
||||
_slot->setBlendMode((BlendMode) blendMode);
|
||||
}
|
||||
|
||||
int32_t spine_slot_data_is_visible(spine_slot_data slot) {
|
||||
spine_bool spine_slot_data_is_visible(spine_slot_data slot) {
|
||||
if (slot == nullptr) return false;
|
||||
SlotData *_slot = (SlotData *) slot;
|
||||
return _slot->isVisible();
|
||||
}
|
||||
|
||||
void spine_slot_data_set_visible(spine_slot_data slot, int32_t visible) {
|
||||
void spine_slot_data_set_visible(spine_slot_data slot, spine_bool visible) {
|
||||
if (slot == nullptr) return;
|
||||
SlotData *_slot = (SlotData *) slot;
|
||||
_slot->setVisible(visible);
|
||||
@ -2002,7 +2002,7 @@ void spine_slot_set_dark_color(spine_slot slot, float r, float g, float b, float
|
||||
_slot->getDarkColor().set(r, g, b, a);
|
||||
}
|
||||
|
||||
int32_t spine_slot_has_dark_color(spine_slot slot) {
|
||||
spine_bool spine_slot_has_dark_color(spine_slot slot) {
|
||||
if (slot == nullptr) return 0;
|
||||
Slot *_slot = (Slot *) slot;
|
||||
return _slot->hasDarkColor() ? -1 : 0;
|
||||
@ -2159,13 +2159,13 @@ void spine_bone_data_set_inherit(spine_bone_data data, spine_inherit inherit) {
|
||||
_data->setInherit((Inherit) inherit);
|
||||
}
|
||||
|
||||
int32_t spine_bone_data_is_skin_required(spine_bone_data data) {
|
||||
spine_bool spine_bone_data_is_skin_required(spine_bone_data data) {
|
||||
if (data == nullptr) return 0;
|
||||
BoneData *_data = (BoneData *) data;
|
||||
return _data->isSkinRequired() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_bone_data_set_is_skin_required(spine_bone_data data, int32_t isSkinRequired) {
|
||||
void spine_bone_data_set_is_skin_required(spine_bone_data data, spine_bool isSkinRequired) {
|
||||
if (data == nullptr) return;
|
||||
BoneData *_data = (BoneData *) data;
|
||||
_data->setSkinRequired(isSkinRequired);
|
||||
@ -2183,24 +2183,24 @@ void spine_bone_data_set_color(spine_bone_data data, float r, float g, float b,
|
||||
_data->getColor().set(r, g, b, a);
|
||||
}
|
||||
|
||||
int32_t spine_bone_data_is_visible(spine_bone_data data) {
|
||||
spine_bool spine_bone_data_is_visible(spine_bone_data data) {
|
||||
if (data == nullptr) return false;
|
||||
BoneData *_data = (BoneData *) data;
|
||||
return _data->isVisible();
|
||||
}
|
||||
|
||||
void spine_bone_data_set_visible(spine_bone_data data, int32_t isVisible) {
|
||||
void spine_bone_data_set_visible(spine_bone_data data, spine_bool isVisible) {
|
||||
if (data == nullptr) return;
|
||||
BoneData *_data = (BoneData *) data;
|
||||
_data->setVisible(isVisible);
|
||||
}
|
||||
|
||||
// Bone
|
||||
void spine_bone_set_is_y_down(int32_t yDown) {
|
||||
void spine_bone_set_is_y_down(spine_bool yDown) {
|
||||
Bone::setYDown(yDown);
|
||||
}
|
||||
|
||||
int32_t spine_bone_get_is_y_down() {
|
||||
spine_bool spine_bone_get_is_y_down() {
|
||||
return Bone::isYDown() ? -1 : 0;
|
||||
}
|
||||
|
||||
@ -2591,13 +2591,13 @@ float spine_bone_get_world_scale_y(spine_bone bone) {
|
||||
return _bone->getWorldScaleY();
|
||||
}
|
||||
|
||||
int32_t spine_bone_get_is_active(spine_bone bone) {
|
||||
spine_bool spine_bone_get_is_active(spine_bone bone) {
|
||||
if (bone == nullptr) return 0;
|
||||
Bone *_bone = (Bone *) bone;
|
||||
return _bone->isActive() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_bone_set_is_active(spine_bone bone, int32_t isActive) {
|
||||
void spine_bone_set_is_active(spine_bone bone, spine_bool isActive) {
|
||||
if (bone == nullptr) return;
|
||||
Bone *_bone = (Bone *) bone;
|
||||
_bone->setActive(isActive);
|
||||
@ -3102,25 +3102,25 @@ float *spine_path_attachment_get_lengths(spine_path_attachment attachment) {
|
||||
return _attachment->getLengths().buffer();
|
||||
}
|
||||
|
||||
int32_t spine_path_attachment_get_is_closed(spine_path_attachment attachment) {
|
||||
spine_bool spine_path_attachment_get_is_closed(spine_path_attachment attachment) {
|
||||
if (attachment == nullptr) return 0;
|
||||
PathAttachment *_attachment = (PathAttachment *) attachment;
|
||||
return _attachment->isClosed() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_path_attachment_set_is_closed(spine_path_attachment attachment, int32_t isClosed) {
|
||||
void spine_path_attachment_set_is_closed(spine_path_attachment attachment, spine_bool isClosed) {
|
||||
if (attachment == nullptr) return;
|
||||
PathAttachment *_attachment = (PathAttachment *) attachment;
|
||||
_attachment->setClosed(isClosed);
|
||||
}
|
||||
|
||||
int32_t spine_path_attachment_get_is_constant_speed(spine_path_attachment attachment) {
|
||||
spine_bool spine_path_attachment_get_is_constant_speed(spine_path_attachment attachment) {
|
||||
if (attachment == nullptr) return 0;
|
||||
PathAttachment *_attachment = (PathAttachment *) attachment;
|
||||
return _attachment->isConstantSpeed() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_path_attachment_set_is_constant_speed(spine_path_attachment attachment, int32_t isConstantSpeed) {
|
||||
void spine_path_attachment_set_is_constant_speed(spine_path_attachment attachment, spine_bool isConstantSpeed) {
|
||||
if (attachment == nullptr) return;
|
||||
PathAttachment *_attachment = (PathAttachment *) attachment;
|
||||
_attachment->setConstantSpeed(isConstantSpeed);
|
||||
@ -3296,13 +3296,13 @@ void spine_constraint_data_set_order(spine_constraint_data data, uint64_t order)
|
||||
_data->setOrder((size_t) order);
|
||||
}
|
||||
|
||||
int32_t spine_constraint_data_get_is_skin_required(spine_constraint_data data) {
|
||||
spine_bool spine_constraint_data_get_is_skin_required(spine_constraint_data data) {
|
||||
if (data == nullptr) return 0;
|
||||
ConstraintData *_data = (ConstraintData *) data;
|
||||
return _data->isSkinRequired() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_constraint_data_set_is_skin_required(spine_constraint_data data, int32_t isSkinRequired) {
|
||||
void spine_constraint_data_set_is_skin_required(spine_constraint_data data, spine_bool isSkinRequired) {
|
||||
if (data == nullptr) return;
|
||||
ConstraintData *_data = (ConstraintData *) data;
|
||||
_data->setSkinRequired(isSkinRequired);
|
||||
@ -3345,31 +3345,31 @@ void spine_ik_constraint_data_set_bend_direction(spine_ik_constraint_data data,
|
||||
_data->setBendDirection(bendDirection);
|
||||
}
|
||||
|
||||
int32_t spine_ik_constraint_data_get_compress(spine_ik_constraint_data data) {
|
||||
spine_bool spine_ik_constraint_data_get_compress(spine_ik_constraint_data data) {
|
||||
if (data == nullptr) return 0;
|
||||
IkConstraintData *_data = (IkConstraintData *) data;
|
||||
return _data->getCompress() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_ik_constraint_data_set_compress(spine_ik_constraint_data data, int32_t compress) {
|
||||
void spine_ik_constraint_data_set_compress(spine_ik_constraint_data data, spine_bool compress) {
|
||||
if (data == nullptr) return;
|
||||
IkConstraintData *_data = (IkConstraintData *) data;
|
||||
_data->setCompress(compress);
|
||||
}
|
||||
|
||||
int32_t spine_ik_constraint_data_get_stretch(spine_ik_constraint_data data) {
|
||||
spine_bool spine_ik_constraint_data_get_stretch(spine_ik_constraint_data data) {
|
||||
if (data == nullptr) return 0;
|
||||
IkConstraintData *_data = (IkConstraintData *) data;
|
||||
return _data->getStretch() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_ik_constraint_data_set_stretch(spine_ik_constraint_data data, int32_t stretch) {
|
||||
void spine_ik_constraint_data_set_stretch(spine_ik_constraint_data data, spine_bool stretch) {
|
||||
if (data == nullptr) return;
|
||||
IkConstraintData *_data = (IkConstraintData *) data;
|
||||
_data->setStretch(stretch);
|
||||
}
|
||||
|
||||
int32_t spine_ik_constraint_data_get_uniform(spine_ik_constraint_data data) {
|
||||
spine_bool spine_ik_constraint_data_get_uniform(spine_ik_constraint_data data) {
|
||||
if (data == nullptr) return 0;
|
||||
IkConstraintData *_data = (IkConstraintData *) data;
|
||||
return _data->getUniform() ? -1 : 0;
|
||||
@ -3454,25 +3454,25 @@ void spine_ik_constraint_set_bend_direction(spine_ik_constraint constraint, int3
|
||||
_constraint->setBendDirection(bendDirection);
|
||||
}
|
||||
|
||||
int32_t spine_ik_constraint_get_compress(spine_ik_constraint constraint) {
|
||||
spine_bool spine_ik_constraint_get_compress(spine_ik_constraint constraint) {
|
||||
if (constraint == nullptr) return 0;
|
||||
IkConstraint *_constraint = (IkConstraint *) constraint;
|
||||
return _constraint->getCompress() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_ik_constraint_set_compress(spine_ik_constraint constraint, int32_t compress) {
|
||||
void spine_ik_constraint_set_compress(spine_ik_constraint constraint, spine_bool compress) {
|
||||
if (constraint == nullptr) return;
|
||||
IkConstraint *_constraint = (IkConstraint *) constraint;
|
||||
_constraint->setCompress(compress);
|
||||
}
|
||||
|
||||
int32_t spine_ik_constraint_get_stretch(spine_ik_constraint constraint) {
|
||||
spine_bool spine_ik_constraint_get_stretch(spine_ik_constraint constraint) {
|
||||
if (constraint == nullptr) return 0;
|
||||
IkConstraint *_constraint = (IkConstraint *) constraint;
|
||||
return _constraint->getStretch() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_ik_constraint_set_stretch(spine_ik_constraint constraint, int32_t stretch) {
|
||||
void spine_ik_constraint_set_stretch(spine_ik_constraint constraint, spine_bool stretch) {
|
||||
if (constraint == nullptr) return;
|
||||
IkConstraint *_constraint = (IkConstraint *) constraint;
|
||||
_constraint->setStretch(stretch);
|
||||
@ -3502,13 +3502,13 @@ void spine_ik_constraint_set_softness(spine_ik_constraint constraint, float soft
|
||||
_constraint->setSoftness(softness);
|
||||
}
|
||||
|
||||
int32_t spine_ik_constraint_get_is_active(spine_ik_constraint constraint) {
|
||||
spine_bool spine_ik_constraint_get_is_active(spine_ik_constraint constraint) {
|
||||
if (constraint == nullptr) return 0;
|
||||
IkConstraint *_constraint = (IkConstraint *) constraint;
|
||||
return _constraint->isActive() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_ik_constraint_set_is_active(spine_ik_constraint constraint, int32_t isActive) {
|
||||
void spine_ik_constraint_set_is_active(spine_ik_constraint constraint, spine_bool isActive) {
|
||||
if (constraint == nullptr) return;
|
||||
IkConstraint *_constraint = (IkConstraint *) constraint;
|
||||
_constraint->setActive(isActive);
|
||||
@ -3683,25 +3683,25 @@ void spine_transform_constraint_data_set_offset_shear_y(spine_transform_constrai
|
||||
_data->setOffsetShearY(offsetShearY);
|
||||
}
|
||||
|
||||
int32_t spine_transform_constraint_data_get_is_relative(spine_transform_constraint_data data) {
|
||||
spine_bool spine_transform_constraint_data_get_is_relative(spine_transform_constraint_data data) {
|
||||
if (data == nullptr) return 0;
|
||||
TransformConstraintData *_data = (TransformConstraintData *) data;
|
||||
return _data->isRelative() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_transform_constraint_data_set_is_relative(spine_transform_constraint_data data, int32_t isRelative) {
|
||||
void spine_transform_constraint_data_set_is_relative(spine_transform_constraint_data data, spine_bool isRelative) {
|
||||
if (data == nullptr) return;
|
||||
TransformConstraintData *_data = (TransformConstraintData *) data;
|
||||
_data->setRelative(isRelative);
|
||||
}
|
||||
|
||||
int32_t spine_transform_constraint_data_get_is_local(spine_transform_constraint_data data) {
|
||||
spine_bool spine_transform_constraint_data_get_is_local(spine_transform_constraint_data data) {
|
||||
if (data == nullptr) return 0;
|
||||
TransformConstraintData *_data = (TransformConstraintData *) data;
|
||||
return _data->isLocal() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_transform_constraint_data_set_is_local(spine_transform_constraint_data data, int32_t isLocal) {
|
||||
void spine_transform_constraint_data_set_is_local(spine_transform_constraint_data data, spine_bool isLocal) {
|
||||
if (data == nullptr) return;
|
||||
TransformConstraintData *_data = (TransformConstraintData *) data;
|
||||
_data->setLocal(isLocal);
|
||||
@ -3822,13 +3822,13 @@ void spine_transform_constraint_set_mix_shear_y(spine_transform_constraint const
|
||||
_constraint->setMixShearY(mixShearY);
|
||||
}
|
||||
|
||||
float spine_transform_constraint_get_is_active(spine_transform_constraint constraint) {
|
||||
spine_bool spine_transform_constraint_get_is_active(spine_transform_constraint constraint) {
|
||||
if (constraint == nullptr) return 0;
|
||||
TransformConstraint *_constraint = (TransformConstraint *) constraint;
|
||||
return _constraint->isActive() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_transform_constraint_set_is_active(spine_transform_constraint constraint, int32_t isActive) {
|
||||
void spine_transform_constraint_set_is_active(spine_transform_constraint constraint, spine_bool isActive) {
|
||||
if (constraint == nullptr) return;
|
||||
TransformConstraint *_constraint = (TransformConstraint *) constraint;
|
||||
_constraint->setActive(isActive);
|
||||
@ -4070,13 +4070,13 @@ void spine_path_constraint_set_mix_y(spine_path_constraint constraint, float mix
|
||||
_constraint->setMixY(mixY);
|
||||
}
|
||||
|
||||
int32_t spine_path_constraint_get_is_active(spine_path_constraint constraint) {
|
||||
spine_bool spine_path_constraint_get_is_active(spine_path_constraint constraint) {
|
||||
if (constraint == nullptr) return 0;
|
||||
PathConstraint *_constraint = (PathConstraint *) constraint;
|
||||
return _constraint->isActive() ? -1 : 0;
|
||||
}
|
||||
|
||||
void spine_path_constraint_set_is_active(spine_path_constraint constraint, int32_t isActive) {
|
||||
void spine_path_constraint_set_is_active(spine_path_constraint constraint, spine_bool isActive) {
|
||||
if (constraint == nullptr) return;
|
||||
PathConstraint *_constraint = (PathConstraint *) constraint;
|
||||
_constraint->setActive(isActive);
|
||||
@ -4269,79 +4269,79 @@ void spine_physics_constraint_data_set_inertia_global(spine_physics_constraint_d
|
||||
_data->setInertiaGlobal(inertiaGlobal);
|
||||
}
|
||||
|
||||
int32_t spine_physics_constraint_data_is_inertia_global(spine_physics_constraint_data data) {
|
||||
spine_bool spine_physics_constraint_data_is_inertia_global(spine_physics_constraint_data data) {
|
||||
if (data == nullptr) return false;
|
||||
PhysicsConstraintData *_data = (PhysicsConstraintData *) data;
|
||||
return _data->isInertiaGlobal();
|
||||
}
|
||||
|
||||
void spine_physics_constraint_data_set_strength_global(spine_physics_constraint_data data, int32_t strengthGlobal) {
|
||||
void spine_physics_constraint_data_set_strength_global(spine_physics_constraint_data data, spine_bool strengthGlobal) {
|
||||
if (data == nullptr) return;
|
||||
PhysicsConstraintData *_data = (PhysicsConstraintData *) data;
|
||||
_data->setStrengthGlobal(strengthGlobal);
|
||||
}
|
||||
|
||||
int32_t spine_physics_constraint_data_is_strength_global(spine_physics_constraint_data data) {
|
||||
spine_bool spine_physics_constraint_data_is_strength_global(spine_physics_constraint_data data) {
|
||||
if (data == nullptr) return false;
|
||||
PhysicsConstraintData *_data = (PhysicsConstraintData *) data;
|
||||
return _data->isStrengthGlobal();
|
||||
}
|
||||
|
||||
void spine_physics_constraint_data_set_damping_global(spine_physics_constraint_data data, int32_t dampingGlobal) {
|
||||
void spine_physics_constraint_data_set_damping_global(spine_physics_constraint_data data, spine_bool dampingGlobal) {
|
||||
if (data == nullptr) return;
|
||||
PhysicsConstraintData *_data = (PhysicsConstraintData *) data;
|
||||
_data->setDampingGlobal(dampingGlobal);
|
||||
}
|
||||
|
||||
int32_t spine_physics_constraint_data_is_damping_global(spine_physics_constraint_data data) {
|
||||
spine_bool spine_physics_constraint_data_is_damping_global(spine_physics_constraint_data data) {
|
||||
if (data == nullptr) return false;
|
||||
PhysicsConstraintData *_data = (PhysicsConstraintData *) data;
|
||||
return _data->isDampingGlobal();
|
||||
}
|
||||
|
||||
void spine_physics_constraint_data_set_mass_global(spine_physics_constraint_data data, int32_t massGlobal) {
|
||||
void spine_physics_constraint_data_set_mass_global(spine_physics_constraint_data data, spine_bool massGlobal) {
|
||||
if (data == nullptr) return;
|
||||
PhysicsConstraintData *_data = (PhysicsConstraintData *) data;
|
||||
_data->setMassGlobal(massGlobal);
|
||||
}
|
||||
|
||||
int32_t spine_physics_constraint_data_is_mass_global(spine_physics_constraint_data data) {
|
||||
spine_bool spine_physics_constraint_data_is_mass_global(spine_physics_constraint_data data) {
|
||||
if (data == nullptr) return false;
|
||||
PhysicsConstraintData *_data = (PhysicsConstraintData *) data;
|
||||
return _data->isMassGlobal();
|
||||
}
|
||||
|
||||
void spine_physics_constraint_data_set_wind_global(spine_physics_constraint_data data, int32_t windGlobal) {
|
||||
void spine_physics_constraint_data_set_wind_global(spine_physics_constraint_data data, spine_bool windGlobal) {
|
||||
if (data == nullptr) return;
|
||||
PhysicsConstraintData *_data = (PhysicsConstraintData *) data;
|
||||
_data->setWindGlobal(windGlobal);
|
||||
}
|
||||
|
||||
int32_t spine_physics_constraint_data_is_wind_global(spine_physics_constraint_data data) {
|
||||
spine_bool spine_physics_constraint_data_is_wind_global(spine_physics_constraint_data data) {
|
||||
if (data == nullptr) return false;
|
||||
PhysicsConstraintData *_data = (PhysicsConstraintData *) data;
|
||||
return _data->isWindGlobal();
|
||||
}
|
||||
|
||||
void spine_physics_constraint_data_set_gravity_global(spine_physics_constraint_data data, int32_t gravityGlobal) {
|
||||
void spine_physics_constraint_data_set_gravity_global(spine_physics_constraint_data data, spine_bool gravityGlobal) {
|
||||
if (data == nullptr) return;
|
||||
PhysicsConstraintData *_data = (PhysicsConstraintData *) data;
|
||||
_data->setGravityGlobal(gravityGlobal);
|
||||
}
|
||||
|
||||
int32_t spine_physics_constraint_data_is_gravity_global(spine_physics_constraint_data data) {
|
||||
spine_bool spine_physics_constraint_data_is_gravity_global(spine_physics_constraint_data data) {
|
||||
if (data == nullptr) return false;
|
||||
PhysicsConstraintData *_data = (PhysicsConstraintData *) data;
|
||||
return _data->isGravityGlobal();
|
||||
}
|
||||
|
||||
void spine_physics_constraint_data_set_mix_global(spine_physics_constraint_data data, int32_t mixGlobal) {
|
||||
void spine_physics_constraint_data_set_mix_global(spine_physics_constraint_data data, spine_bool mixGlobal) {
|
||||
if (data == nullptr) return;
|
||||
PhysicsConstraintData *_data = (PhysicsConstraintData *) data;
|
||||
_data->setMixGlobal(mixGlobal);
|
||||
}
|
||||
|
||||
int32_t spine_physics_constraint_data_is_mix_global(spine_physics_constraint_data data) {
|
||||
spine_bool spine_physics_constraint_data_is_mix_global(spine_physics_constraint_data data) {
|
||||
if (data == nullptr) return false;
|
||||
PhysicsConstraintData *_data = (PhysicsConstraintData *) data;
|
||||
return _data->isMixGlobal();
|
||||
@ -4444,13 +4444,13 @@ float spine_physics_constraint_get_mix(spine_physics_constraint constraint) {
|
||||
return _constraint->getMix();
|
||||
}
|
||||
|
||||
void spine_physics_constraint_set_reset(spine_physics_constraint constraint, int32_t value) {
|
||||
void spine_physics_constraint_set_reset(spine_physics_constraint constraint, spine_bool value) {
|
||||
if (constraint == nullptr) return;
|
||||
PhysicsConstraint *_constraint = (PhysicsConstraint *) constraint;
|
||||
_constraint->setReset(value);
|
||||
}
|
||||
|
||||
int32_t spine_physics_constraint_get_reset(spine_physics_constraint constraint) {
|
||||
spine_bool spine_physics_constraint_get_reset(spine_physics_constraint constraint) {
|
||||
if (constraint == nullptr) return false;
|
||||
PhysicsConstraint *_constraint = (PhysicsConstraint *) constraint;
|
||||
return _constraint->getReset();
|
||||
@ -4624,13 +4624,13 @@ float spine_physics_constraint_get_scale_velocity(spine_physics_constraint const
|
||||
return _constraint->getScaleVelocity();
|
||||
}
|
||||
|
||||
void spine_physics_constraint_set_active(spine_physics_constraint constraint, int32_t value) {
|
||||
void spine_physics_constraint_set_active(spine_physics_constraint constraint, spine_bool value) {
|
||||
if (constraint == nullptr) return;
|
||||
PhysicsConstraint *_constraint = (PhysicsConstraint *) constraint;
|
||||
_constraint->setActive(value);
|
||||
}
|
||||
|
||||
int32_t spine_physics_constraint_is_active(spine_physics_constraint constraint) {
|
||||
spine_bool spine_physics_constraint_is_active(spine_physics_constraint constraint) {
|
||||
if (constraint == nullptr) return false;
|
||||
PhysicsConstraint *_constraint = (PhysicsConstraint *) constraint;
|
||||
return _constraint->isActive();
|
||||
|
||||
@ -27,29 +27,29 @@
|
||||
* SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SPINE_FLUTTER
|
||||
#define SPINE_FLUTTER
|
||||
#ifndef SPINE_CPP_LITE
|
||||
#define SPINE_CPP_LITE
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if _WIN32
|
||||
#define SPINE_FLUTTER_EXPORT extern "C" __declspec(dllexport)
|
||||
#define SPINE_CPP_LITE_EXPORT extern "C" __declspec(dllexport)
|
||||
#else
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#define SPINE_FLUTTER_EXPORT extern "C" __attribute__((used))
|
||||
#define SPINE_CPP_LITE_EXPORT extern "C" __attribute__((used))
|
||||
#else
|
||||
#define SPINE_CPP_LITE_EXPORT extern "C"
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#if _WIN32
|
||||
#define SPINE_FLUTTER_EXPORT __declspec(dllexport)
|
||||
#define SPINE_CPP_LITE_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#define SPINE_FLUTTER_EXPORT __attribute__((used))
|
||||
#define SPINE_CPP_LITE_EXPORT __attribute__((used))
|
||||
#else
|
||||
#define SPINE_FLUTTER_EXPORT
|
||||
#define SPINE_CPP_LITE_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
@ -177,9 +177,11 @@ typedef enum spine_physics {
|
||||
|
||||
} spine_physics;
|
||||
|
||||
typedef int32_t spine_bool;
|
||||
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_major_version();
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_minor_version();
|
||||
SPINE_CPP_LITE_EXPORT void spine_enable_debug_extension(int32_t enable);
|
||||
SPINE_CPP_LITE_EXPORT void spine_enable_debug_extension(spine_bool enable);
|
||||
SPINE_CPP_LITE_EXPORT void spine_report_leaks();
|
||||
|
||||
SPINE_CPP_LITE_EXPORT float spine_color_get_r(spine_color color);
|
||||
@ -296,10 +298,10 @@ SPINE_CPP_LITE_EXPORT void spine_animation_state_apply(spine_animation_state sta
|
||||
SPINE_CPP_LITE_EXPORT void spine_animation_state_clear_tracks(spine_animation_state state);
|
||||
SPINE_CPP_LITE_EXPORT void spine_animation_state_clear_track(spine_animation_state state, int32_t trackIndex);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_animation_state_get_num_tracks(spine_animation_state state);
|
||||
SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_set_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, int32_t loop);
|
||||
SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_set_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, int32_t loop);
|
||||
SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_add_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, int32_t loop, float delay);
|
||||
SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_add_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, int32_t loop, float delay);
|
||||
SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_set_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, spine_bool loop);
|
||||
SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_set_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, spine_bool loop);
|
||||
SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_add_animation_by_name(spine_animation_state state, int32_t trackIndex, const utf8 *animationName, spine_bool loop, float delay);
|
||||
SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_add_animation(spine_animation_state state, int32_t trackIndex, spine_animation animation, spine_bool loop, float delay);
|
||||
SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_set_empty_animation(spine_animation_state state, int32_t trackIndex, float mixDuration);
|
||||
SPINE_CPP_LITE_EXPORT spine_track_entry spine_animation_state_add_empty_animation(spine_animation_state state, int32_t trackIndex, float mixDuration, float delay);
|
||||
SPINE_CPP_LITE_EXPORT void spine_animation_state_set_empty_animations(spine_animation_state state, float mixDuration);
|
||||
@ -324,14 +326,14 @@ SPINE_CPP_LITE_EXPORT void spine_animation_state_events_reset(spine_animation_st
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_track_entry_get_track_index(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT spine_animation spine_track_entry_get_animation(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT spine_track_entry spine_track_entry_get_previous(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_track_entry_get_loop(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT void spine_track_entry_set_loop(spine_track_entry entry, int32_t loop);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_track_entry_get_hold_previous(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT void spine_track_entry_set_hold_previous(spine_track_entry entry, int32_t holdPrevious);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_track_entry_get_reverse(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT void spine_track_entry_set_reverse(spine_track_entry entry, int32_t reverse);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_track_entry_get_shortest_rotation(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT void spine_track_entry_set_shortest_rotation(spine_track_entry entry, int32_t shortestRotation);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_track_entry_get_loop(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT void spine_track_entry_set_loop(spine_track_entry entry, spine_bool loop);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_track_entry_get_hold_previous(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT void spine_track_entry_set_hold_previous(spine_track_entry entry, spine_bool holdPrevious);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_track_entry_get_reverse(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT void spine_track_entry_set_reverse(spine_track_entry entry, spine_bool reverse);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_track_entry_get_shortest_rotation(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT void spine_track_entry_set_shortest_rotation(spine_track_entry entry, spine_bool shortestRotation);
|
||||
SPINE_CPP_LITE_EXPORT float spine_track_entry_get_delay(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT void spine_track_entry_set_delay(spine_track_entry entry, float delay);
|
||||
SPINE_CPP_LITE_EXPORT float spine_track_entry_get_track_time(spine_track_entry entry);
|
||||
@ -358,7 +360,7 @@ SPINE_CPP_LITE_EXPORT void spine_track_entry_set_mix_attachment_threshold(spine_
|
||||
SPINE_CPP_LITE_EXPORT float spine_track_entry_get_mix_draw_order_threshold(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT void spine_track_entry_set_mix_draw_order_threshold(spine_track_entry entry, float drawOrderThreshold);
|
||||
SPINE_CPP_LITE_EXPORT spine_track_entry spine_track_entry_get_next(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_track_entry_is_complete(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_track_entry_is_complete(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT float spine_track_entry_get_mix_time(spine_track_entry entry);
|
||||
SPINE_CPP_LITE_EXPORT void spine_track_entry_set_mix_time(spine_track_entry entry, float mixTime);
|
||||
SPINE_CPP_LITE_EXPORT float spine_track_entry_get_mix_duration(spine_track_entry entry);
|
||||
@ -458,14 +460,14 @@ SPINE_CPP_LITE_EXPORT spine_color spine_slot_data_get_color(spine_slot_data slot
|
||||
SPINE_CPP_LITE_EXPORT void spine_slot_data_set_color(spine_slot_data slot, float r, float g, float b, float a);
|
||||
SPINE_CPP_LITE_EXPORT spine_color spine_slot_data_get_dark_color(spine_slot_data slot);
|
||||
SPINE_CPP_LITE_EXPORT void spine_slot_data_set_dark_color(spine_slot_data slot, float r, float g, float b, float a);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_slot_data_has_dark_color(spine_slot_data slot);
|
||||
SPINE_CPP_LITE_EXPORT void spine_slot_data_set_has_dark_color(spine_slot_data slot, int32_t hasDarkColor);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_slot_data_has_dark_color(spine_slot_data slot);
|
||||
SPINE_CPP_LITE_EXPORT void spine_slot_data_set_has_dark_color(spine_slot_data slot, spine_bool hasDarkColor);
|
||||
SPINE_CPP_LITE_EXPORT const utf8 *spine_slot_data_get_attachment_name(spine_slot_data slot);
|
||||
SPINE_CPP_LITE_EXPORT void spine_slot_data_set_attachment_name(spine_slot_data slot, const utf8 *attachmentName);
|
||||
SPINE_CPP_LITE_EXPORT spine_blend_mode spine_slot_data_get_blend_mode(spine_slot_data slot);
|
||||
SPINE_CPP_LITE_EXPORT void spine_slot_data_set_blend_mode(spine_slot_data slot, spine_blend_mode blendMode);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_slot_data_is_visible(spine_slot_data slot);
|
||||
SPINE_CPP_LITE_EXPORT void spine_slot_data_set_visible(spine_slot_data slot, int32_t visible);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_slot_data_is_visible(spine_slot_data slot);
|
||||
SPINE_CPP_LITE_EXPORT void spine_slot_data_set_visible(spine_slot_data slot, spine_bool visible);
|
||||
// OMITTED getPath()/setPath()
|
||||
|
||||
SPINE_CPP_LITE_EXPORT void spine_slot_set_to_setup_pose(spine_slot slot);
|
||||
@ -476,7 +478,7 @@ SPINE_CPP_LITE_EXPORT spine_color spine_slot_get_color(spine_slot slot);
|
||||
SPINE_CPP_LITE_EXPORT void spine_slot_set_color(spine_slot slot, float r, float g, float b, float a);
|
||||
SPINE_CPP_LITE_EXPORT spine_color spine_slot_get_dark_color(spine_slot slot);
|
||||
SPINE_CPP_LITE_EXPORT void spine_slot_set_dark_color(spine_slot slot, float r, float g, float b, float a);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_slot_has_dark_color(spine_slot slot);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_slot_has_dark_color(spine_slot slot);
|
||||
SPINE_CPP_LITE_EXPORT spine_attachment spine_slot_get_attachment(spine_slot slot);
|
||||
SPINE_CPP_LITE_EXPORT void spine_slot_set_attachment(spine_slot slot, spine_attachment attachment);
|
||||
// OMITTED getDeform()
|
||||
@ -504,16 +506,16 @@ SPINE_CPP_LITE_EXPORT float spine_bone_data_get_shear_y(spine_bone_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_data_set_shear_y(spine_bone_data data, float shearY);
|
||||
SPINE_CPP_LITE_EXPORT spine_inherit spine_bone_data_get_inherit(spine_bone_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_data_set_inherit(spine_bone_data data, spine_inherit inherit);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_bone_data_is_skin_required(spine_bone_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_data_set_is_skin_required(spine_bone_data data, int32_t isSkinRequired);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_bone_data_is_skin_required(spine_bone_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_data_set_is_skin_required(spine_bone_data data, spine_bool isSkinRequired);
|
||||
SPINE_CPP_LITE_EXPORT spine_color spine_bone_data_get_color(spine_bone_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_data_set_color(spine_bone_data data, float r, float g, float b, float a);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_bone_data_is_visible(spine_bone_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_data_set_visible(spine_bone_data data, int32_t isVisible);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_bone_data_is_visible(spine_bone_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_data_set_visible(spine_bone_data data, spine_bool isVisible);
|
||||
// Omitted getIcon()/setIcon()
|
||||
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_set_is_y_down(int32_t yDown);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_bone_get_is_y_down();
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_set_is_y_down(spine_bool yDown);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_bone_get_is_y_down();
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_update(spine_bone bone);
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_update_world_transform(spine_bone bone);
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_update_world_transform_with(spine_bone bone, float x, float y, float rotation, float scaleX, float scaleY, float shearX, float shearY);
|
||||
@ -577,8 +579,8 @@ SPINE_CPP_LITE_EXPORT float spine_bone_get_world_rotation_x(spine_bone bone);
|
||||
SPINE_CPP_LITE_EXPORT float spine_bone_get_world_rotation_y(spine_bone bone);
|
||||
SPINE_CPP_LITE_EXPORT float spine_bone_get_world_scale_x(spine_bone bone);
|
||||
SPINE_CPP_LITE_EXPORT float spine_bone_get_world_scale_y(spine_bone bone);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_bone_get_is_active(spine_bone bone);
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_set_is_active(spine_bone bone, int32_t isActive);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_bone_get_is_active(spine_bone bone);
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_set_is_active(spine_bone bone, spine_bool isActive);
|
||||
SPINE_CPP_LITE_EXPORT spine_inherit spine_bone_get_inherit(spine_bone data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_bone_set_inherit(spine_bone data, spine_inherit inherit);
|
||||
|
||||
@ -675,10 +677,10 @@ SPINE_CPP_LITE_EXPORT void spine_bounding_box_attachment_set_color(spine_boundin
|
||||
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_path_attachment_get_num_lengths(spine_path_attachment attachment);
|
||||
SPINE_CPP_LITE_EXPORT float *spine_path_attachment_get_lengths(spine_path_attachment attachment);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_path_attachment_get_is_closed(spine_path_attachment attachment);
|
||||
SPINE_CPP_LITE_EXPORT void spine_path_attachment_set_is_closed(spine_path_attachment attachment, int32_t isClosed);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_path_attachment_get_is_constant_speed(spine_path_attachment attachment);
|
||||
SPINE_CPP_LITE_EXPORT void spine_path_attachment_set_is_constant_speed(spine_path_attachment attachment, int32_t isConstantSpeed);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_path_attachment_get_is_closed(spine_path_attachment attachment);
|
||||
SPINE_CPP_LITE_EXPORT void spine_path_attachment_set_is_closed(spine_path_attachment attachment, spine_bool isClosed);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_path_attachment_get_is_constant_speed(spine_path_attachment attachment);
|
||||
SPINE_CPP_LITE_EXPORT void spine_path_attachment_set_is_constant_speed(spine_path_attachment attachment, spine_bool isConstantSpeed);
|
||||
SPINE_CPP_LITE_EXPORT spine_color spine_path_attachment_get_color(spine_path_attachment attachment);
|
||||
SPINE_CPP_LITE_EXPORT void spine_path_attachment_set_color(spine_path_attachment attachment, float r, float g, float b, float a);
|
||||
|
||||
@ -709,8 +711,8 @@ SPINE_CPP_LITE_EXPORT spine_constraint_type spine_constraint_data_get_type(spine
|
||||
SPINE_CPP_LITE_EXPORT const utf8 *spine_constraint_data_get_name(spine_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT uint64_t spine_constraint_data_get_order(spine_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_constraint_data_set_order(spine_constraint_data data, uint64_t order);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_constraint_data_get_is_skin_required(spine_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_constraint_data_set_is_skin_required(spine_constraint_data data, int32_t isSkinRequired);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_constraint_data_get_is_skin_required(spine_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_constraint_data_set_is_skin_required(spine_constraint_data data, spine_bool isSkinRequired);
|
||||
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_ik_constraint_data_get_num_bones(spine_ik_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT spine_bone_data *spine_ik_constraint_data_get_bones(spine_ik_constraint_data data);
|
||||
@ -718,12 +720,12 @@ SPINE_CPP_LITE_EXPORT spine_bone_data spine_ik_constraint_data_get_target(spine_
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_data_set_target(spine_ik_constraint_data data, spine_bone_data target);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_ik_constraint_data_get_bend_direction(spine_ik_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_data_set_bend_direction(spine_ik_constraint_data data, int32_t bendDirection);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_ik_constraint_data_get_compress(spine_ik_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_data_set_compress(spine_ik_constraint_data data, int32_t compress);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_ik_constraint_data_get_stretch(spine_ik_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_data_set_stretch(spine_ik_constraint_data data, int32_t stretch);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_ik_constraint_data_get_uniform(spine_ik_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_data_set_uniform(spine_ik_constraint_data data, int32_t uniform);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_ik_constraint_data_get_compress(spine_ik_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_data_set_compress(spine_ik_constraint_data data, spine_bool compress);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_ik_constraint_data_get_stretch(spine_ik_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_data_set_stretch(spine_ik_constraint_data data, spine_bool stretch);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_ik_constraint_data_get_uniform(spine_ik_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_data_set_uniform(spine_ik_constraint_data data, spine_bool uniform);
|
||||
SPINE_CPP_LITE_EXPORT float spine_ik_constraint_data_get_mix(spine_ik_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_data_set_mix(spine_ik_constraint_data data, float mix);
|
||||
SPINE_CPP_LITE_EXPORT float spine_ik_constraint_data_get_softness(spine_ik_constraint_data data);
|
||||
@ -738,16 +740,16 @@ SPINE_CPP_LITE_EXPORT spine_bone spine_ik_constraint_get_target(spine_ik_constra
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_set_target(spine_ik_constraint constraint, spine_bone target);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_ik_constraint_get_bend_direction(spine_ik_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_set_bend_direction(spine_ik_constraint constraint, int32_t bendDirection);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_ik_constraint_get_compress(spine_ik_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_set_compress(spine_ik_constraint constraint, int32_t compress);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_ik_constraint_get_stretch(spine_ik_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_set_stretch(spine_ik_constraint constraint, int32_t stretch);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_ik_constraint_get_compress(spine_ik_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_set_compress(spine_ik_constraint constraint, spine_bool compress);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_ik_constraint_get_stretch(spine_ik_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_set_stretch(spine_ik_constraint constraint, spine_bool stretch);
|
||||
SPINE_CPP_LITE_EXPORT float spine_ik_constraint_get_mix(spine_ik_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_set_mix(spine_ik_constraint constraint, float mix);
|
||||
SPINE_CPP_LITE_EXPORT float spine_ik_constraint_get_softness(spine_ik_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_set_softness(spine_ik_constraint constraint, float softness);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_ik_constraint_get_is_active(spine_ik_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_set_is_active(spine_ik_constraint constraint, int32_t isActive);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_ik_constraint_get_is_active(spine_ik_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_ik_constraint_set_is_active(spine_ik_constraint constraint, spine_bool isActive);
|
||||
// OMITTED setToSetupPose()
|
||||
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_transform_constraint_data_get_num_bones(spine_transform_constraint_data data);
|
||||
@ -778,10 +780,10 @@ SPINE_CPP_LITE_EXPORT float spine_transform_constraint_data_get_offset_scale_y(s
|
||||
SPINE_CPP_LITE_EXPORT void spine_transform_constraint_data_set_offset_scale_y(spine_transform_constraint_data data, float offsetScaleY);
|
||||
SPINE_CPP_LITE_EXPORT float spine_transform_constraint_data_get_offset_shear_y(spine_transform_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_transform_constraint_data_set_offset_shear_y(spine_transform_constraint_data data, float offsetShearY);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_transform_constraint_data_get_is_relative(spine_transform_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_transform_constraint_data_set_is_relative(spine_transform_constraint_data data, int32_t isRelative);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_transform_constraint_data_get_is_local(spine_transform_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_transform_constraint_data_set_is_local(spine_transform_constraint_data data, int32_t isLocal);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_transform_constraint_data_get_is_relative(spine_transform_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_transform_constraint_data_set_is_relative(spine_transform_constraint_data data, spine_bool isRelative);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_transform_constraint_data_get_is_local(spine_transform_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_transform_constraint_data_set_is_local(spine_transform_constraint_data data, spine_bool isLocal);
|
||||
|
||||
SPINE_CPP_LITE_EXPORT void spine_transform_constraint_update(spine_transform_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_transform_constraint_get_order(spine_transform_constraint constraint);
|
||||
@ -802,8 +804,8 @@ SPINE_CPP_LITE_EXPORT float spine_transform_constraint_get_mix_scale_y(spine_tra
|
||||
SPINE_CPP_LITE_EXPORT void spine_transform_constraint_set_mix_scale_y(spine_transform_constraint constraint, float mixScaleY);
|
||||
SPINE_CPP_LITE_EXPORT float spine_transform_constraint_get_mix_shear_y(spine_transform_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_transform_constraint_set_mix_shear_y(spine_transform_constraint constraint, float mixShearY);
|
||||
SPINE_CPP_LITE_EXPORT float spine_transform_constraint_get_is_active(spine_transform_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_transform_constraint_set_is_active(spine_transform_constraint constraint, int32_t isActive);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_transform_constraint_get_is_active(spine_transform_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_transform_constraint_set_is_active(spine_transform_constraint constraint, spine_bool isActive);
|
||||
// OMITTED setToSetupPose()
|
||||
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_path_constraint_data_get_num_bones(spine_path_constraint_data data);
|
||||
@ -846,8 +848,8 @@ SPINE_CPP_LITE_EXPORT float spine_path_constraint_get_mix_x(spine_path_constrain
|
||||
SPINE_CPP_LITE_EXPORT void spine_path_constraint_set_mix_x(spine_path_constraint constraint, float mixX);
|
||||
SPINE_CPP_LITE_EXPORT float spine_path_constraint_get_mix_y(spine_path_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_path_constraint_set_mix_y(spine_path_constraint constraint, float mixY);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_path_constraint_get_is_active(spine_path_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_path_constraint_set_is_active(spine_path_constraint constraint, int32_t isActive);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_path_constraint_get_is_active(spine_path_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_path_constraint_set_is_active(spine_path_constraint constraint, spine_bool isActive);
|
||||
// OMITTED setToSetupPose()
|
||||
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_bone(spine_physics_constraint_data data, spine_bone_data bone);
|
||||
@ -880,20 +882,20 @@ SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_gravity(spine_physi
|
||||
SPINE_CPP_LITE_EXPORT float spine_physics_constraint_data_get_gravity(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_mix(spine_physics_constraint_data data, float mix);
|
||||
SPINE_CPP_LITE_EXPORT float spine_physics_constraint_data_get_mix(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_inertia_global(spine_physics_constraint_data data, int32_t inertiaGlobal);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_physics_constraint_data_is_inertia_global(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_strength_global(spine_physics_constraint_data data, int32_t strengthGlobal);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_physics_constraint_data_is_strength_global(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_damping_global(spine_physics_constraint_data data, int32_t dampingGlobal);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_physics_constraint_data_is_damping_global(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_mass_global(spine_physics_constraint_data data, int32_t massGlobal);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_physics_constraint_data_is_mass_global(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_wind_global(spine_physics_constraint_data data, int32_t windGlobal);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_physics_constraint_data_is_wind_global(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_gravity_global(spine_physics_constraint_data data, int32_t gravityGlobal);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_physics_constraint_data_is_gravity_global(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_mix_global(spine_physics_constraint_data data, int32_t mixGlobal);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_physics_constraint_data_is_mix_global(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_inertia_global(spine_physics_constraint_data data, spine_bool inertiaGlobal);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_physics_constraint_data_is_inertia_global(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_strength_global(spine_physics_constraint_data data, spine_bool strengthGlobal);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_physics_constraint_data_is_strength_global(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_damping_global(spine_physics_constraint_data data, spine_bool dampingGlobal);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_physics_constraint_data_is_damping_global(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_mass_global(spine_physics_constraint_data data, spine_bool massGlobal);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_physics_constraint_data_is_mass_global(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_wind_global(spine_physics_constraint_data data, spine_bool windGlobal);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_physics_constraint_data_is_wind_global(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_gravity_global(spine_physics_constraint_data data, spine_bool gravityGlobal);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_physics_constraint_data_is_gravity_global(spine_physics_constraint_data data);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_data_set_mix_global(spine_physics_constraint_data data, spine_bool mixGlobal);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_physics_constraint_data_is_mix_global(spine_physics_constraint_data data);
|
||||
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_set_bone(spine_physics_constraint constraint, spine_bone bone);
|
||||
SPINE_CPP_LITE_EXPORT spine_bone spine_physics_constraint_get_bone(spine_physics_constraint constraint);
|
||||
@ -911,8 +913,8 @@ SPINE_CPP_LITE_EXPORT void spine_physics_constraint_set_gravity(spine_physics_co
|
||||
SPINE_CPP_LITE_EXPORT float spine_physics_constraint_get_gravity(spine_physics_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_set_mix(spine_physics_constraint constraint, float value);
|
||||
SPINE_CPP_LITE_EXPORT float spine_physics_constraint_get_mix(spine_physics_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_set_reset(spine_physics_constraint constraint, int32_t value);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_physics_constraint_get_reset(spine_physics_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_set_reset(spine_physics_constraint constraint, spine_bool value);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_physics_constraint_get_reset(spine_physics_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_set_ux(spine_physics_constraint constraint, float value);
|
||||
SPINE_CPP_LITE_EXPORT float spine_physics_constraint_get_ux(spine_physics_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_set_uy(spine_physics_constraint constraint, float value);
|
||||
@ -941,8 +943,8 @@ SPINE_CPP_LITE_EXPORT void spine_physics_constraint_set_scale_offset(spine_physi
|
||||
SPINE_CPP_LITE_EXPORT float spine_physics_constraint_get_scale_offset(spine_physics_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_set_scale_velocity(spine_physics_constraint constraint, float value);
|
||||
SPINE_CPP_LITE_EXPORT float spine_physics_constraint_get_scale_velocity(spine_physics_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_set_active(spine_physics_constraint constraint, int32_t value);
|
||||
SPINE_CPP_LITE_EXPORT int32_t spine_physics_constraint_is_active(spine_physics_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_set_active(spine_physics_constraint constraint, spine_bool value);
|
||||
SPINE_CPP_LITE_EXPORT spine_bool spine_physics_constraint_is_active(spine_physics_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_set_remaining(spine_physics_constraint constraint, float value);
|
||||
SPINE_CPP_LITE_EXPORT float spine_physics_constraint_get_remaining(spine_physics_constraint constraint);
|
||||
SPINE_CPP_LITE_EXPORT void spine_physics_constraint_set_last_time(spine_physics_constraint constraint, float value);
|
||||
@ -110,7 +110,15 @@ namespace spine {
|
||||
}
|
||||
|
||||
virtual char *_readFile(const String &path, int *length) {
|
||||
return _extension->_readFile(path, length);
|
||||
auto data = _extension->_readFile(path, length);
|
||||
|
||||
if (_allocated.count(data) == 0) {
|
||||
_allocated[data] = Allocation(data, sizeof(char) * (*length), nullptr, 0);
|
||||
_allocations++;
|
||||
_usedMemory += sizeof(char) * (*length);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
size_t getUsedMemory() {
|
||||
|
||||
@ -31,6 +31,7 @@ using System;
|
||||
|
||||
namespace Spine {
|
||||
public class Skeleton {
|
||||
static private readonly int[] quadTriangles = { 0, 1, 2, 2, 3, 0 };
|
||||
internal SkeletonData data;
|
||||
internal ExposedList<Bone> bones;
|
||||
internal ExposedList<Slot> slots;
|
||||
@ -696,7 +697,9 @@ namespace Spine {
|
||||
/// <param name="width">The width of the AABB</param>
|
||||
/// <param name="height">The height of the AABB.</param>
|
||||
/// <param name="vertexBuffer">Reference to hold a float[]. May be a null reference. This method will assign it a new float[] with the appropriate size as needed.</param>
|
||||
public void GetBounds (out float x, out float y, out float width, out float height, ref float[] vertexBuffer) {
|
||||
public void GetBounds (out float x, out float y, out float width, out float height, ref float[] vertexBuffer,
|
||||
SkeletonClipping clipper = null) {
|
||||
|
||||
float[] temp = vertexBuffer;
|
||||
temp = temp ?? new float[8];
|
||||
Slot[] drawOrder = this.drawOrder.Items;
|
||||
@ -706,6 +709,7 @@ namespace Spine {
|
||||
if (!slot.bone.active) continue;
|
||||
int verticesLength = 0;
|
||||
float[] vertices = null;
|
||||
int[] triangles = null;
|
||||
Attachment attachment = slot.attachment;
|
||||
RegionAttachment region = attachment as RegionAttachment;
|
||||
if (region != null) {
|
||||
@ -713,6 +717,7 @@ namespace Spine {
|
||||
vertices = temp;
|
||||
if (vertices.Length < 8) vertices = temp = new float[8];
|
||||
region.ComputeWorldVertices(slot, temp, 0, 2);
|
||||
triangles = quadTriangles;
|
||||
} else {
|
||||
MeshAttachment mesh = attachment as MeshAttachment;
|
||||
if (mesh != null) {
|
||||
@ -720,10 +725,23 @@ namespace Spine {
|
||||
vertices = temp;
|
||||
if (vertices.Length < verticesLength) vertices = temp = new float[verticesLength];
|
||||
mesh.ComputeWorldVertices(slot, 0, verticesLength, temp, 0, 2);
|
||||
triangles = mesh.Triangles;
|
||||
} else if (clipper != null) {
|
||||
ClippingAttachment clip = attachment as ClippingAttachment;
|
||||
if (clip != null) {
|
||||
clipper.ClipStart(slot, clip);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (vertices != null) {
|
||||
if (clipper != null && clipper.IsClipping) {
|
||||
clipper.ClipTriangles(vertices, verticesLength, triangles, triangles.Length);
|
||||
vertices = clipper.ClippedVertices.Items;
|
||||
verticesLength = clipper.ClippedVertices.Count;
|
||||
}
|
||||
|
||||
for (int ii = 0; ii < verticesLength; ii += 2) {
|
||||
float vx = vertices[ii], vy = vertices[ii + 1];
|
||||
minX = Math.Min(minX, vx);
|
||||
@ -732,7 +750,9 @@ namespace Spine {
|
||||
maxY = Math.Max(maxY, vy);
|
||||
}
|
||||
}
|
||||
if (clipper != null) clipper.ClipEnd(slot);
|
||||
}
|
||||
if (clipper != null) clipper.ClipEnd();
|
||||
x = minX;
|
||||
y = minY;
|
||||
width = maxX - minX;
|
||||
|
||||
@ -78,6 +78,73 @@ namespace Spine {
|
||||
clippingPolygon.Clear();
|
||||
}
|
||||
|
||||
public void ClipTriangles (float[] vertices, int verticesLength, int[] triangles, int trianglesLength) {
|
||||
ExposedList<float> clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;
|
||||
ExposedList<int> clippedTriangles = this.clippedTriangles;
|
||||
ExposedList<float>[] polygons = clippingPolygons.Items;
|
||||
int polygonsCount = clippingPolygons.Count;
|
||||
|
||||
int index = 0;
|
||||
clippedVertices.Clear();
|
||||
clippedTriangles.Clear();
|
||||
//outer:
|
||||
for (int i = 0; i < trianglesLength; i += 3) {
|
||||
int vertexOffset = triangles[i] << 1;
|
||||
float x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];
|
||||
|
||||
vertexOffset = triangles[i + 1] << 1;
|
||||
float x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];
|
||||
|
||||
vertexOffset = triangles[i + 2] << 1;
|
||||
float x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];
|
||||
|
||||
for (int p = 0; p < polygonsCount; p++) {
|
||||
int s = clippedVertices.Count;
|
||||
if (Clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {
|
||||
int clipOutputLength = clipOutput.Count;
|
||||
if (clipOutputLength == 0) continue;
|
||||
|
||||
int clipOutputCount = clipOutputLength >> 1;
|
||||
float[] clipOutputItems = clipOutput.Items;
|
||||
float[] clippedVerticesItems = clippedVertices.Resize(s + clipOutputCount * 2).Items;
|
||||
for (int ii = 0; ii < clipOutputLength; ii += 2) {
|
||||
float x = clipOutputItems[ii], y = clipOutputItems[ii + 1];
|
||||
clippedVerticesItems[s] = x;
|
||||
clippedVerticesItems[s + 1] = y;
|
||||
s += 2;
|
||||
}
|
||||
|
||||
s = clippedTriangles.Count;
|
||||
int[] clippedTrianglesItems = clippedTriangles.Resize(s + 3 * (clipOutputCount - 2)).Items;
|
||||
clipOutputCount--;
|
||||
for (int ii = 1; ii < clipOutputCount; ii++) {
|
||||
clippedTrianglesItems[s] = index;
|
||||
clippedTrianglesItems[s + 1] = index + ii;
|
||||
clippedTrianglesItems[s + 2] = index + ii + 1;
|
||||
s += 3;
|
||||
}
|
||||
index += clipOutputCount + 1;
|
||||
} else {
|
||||
float[] clippedVerticesItems = clippedVertices.Resize(s + 3 * 2).Items;
|
||||
clippedVerticesItems[s] = x1;
|
||||
clippedVerticesItems[s + 1] = y1;
|
||||
clippedVerticesItems[s + 2] = x2;
|
||||
clippedVerticesItems[s + 3] = y2;
|
||||
clippedVerticesItems[s + 4] = x3;
|
||||
clippedVerticesItems[s + 5] = y3;
|
||||
|
||||
s = clippedTriangles.Count;
|
||||
int[] clippedTrianglesItems = clippedTriangles.Resize(s + 3).Items;
|
||||
clippedTrianglesItems[s] = index;
|
||||
clippedTrianglesItems[s + 1] = index + 1;
|
||||
clippedTrianglesItems[s + 2] = index + 2;
|
||||
index += 3;
|
||||
break; //continue outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ClipTriangles (float[] vertices, int verticesLength, int[] triangles, int trianglesLength, float[] uvs) {
|
||||
ExposedList<float> clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;
|
||||
ExposedList<int> clippedTriangles = this.clippedTriangles;
|
||||
@ -164,11 +231,10 @@ namespace Spine {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping
|
||||
* area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */
|
||||
///<summary>Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping
|
||||
/// area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list.</summary>
|
||||
internal bool Clip (float x1, float y1, float x2, float y2, float x3, float y3, ExposedList<float> clippingArea, ExposedList<float> output) {
|
||||
ExposedList<float> originalOutput = output;
|
||||
bool clipped = false;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "com.esotericsoftware.spine.spine-csharp",
|
||||
"displayName": "spine-csharp Runtime",
|
||||
"description": "This plugin provides the spine-csharp core runtime.",
|
||||
"version": "4.2.21",
|
||||
"version": "4.2.22",
|
||||
"unity": "2018.3",
|
||||
"author": {
|
||||
"name": "Esoteric Software",
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
# 4.2.24
|
||||
- Support static linking of native library, see https://github.com/EsotericSoftware/spine-runtimes/issues/2438
|
||||
|
||||
# 4.2.23
|
||||
- Physics support
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 351 KiB |
@ -53,6 +53,10 @@ class SpineFlutterFFI {
|
||||
SpineFlutterFFI(this.dylib, this.allocator);
|
||||
}
|
||||
|
||||
Future<SpineFlutterFFI> initSpineFlutterFFI() async {
|
||||
return SpineFlutterFFI(_dylib, malloc);
|
||||
Future<SpineFlutterFFI> initSpineFlutterFFI(bool useStaticLinkage) async {
|
||||
if (useStaticLinkage) {
|
||||
return SpineFlutterFFI(DynamicLibrary.process(), malloc);
|
||||
} else {
|
||||
return SpineFlutterFFI(_dylib, malloc);
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ class SpineFlutterFFI {
|
||||
SpineFlutterFFI(this.dylib, this.allocator);
|
||||
}
|
||||
|
||||
Future<SpineFlutterFFI> initSpineFlutterFFI() async {
|
||||
Future<SpineFlutterFFI> initSpineFlutterFFI(bool useStaticLinkage) async {
|
||||
if (_module == null) {
|
||||
Memory.init();
|
||||
|
||||
|
||||
@ -50,8 +50,8 @@ export 'spine_widget.dart';
|
||||
late SpineFlutterBindings _bindings;
|
||||
late Allocator _allocator;
|
||||
|
||||
Future<void> initSpineFlutter({bool enableMemoryDebugging = false}) async {
|
||||
final ffi = await initSpineFlutterFFI();
|
||||
Future<void> initSpineFlutter({bool useStaticLinkage = false, bool enableMemoryDebugging = false}) async {
|
||||
final ffi = await initSpineFlutterFFI(useStaticLinkage);
|
||||
_bindings = SpineFlutterBindings(ffi.dylib);
|
||||
_allocator = ffi.allocator;
|
||||
if (enableMemoryDebugging) _bindings.spine_enable_debug_extension(-1);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
name: spine_flutter
|
||||
description: The official Spine Flutter Runtime to load, display and interact with Spine animations.
|
||||
version: 4.2.23
|
||||
version: 4.2.24
|
||||
homepage: https://esotericsoftware.com
|
||||
repository: https://github.com/esotericsoftware/spine-runtimes
|
||||
issue_tracker: https://github.com/esotericsoftware/spine-runtimes/issues
|
||||
|
||||
1
spine-godot/build/debug.plist
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>com.apple.security.get-task-allow</key><true/></dict></plist>
|
||||
2
spine-godot/build/sign.sh
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
codesign -s - -v -f --entitlements build/debug.plist godot/bin/godot.macos.editor.dev.arm64
|
||||
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 351 KiB |
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 351 KiB |
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 351 KiB |
@ -101,7 +101,7 @@ void SpineSlotNode::_notification(int what) {
|
||||
void SpineSlotNode::_get_property_list(List<PropertyInfo> *list) const {
|
||||
Vector<String> slot_names;
|
||||
SpineSprite *sprite = cast_to<SpineSprite>(get_parent());
|
||||
if (sprite) sprite->get_skeleton_data_res()->get_slot_names(slot_names);
|
||||
if (sprite && sprite->get_skeleton_data_res().is_valid()) sprite->get_skeleton_data_res()->get_slot_names(slot_names);
|
||||
else
|
||||
slot_names.push_back(slot_name);
|
||||
auto element = list->front();
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
#include "SpineSkeleton.h"
|
||||
#include "SpineRendererObject.h"
|
||||
#include "SpineSlotNode.h"
|
||||
#include "core/os/memory.h"
|
||||
|
||||
#if VERSION_MAJOR > 3
|
||||
#include "core/config/engine.h"
|
||||
@ -1047,14 +1048,6 @@ void SpineSprite::draw() {
|
||||
}
|
||||
|
||||
#if TOOLS_ENABLED
|
||||
Ref<Font> default_font;
|
||||
auto control = memnew(Control);
|
||||
#if VERSION_MAJOR > 3
|
||||
default_font = control->get_theme_default_font();
|
||||
#else
|
||||
default_font = control->get_font(SNAME("font"), SNAME("Label"));
|
||||
#endif
|
||||
memfree(control);
|
||||
|
||||
float editor_scale = EditorInterface::get_singleton()->get_editor_scale();
|
||||
float inverse_zoom = 1 / get_viewport()->get_global_canvas_transform().get_scale().x * editor_scale;
|
||||
@ -1074,6 +1067,15 @@ void SpineSprite::draw() {
|
||||
auto global_scale = get_global_scale();
|
||||
draw_set_transform(mouse_position + Vector2(20, 0), -get_global_rotation(), Vector2(inverse_zoom * (1 / global_scale.x), inverse_zoom * (1 / global_scale.y)));
|
||||
|
||||
Ref<Font> default_font;
|
||||
auto control = memnew(Control);
|
||||
#if VERSION_MAJOR > 3
|
||||
default_font = control->get_theme_default_font();
|
||||
#else
|
||||
default_font = control->get_font(SNAME("font"), SNAME("Label"));
|
||||
#endif
|
||||
memdelete(control);
|
||||
|
||||
#if VERSION_MAJOR > 3
|
||||
float line_height = default_font->get_height(Font::DEFAULT_FONT_SIZE) + default_font->get_descent(Font::DEFAULT_FONT_SIZE);
|
||||
#else
|
||||
|
||||
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 351 KiB |
103
spine-haxe/example/src/AnimationBoundExample.hx
Normal file
@ -0,0 +1,103 @@
|
||||
/******************************************************************************
|
||||
* Spine Runtimes License Agreement
|
||||
* Last updated July 28, 2023. Replaces all prior versions.
|
||||
*
|
||||
* Copyright (c) 2013-2023, 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.
|
||||
*****************************************************************************/
|
||||
|
||||
import Scene.SceneManager;
|
||||
import openfl.utils.Assets;
|
||||
import spine.SkeletonData;
|
||||
import spine.Physics;
|
||||
import spine.animation.AnimationStateData;
|
||||
import spine.atlas.TextureAtlas;
|
||||
import spine.starling.SkeletonSprite;
|
||||
import spine.starling.StarlingTextureLoader;
|
||||
import starling.core.Starling;
|
||||
import starling.events.TouchEvent;
|
||||
import starling.events.TouchPhase;
|
||||
import starling.display.Quad;
|
||||
|
||||
class AnimationBoundExample extends Scene {
|
||||
var loadBinary = false;
|
||||
var skeletonSpriteClipping: SkeletonSprite;
|
||||
var skeletonSpriteNoClipping: SkeletonSprite;
|
||||
public function load():Void {
|
||||
background.color = 0x333333;
|
||||
var scale = .2;
|
||||
|
||||
var atlas = new TextureAtlas(Assets.getText("assets/spineboy.atlas"), new StarlingTextureLoader("assets/spineboy.atlas"));
|
||||
var skeletondata = SkeletonData.from(Assets.getText("assets/spineboy-pro.json"), atlas);
|
||||
|
||||
var animationStateDataClipping = new AnimationStateData(skeletondata);
|
||||
animationStateDataClipping.defaultMix = 0.25;
|
||||
|
||||
skeletonSpriteClipping = new SkeletonSprite(skeletondata, animationStateDataClipping);
|
||||
skeletonSpriteClipping.skeleton.updateWorldTransform(Physics.update);
|
||||
|
||||
skeletonSpriteClipping.scale = scale;
|
||||
skeletonSpriteClipping.x = Starling.current.stage.stageWidth / 3 * 2;
|
||||
skeletonSpriteClipping.y = Starling.current.stage.stageHeight / 2;
|
||||
|
||||
var animationClipping = skeletonSpriteClipping.state.setAnimationByName(0, "portal", true).animation;
|
||||
var animationBoundClipping = skeletonSpriteClipping.getAnimationBounds(animationClipping, true);
|
||||
var quad:Quad = new Quad(animationBoundClipping.width * scale, animationBoundClipping.height * scale, 0xc70000);
|
||||
quad.x = skeletonSpriteClipping.x + animationBoundClipping.x * scale;
|
||||
quad.y = skeletonSpriteClipping.y + animationBoundClipping.y * scale;
|
||||
|
||||
var animationStateDataNoClipping = new AnimationStateData(skeletondata);
|
||||
animationStateDataNoClipping.defaultMix = 0.25;
|
||||
skeletonSpriteNoClipping = new SkeletonSprite(skeletondata, animationStateDataNoClipping);
|
||||
skeletonSpriteNoClipping.skeleton.updateWorldTransform(Physics.update);
|
||||
skeletonSpriteNoClipping.scale = scale;
|
||||
skeletonSpriteNoClipping.x = Starling.current.stage.stageWidth / 3;
|
||||
skeletonSpriteNoClipping.y = Starling.current.stage.stageHeight / 2;
|
||||
|
||||
var animationNoClipping = skeletonSpriteNoClipping.state.setAnimationByName(0, "portal", true).animation;
|
||||
var animationBoundNoClipping = skeletonSpriteNoClipping.getAnimationBounds(animationNoClipping, false);
|
||||
var quadNoClipping:Quad = new Quad(animationBoundNoClipping.width * scale, animationBoundNoClipping.height * scale, 0xc70000);
|
||||
quadNoClipping.x = skeletonSpriteNoClipping.x + animationBoundNoClipping.x * scale;
|
||||
quadNoClipping.y = skeletonSpriteNoClipping.y + animationBoundNoClipping.y * scale;
|
||||
|
||||
addChild(quad);
|
||||
addChild(quadNoClipping);
|
||||
addChild(skeletonSpriteClipping);
|
||||
addChild(skeletonSpriteNoClipping);
|
||||
addText("Animation bound without clipping", 75, 350);
|
||||
addText("Animation bound with clipping", 370, 350);
|
||||
addText("Red area is the animation bound", 240, 400);
|
||||
|
||||
juggler.add(skeletonSpriteClipping);
|
||||
juggler.add(skeletonSpriteNoClipping);
|
||||
addEventListener(TouchEvent.TOUCH, onTouch);
|
||||
}
|
||||
|
||||
public function onTouch(e:TouchEvent) {
|
||||
var touch = e.getTouch(this);
|
||||
if (touch != null && touch.phase == TouchPhase.ENDED) {
|
||||
SceneManager.getInstance().switchScene(new BasicExample());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -72,7 +72,7 @@ class CloudPotExample extends Scene {
|
||||
public function onTouch(e:TouchEvent) {
|
||||
var touch = e.getTouch(this);
|
||||
if (touch != null && touch.phase == TouchPhase.ENDED) {
|
||||
SceneManager.getInstance().switchScene(new BasicExample());
|
||||
SceneManager.getInstance().switchScene(new AnimationBoundExample());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,17 +47,18 @@ class IkConstraint implements Updatable {
|
||||
if (skeleton == null)
|
||||
throw new SpineException("skeleton cannot be null.");
|
||||
_data = data;
|
||||
mix = data.mix;
|
||||
softness = data.softness;
|
||||
bendDirection = data.bendDirection;
|
||||
compress = data.compress;
|
||||
stretch = data.stretch;
|
||||
|
||||
bones = new Array<Bone>();
|
||||
for (boneData in data.bones) {
|
||||
bones.push(skeleton.findBone(boneData.name));
|
||||
}
|
||||
target = skeleton.findBone(data.target.name);
|
||||
|
||||
mix = data.mix;
|
||||
softness = data.softness;
|
||||
bendDirection = data.bendDirection;
|
||||
compress = data.compress;
|
||||
stretch = data.stretch;
|
||||
}
|
||||
|
||||
public function isActive():Bool {
|
||||
|
||||
@ -62,11 +62,13 @@ class PathConstraint implements Updatable {
|
||||
if (skeleton == null)
|
||||
throw new SpineException("skeleton cannot be null.");
|
||||
_data = data;
|
||||
|
||||
_bones = new Array<Bone>();
|
||||
for (boneData in data.bones) {
|
||||
_bones.push(skeleton.findBone(boneData.name));
|
||||
}
|
||||
target = skeleton.findSlot(data.target.name);
|
||||
|
||||
position = data.position;
|
||||
spacing = data.spacing;
|
||||
mixRotate = data.mixRotate;
|
||||
|
||||
@ -67,7 +67,9 @@ class PhysicsConstraint implements Updatable {
|
||||
public function new(data: PhysicsConstraintData, skeleton: Skeleton) {
|
||||
_data = data;
|
||||
_skeleton = skeleton;
|
||||
|
||||
_bone = skeleton.bones[data.bone.index];
|
||||
|
||||
inertia = data.inertia;
|
||||
strength = data.strength;
|
||||
damping = data.damping;
|
||||
|
||||
@ -32,11 +32,13 @@ package spine;
|
||||
import lime.math.Rectangle;
|
||||
import haxe.ds.StringMap;
|
||||
import spine.attachments.Attachment;
|
||||
import spine.attachments.ClippingAttachment;
|
||||
import spine.attachments.MeshAttachment;
|
||||
import spine.attachments.PathAttachment;
|
||||
import spine.attachments.RegionAttachment;
|
||||
|
||||
class Skeleton {
|
||||
private static var quadTriangles:Array<Int> = [0, 1, 2, 2, 3, 0];
|
||||
private var _data:SkeletonData;
|
||||
|
||||
public var bones:Array<Bone>;
|
||||
@ -611,7 +613,7 @@ class Skeleton {
|
||||
private var _tempVertices = new Array<Float>();
|
||||
private var _bounds = new Rectangle();
|
||||
|
||||
public function getBounds():Rectangle {
|
||||
public function getBounds(clipper: SkeletonClipping = null):Rectangle {
|
||||
var minX:Float = Math.POSITIVE_INFINITY;
|
||||
var minY:Float = Math.POSITIVE_INFINITY;
|
||||
var maxX:Float = Math.NEGATIVE_INFINITY;
|
||||
@ -619,20 +621,33 @@ class Skeleton {
|
||||
for (slot in drawOrder) {
|
||||
var verticesLength:Int = 0;
|
||||
var vertices:Array<Float> = null;
|
||||
var triangles:Array<Int> = null;
|
||||
var attachment:Attachment = slot.attachment;
|
||||
|
||||
if (Std.isOfType(attachment, RegionAttachment)) {
|
||||
verticesLength = 8;
|
||||
_tempVertices.resize(verticesLength);
|
||||
vertices = _tempVertices;
|
||||
cast(attachment, RegionAttachment).computeWorldVertices(slot, vertices, 0, 2);
|
||||
triangles = Skeleton.quadTriangles;
|
||||
} else if (Std.isOfType(attachment, MeshAttachment)) {
|
||||
var mesh:MeshAttachment = cast(attachment, MeshAttachment);
|
||||
verticesLength = mesh.worldVerticesLength;
|
||||
_tempVertices.resize(verticesLength);
|
||||
vertices = _tempVertices;
|
||||
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
||||
triangles = mesh.triangles;
|
||||
} else if (Std.isOfType(attachment, ClippingAttachment) && clipper != null) {
|
||||
clipper.clipStart(slot, cast(attachment, ClippingAttachment));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (vertices != null) {
|
||||
if (clipper != null && clipper.isClipping()) {
|
||||
clipper.clipTriangles(vertices, triangles, triangles.length);
|
||||
vertices = clipper.clippedVertices;
|
||||
verticesLength = clipper.clippedVertices.length;
|
||||
}
|
||||
var ii:Int = 0;
|
||||
var nn:Int = vertices.length;
|
||||
while (ii < nn) {
|
||||
@ -644,7 +659,9 @@ class Skeleton {
|
||||
ii += 2;
|
||||
}
|
||||
}
|
||||
if (clipper != null) clipper.clipEndWithSlot(slot);
|
||||
}
|
||||
if (clipper != null) clipper.clipEnd();
|
||||
_bounds.x = minX;
|
||||
_bounds.y = minY;
|
||||
_bounds.width = maxX - minX;
|
||||
|
||||
@ -84,7 +84,91 @@ class SkeletonClipping {
|
||||
return clipAttachment != null;
|
||||
}
|
||||
|
||||
public function clipTriangles(vertices:Array<Float>, triangles:Array<Int>, trianglesLength:Float, uvs:Array<Float>):Void {
|
||||
private function clipTrianglesNoRender(vertices:Array<Float>, triangles:Array<Int>, trianglesLength:Float):Void {
|
||||
var polygonsCount:Int = clippingPolygons.length;
|
||||
var index:Int = 0;
|
||||
clippedVertices.resize(0);
|
||||
clippedUvs.resize(0);
|
||||
clippedTriangles.resize(0);
|
||||
var i:Int = 0;
|
||||
while (i < trianglesLength) {
|
||||
var vertexOffset:Int = triangles[i] << 1;
|
||||
var x1:Float = vertices[vertexOffset],
|
||||
y1:Float = vertices[vertexOffset + 1];
|
||||
|
||||
vertexOffset = triangles[i + 1] << 1;
|
||||
var x2:Float = vertices[vertexOffset],
|
||||
y2:Float = vertices[vertexOffset + 1];
|
||||
|
||||
vertexOffset = triangles[i + 2] << 1;
|
||||
var x3:Float = vertices[vertexOffset],
|
||||
y3:Float = vertices[vertexOffset + 1];
|
||||
|
||||
for (p in 0...polygonsCount) {
|
||||
var s:Int = clippedVertices.length;
|
||||
var clippedVerticesItems:Array<Float>;
|
||||
var clippedTrianglesItems:Array<Int>;
|
||||
if (this.clip(x1, y1, x2, y2, x3, y3, clippingPolygons[p], clipOutput)) {
|
||||
var clipOutputLength:Int = clipOutput.length;
|
||||
if (clipOutputLength == 0)
|
||||
continue;
|
||||
|
||||
var clipOutputCount:Int = clipOutputLength >> 1;
|
||||
var clipOutputItems:Array<Float> = clipOutput;
|
||||
clippedVerticesItems = clippedVertices;
|
||||
clippedVerticesItems.resize(s + clipOutputLength);
|
||||
var ii:Int = 0;
|
||||
while (ii < clipOutputLength) {
|
||||
var x:Float = clipOutputItems[ii],
|
||||
y:Float = clipOutputItems[ii + 1];
|
||||
clippedVerticesItems[s] = x;
|
||||
clippedVerticesItems[s + 1] = y;
|
||||
s += 2;
|
||||
ii += 2;
|
||||
}
|
||||
|
||||
s = clippedTriangles.length;
|
||||
clippedTrianglesItems = clippedTriangles;
|
||||
clippedTrianglesItems.resize(s + 3 * (clipOutputCount - 2));
|
||||
clipOutputCount--;
|
||||
for (ii in 1...clipOutputCount) {
|
||||
clippedTrianglesItems[s] = index;
|
||||
clippedTrianglesItems[s + 1] = (index + ii);
|
||||
clippedTrianglesItems[s + 2] = (index + ii + 1);
|
||||
s += 3;
|
||||
}
|
||||
index += clipOutputCount + 1;
|
||||
} else {
|
||||
clippedVerticesItems = clippedVertices;
|
||||
clippedVerticesItems.resize(s + 3 * 2);
|
||||
clippedVerticesItems[s] = x1;
|
||||
clippedVerticesItems[s + 1] = y1;
|
||||
clippedVerticesItems[s + 2] = x2;
|
||||
clippedVerticesItems[s + 3] = y2;
|
||||
clippedVerticesItems[s + 4] = x3;
|
||||
clippedVerticesItems[s + 5] = y3;
|
||||
|
||||
s = clippedTriangles.length;
|
||||
clippedTrianglesItems = clippedTriangles;
|
||||
clippedTrianglesItems.resize(s + 3);
|
||||
clippedTrianglesItems[s] = index;
|
||||
clippedTrianglesItems[s + 1] = (index + 1);
|
||||
clippedTrianglesItems[s + 2] = (index + 2);
|
||||
index += 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
i += 3;
|
||||
}
|
||||
}
|
||||
|
||||
public function clipTriangles(vertices:Array<Float>, triangles:Array<Int>, trianglesLength:Float, uvs:Array<Float> = null):Void {
|
||||
if (uvs == null) {
|
||||
clipTrianglesNoRender(vertices, triangles, trianglesLength);
|
||||
return;
|
||||
}
|
||||
|
||||
var polygonsCount:Int = clippingPolygons.length;
|
||||
var index:Int = 0;
|
||||
clippedVertices.resize(0);
|
||||
|
||||
@ -51,17 +51,19 @@ class TransformConstraint implements Updatable {
|
||||
if (skeleton == null)
|
||||
throw new SpineException("skeleton cannot be null.");
|
||||
_data = data;
|
||||
|
||||
_bones = new Array<Bone>();
|
||||
for (boneData in data.bones) {
|
||||
_bones.push(skeleton.findBone(boneData.name));
|
||||
}
|
||||
target = skeleton.findBone(data.target.name);
|
||||
|
||||
mixRotate = data.mixRotate;
|
||||
mixX = data.mixX;
|
||||
mixY = data.mixY;
|
||||
mixScaleX = data.mixScaleX;
|
||||
mixScaleY = data.mixScaleY;
|
||||
mixShearY = data.mixShearY;
|
||||
_bones = new Array<Bone>();
|
||||
for (boneData in data.bones) {
|
||||
_bones.push(skeleton.findBone(boneData.name));
|
||||
}
|
||||
target = skeleton.findBone(data.target.name);
|
||||
}
|
||||
|
||||
public function isActive():Bool {
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
|
||||
package spine.starling;
|
||||
|
||||
import spine.animation.Animation;
|
||||
import starling.animation.IAnimatable;
|
||||
import openfl.geom.Matrix;
|
||||
import openfl.geom.Point;
|
||||
@ -40,6 +41,8 @@ import spine.SkeletonData;
|
||||
import spine.Slot;
|
||||
import spine.animation.AnimationState;
|
||||
import spine.animation.AnimationStateData;
|
||||
import spine.animation.MixBlend;
|
||||
import spine.animation.MixDirection;
|
||||
import spine.attachments.Attachment;
|
||||
import spine.attachments.ClippingAttachment;
|
||||
import spine.attachments.MeshAttachment;
|
||||
@ -66,7 +69,7 @@ class SkeletonSprite extends DisplayObject implements IAnimatable {
|
||||
|
||||
private var _smoothing:String = "bilinear";
|
||||
|
||||
private static var clipper:SkeletonClipping = new SkeletonClipping();
|
||||
public static var clipper(default, never):SkeletonClipping = new SkeletonClipping();
|
||||
private static var QUAD_INDICES:Array<Int> = [0, 1, 2, 2, 3, 0];
|
||||
|
||||
private var tempLight:spine.Color = new spine.Color(0, 0, 0);
|
||||
@ -314,6 +317,33 @@ class SkeletonSprite extends DisplayObject implements IAnimatable {
|
||||
return resultRect;
|
||||
}
|
||||
|
||||
public function getAnimationBounds(animation:Animation, clip:Bool = true): Rectangle {
|
||||
var clipper = clip ? SkeletonSprite.clipper : null;
|
||||
_skeleton.setToSetupPose();
|
||||
|
||||
var steps = 100, time = 0.;
|
||||
var stepTime = animation.duration != 0 ? animation.duration / steps : 0;
|
||||
var minX = 100000000., maxX = -100000000., minY = 100000000., maxY = -100000000.;
|
||||
|
||||
var bound:lime.math.Rectangle;
|
||||
for (i in 0...steps) {
|
||||
animation.apply(_skeleton, time , time, false, [], 1, MixBlend.setup, MixDirection.mixIn);
|
||||
_skeleton.updateWorldTransform(Physics.update);
|
||||
bound = _skeleton.getBounds(clipper);
|
||||
|
||||
if (!Math.isNaN(bound.x) && !Math.isNaN(bound.y) && !Math.isNaN(bound.width) && !Math.isNaN(bound.height)) {
|
||||
minX = Math.min(bound.x, minX);
|
||||
minY = Math.min(bound.y, minY);
|
||||
maxX = Math.max(bound.right, maxX);
|
||||
maxY = Math.max(bound.bottom, maxY);
|
||||
} else
|
||||
trace("ERROR");
|
||||
|
||||
time += stepTime;
|
||||
}
|
||||
return new Rectangle(minX, minY, maxX - minX, maxY - minY);
|
||||
}
|
||||
|
||||
public var skeleton(get, never):Skeleton;
|
||||
|
||||
private function get_skeleton():Skeleton {
|
||||
|
||||
|
Before Width: | Height: | Size: 369 KiB After Width: | Height: | Size: 379 KiB |
@ -38,16 +38,15 @@ import com.badlogic.gdx.utils.FloatArray;
|
||||
import com.badlogic.gdx.utils.Null;
|
||||
|
||||
import com.esotericsoftware.spine.Skin.SkinEntry;
|
||||
import com.esotericsoftware.spine.attachments.Attachment;
|
||||
import com.esotericsoftware.spine.attachments.MeshAttachment;
|
||||
import com.esotericsoftware.spine.attachments.PathAttachment;
|
||||
import com.esotericsoftware.spine.attachments.RegionAttachment;
|
||||
import com.esotericsoftware.spine.attachments.*;
|
||||
import com.esotericsoftware.spine.utils.SkeletonClipping;
|
||||
|
||||
/** Stores the current pose for a skeleton.
|
||||
* <p>
|
||||
* See <a href="http://esotericsoftware.com/spine-runtime-architecture#Instance-objects">Instance objects</a> in the Spine
|
||||
* Runtimes Guide. */
|
||||
public class Skeleton {
|
||||
static private final short[] quadTriangles = {0, 1, 2, 2, 3, 0};
|
||||
final SkeletonData data;
|
||||
final Array<Bone> bones;
|
||||
final Array<Slot> slots;
|
||||
@ -689,6 +688,16 @@ public class Skeleton {
|
||||
* @param size An output value, the width and height of the AABB.
|
||||
* @param temp Working memory to temporarily store attachments' computed world vertices. */
|
||||
public void getBounds (Vector2 offset, Vector2 size, FloatArray temp) {
|
||||
getBounds(offset, size, temp, null);
|
||||
}
|
||||
|
||||
/** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose. Optionally applies
|
||||
* clipping.
|
||||
* @param offset An output value, the distance from the skeleton origin to the bottom left corner of the AABB.
|
||||
* @param size An output value, the width and height of the AABB.
|
||||
* @param temp Working memory to temporarily store attachments' computed world vertices.
|
||||
* @param clipper {@link SkeletonClipping} to use. If <code>null</code>, no clipping is applied. */
|
||||
public void getBounds (Vector2 offset, Vector2 size, FloatArray temp, SkeletonClipping clipper) {
|
||||
if (offset == null) throw new IllegalArgumentException("offset cannot be null.");
|
||||
if (size == null) throw new IllegalArgumentException("size cannot be null.");
|
||||
if (temp == null) throw new IllegalArgumentException("temp cannot be null.");
|
||||
@ -699,19 +708,31 @@ public class Skeleton {
|
||||
if (!slot.bone.active) continue;
|
||||
int verticesLength = 0;
|
||||
float[] vertices = null;
|
||||
short[] triangles = null;
|
||||
Attachment attachment = slot.attachment;
|
||||
if (attachment instanceof RegionAttachment) {
|
||||
RegionAttachment region = (RegionAttachment)attachment;
|
||||
verticesLength = 8;
|
||||
vertices = temp.setSize(8);
|
||||
region.computeWorldVertices(slot, vertices, 0, 2);
|
||||
triangles = quadTriangles;
|
||||
} else if (attachment instanceof MeshAttachment) {
|
||||
MeshAttachment mesh = (MeshAttachment)attachment;
|
||||
verticesLength = mesh.getWorldVerticesLength();
|
||||
vertices = temp.setSize(verticesLength);
|
||||
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
||||
triangles = mesh.getTriangles();
|
||||
} else if (attachment instanceof ClippingAttachment && clipper != null) {
|
||||
ClippingAttachment clip = (ClippingAttachment)attachment;
|
||||
clipper.clipStart(slot, clip);
|
||||
continue;
|
||||
}
|
||||
if (vertices != null) {
|
||||
if (clipper != null && clipper.isClipping()) {
|
||||
clipper.clipTriangles(vertices, triangles, triangles.length);
|
||||
vertices = clipper.getClippedVertices().items;
|
||||
verticesLength = clipper.getClippedVertices().size;
|
||||
}
|
||||
for (int ii = 0; ii < verticesLength; ii += 2) {
|
||||
float x = vertices[ii], y = vertices[ii + 1];
|
||||
minX = Math.min(minX, x);
|
||||
@ -720,7 +741,9 @@ public class Skeleton {
|
||||
maxY = Math.max(maxY, y);
|
||||
}
|
||||
}
|
||||
if (clipper != null) clipper.clipEnd(slot);
|
||||
}
|
||||
if (clipper != null) clipper.clipEnd();
|
||||
offset.set(minX, minY);
|
||||
size.set(maxX - minX, maxY - minY);
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ public class SkeletonRenderer {
|
||||
| (int)(r * slotColor.r * color.r * multiplier));
|
||||
|
||||
if (clipper.isClipping()) {
|
||||
clipper.clipTriangles(vertices, verticesLength, triangles, triangles.length, uvs, c, 0, false);
|
||||
clipper.clipTriangles(vertices, triangles, triangles.length, uvs, c, 0, false);
|
||||
FloatArray clippedVertices = clipper.getClippedVertices();
|
||||
ShortArray clippedTriangles = clipper.getClippedTriangles();
|
||||
batch.draw(texture, clippedVertices.items, 0, clippedVertices.size, clippedTriangles.items, 0,
|
||||
@ -311,7 +311,7 @@ public class SkeletonRenderer {
|
||||
| (int)(red * darkColor.r));
|
||||
|
||||
if (clipper.isClipping()) {
|
||||
clipper.clipTriangles(vertices, verticesLength, triangles, triangles.length, uvs, light, dark, true);
|
||||
clipper.clipTriangles(vertices, triangles, triangles.length, uvs, light, dark, true);
|
||||
FloatArray clippedVertices = clipper.getClippedVertices();
|
||||
ShortArray clippedTriangles = clipper.getClippedTriangles();
|
||||
batch.drawTwoColor(texture, clippedVertices.items, 0, clippedVertices.size, clippedTriangles.items, 0,
|
||||
@ -357,4 +357,10 @@ public class SkeletonRenderer {
|
||||
pmaColors = pmaColorsAndBlendModes;
|
||||
pmaBlendModes = pmaColorsAndBlendModes;
|
||||
}
|
||||
|
||||
/** Returns the {@link SkeletonClipping} used by this renderer for use with e.g.
|
||||
* {@link Skeleton#getBounds(com.badlogic.gdx.math.Vector2, com.badlogic.gdx.math.Vector2, FloatArray, SkeletonClipping)} **/
|
||||
public SkeletonClipping getSkeletonClipping () {
|
||||
return clipper;
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,8 +82,75 @@ public class SkeletonClipping {
|
||||
return clipAttachment != null;
|
||||
}
|
||||
|
||||
public void clipTriangles (float[] vertices, int verticesLength, short[] triangles, int trianglesLength, float[] uvs,
|
||||
float light, float dark, boolean twoColor) {
|
||||
public void clipTriangles (float[] vertices, short[] triangles, int trianglesLength) {
|
||||
FloatArray clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;
|
||||
ShortArray clippedTriangles = this.clippedTriangles;
|
||||
Object[] polygons = clippingPolygons.items;
|
||||
int polygonsCount = clippingPolygons.size;
|
||||
|
||||
short index = 0;
|
||||
clippedVertices.clear();
|
||||
clippedTriangles.clear();
|
||||
for (int i = 0; i < trianglesLength; i += 3) {
|
||||
int vertexOffset = triangles[i] << 1;
|
||||
float x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];
|
||||
|
||||
vertexOffset = triangles[i + 1] << 1;
|
||||
float x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];
|
||||
|
||||
vertexOffset = triangles[i + 2] << 1;
|
||||
float x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];
|
||||
|
||||
for (int p = 0; p < polygonsCount; p++) {
|
||||
int s = clippedVertices.size;
|
||||
if (clip(x1, y1, x2, y2, x3, y3, (FloatArray)polygons[p], clipOutput)) {
|
||||
int clipOutputLength = clipOutput.size;
|
||||
if (clipOutputLength == 0) continue;
|
||||
|
||||
int clipOutputCount = clipOutputLength >> 1;
|
||||
float[] clipOutputItems = clipOutput.items;
|
||||
float[] clippedVerticesItems = clippedVertices.setSize(s + clipOutputCount * 2);
|
||||
for (int ii = 0; ii < clipOutputLength; ii += 2, s += 2) {
|
||||
float x = clipOutputItems[ii], y = clipOutputItems[ii + 1];
|
||||
clippedVerticesItems[s] = x;
|
||||
clippedVerticesItems[s + 1] = y;
|
||||
}
|
||||
|
||||
s = clippedTriangles.size;
|
||||
short[] clippedTrianglesItems = clippedTriangles.setSize(s + 3 * (clipOutputCount - 2));
|
||||
clipOutputCount--;
|
||||
for (int ii = 1; ii < clipOutputCount; ii++, s += 3) {
|
||||
clippedTrianglesItems[s] = index;
|
||||
clippedTrianglesItems[s + 1] = (short)(index + ii);
|
||||
clippedTrianglesItems[s + 2] = (short)(index + ii + 1);
|
||||
}
|
||||
index += clipOutputCount + 1;
|
||||
|
||||
} else {
|
||||
float[] clippedVerticesItems = clippedVertices.setSize(s + 3 * 2);
|
||||
clippedVerticesItems[s] = x1;
|
||||
clippedVerticesItems[s + 1] = y1;
|
||||
|
||||
clippedVerticesItems[s + 2] = x2;
|
||||
clippedVerticesItems[s + 3] = y2;
|
||||
|
||||
clippedVerticesItems[s + 4] = x3;
|
||||
clippedVerticesItems[s + 5] = y3;
|
||||
|
||||
s = clippedTriangles.size;
|
||||
short[] clippedTrianglesItems = clippedTriangles.setSize(s + 3);
|
||||
clippedTrianglesItems[s] = index;
|
||||
clippedTrianglesItems[s + 1] = (short)(index + 1);
|
||||
clippedTrianglesItems[s + 2] = (short)(index + 2);
|
||||
index += 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void clipTriangles (float[] vertices, short[] triangles, int trianglesLength, float[] uvs, float light, float dark,
|
||||
boolean twoColor) {
|
||||
|
||||
FloatArray clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;
|
||||
ShortArray clippedTriangles = this.clippedTriangles;
|
||||
@ -94,7 +161,6 @@ public class SkeletonClipping {
|
||||
short index = 0;
|
||||
clippedVertices.clear();
|
||||
clippedTriangles.clear();
|
||||
outer:
|
||||
for (int i = 0; i < trianglesLength; i += 3) {
|
||||
int vertexOffset = triangles[i] << 1;
|
||||
float x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];
|
||||
@ -119,7 +185,7 @@ public class SkeletonClipping {
|
||||
int clipOutputCount = clipOutputLength >> 1;
|
||||
float[] clipOutputItems = clipOutput.items;
|
||||
float[] clippedVerticesItems = clippedVertices.setSize(s + clipOutputCount * vertexSize);
|
||||
for (int ii = 0; ii < clipOutputLength; ii += 2) {
|
||||
for (int ii = 0; ii < clipOutputLength; ii += 2, s += 2) {
|
||||
float x = clipOutputItems[ii], y = clipOutputItems[ii + 1];
|
||||
clippedVerticesItems[s] = x;
|
||||
clippedVerticesItems[s + 1] = y;
|
||||
@ -135,17 +201,15 @@ public class SkeletonClipping {
|
||||
float c = 1 - a - b;
|
||||
clippedVerticesItems[s] = u1 * a + u2 * b + u3 * c;
|
||||
clippedVerticesItems[s + 1] = v1 * a + v2 * b + v3 * c;
|
||||
s += 2;
|
||||
}
|
||||
|
||||
s = clippedTriangles.size;
|
||||
short[] clippedTrianglesItems = clippedTriangles.setSize(s + 3 * (clipOutputCount - 2));
|
||||
clipOutputCount--;
|
||||
for (int ii = 1; ii < clipOutputCount; ii++) {
|
||||
for (int ii = 1; ii < clipOutputCount; ii++, s += 3) {
|
||||
clippedTrianglesItems[s] = index;
|
||||
clippedTrianglesItems[s + 1] = (short)(index + ii);
|
||||
clippedTrianglesItems[s + 2] = (short)(index + ii + 1);
|
||||
s += 3;
|
||||
}
|
||||
index += clipOutputCount + 1;
|
||||
|
||||
@ -195,7 +259,7 @@ public class SkeletonClipping {
|
||||
clippedTrianglesItems[s + 1] = (short)(index + 1);
|
||||
clippedTrianglesItems[s + 2] = (short)(index + 2);
|
||||
index += 3;
|
||||
continue outer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 351 KiB |
@ -41,6 +41,11 @@ namespace Spine {
|
||||
private const int BR = 3;
|
||||
|
||||
SkeletonClipping clipper = new SkeletonClipping();
|
||||
/// <summary>Returns the <see cref="SkeletonClipping"/> used by this renderer for use with e.g.
|
||||
/// <see cref="Skeleton.GetBounds(out float, out float, out float, out float, ref float[], SkeletonClipping)"/>
|
||||
/// </summary>
|
||||
public SkeletonClipping SkeletonClipping { get { return clipper; } }
|
||||
|
||||
GraphicsDevice device;
|
||||
MeshBatcher batcher;
|
||||
public MeshBatcher Batcher { get { return batcher; } }
|
||||
|
||||
|
Before Width: | Height: | Size: 369 KiB After Width: | Height: | Size: 379 KiB |
|
Before Width: | Height: | Size: 369 KiB After Width: | Height: | Size: 379 KiB |
34
spine-ts/package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@esotericsoftware/spine-ts",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@esotericsoftware/spine-ts",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"license": "LicenseRef-LICENSE",
|
||||
"workspaces": [
|
||||
"spine-core",
|
||||
@ -2989,33 +2989,33 @@
|
||||
},
|
||||
"spine-canvas": {
|
||||
"name": "@esotericsoftware/spine-canvas",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"license": "LicenseRef-LICENSE",
|
||||
"dependencies": {
|
||||
"@esotericsoftware/spine-core": "4.2.39"
|
||||
"@esotericsoftware/spine-core": "4.2.40"
|
||||
}
|
||||
},
|
||||
"spine-core": {
|
||||
"name": "@esotericsoftware/spine-core",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"license": "LicenseRef-LICENSE"
|
||||
},
|
||||
"spine-phaser": {
|
||||
"name": "@esotericsoftware/spine-phaser",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"license": "LicenseRef-LICENSE",
|
||||
"dependencies": {
|
||||
"@esotericsoftware/spine-canvas": "4.2.39",
|
||||
"@esotericsoftware/spine-core": "4.2.39",
|
||||
"@esotericsoftware/spine-webgl": "4.2.39"
|
||||
"@esotericsoftware/spine-canvas": "4.2.40",
|
||||
"@esotericsoftware/spine-core": "4.2.40",
|
||||
"@esotericsoftware/spine-webgl": "4.2.40"
|
||||
}
|
||||
},
|
||||
"spine-pixi": {
|
||||
"name": "@esotericsoftware/spine-pixi",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"license": "LicenseRef-LICENSE",
|
||||
"dependencies": {
|
||||
"@esotericsoftware/spine-core": "4.2.39"
|
||||
"@esotericsoftware/spine-core": "4.2.40"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@pixi/assets": "^7.2.4",
|
||||
@ -3028,26 +3028,26 @@
|
||||
},
|
||||
"spine-player": {
|
||||
"name": "@esotericsoftware/spine-player",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"license": "LicenseRef-LICENSE",
|
||||
"dependencies": {
|
||||
"@esotericsoftware/spine-webgl": "4.2.39"
|
||||
"@esotericsoftware/spine-webgl": "4.2.40"
|
||||
}
|
||||
},
|
||||
"spine-threejs": {
|
||||
"name": "@esotericsoftware/spine-threejs",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"license": "LicenseRef-LICENSE",
|
||||
"dependencies": {
|
||||
"@esotericsoftware/spine-core": "4.2.39"
|
||||
"@esotericsoftware/spine-core": "4.2.40"
|
||||
}
|
||||
},
|
||||
"spine-webgl": {
|
||||
"name": "@esotericsoftware/spine-webgl",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"license": "LicenseRef-LICENSE",
|
||||
"dependencies": {
|
||||
"@esotericsoftware/spine-core": "4.2.39"
|
||||
"@esotericsoftware/spine-core": "4.2.40"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@esotericsoftware/spine-ts",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"description": "The official Spine Runtimes for the web.",
|
||||
"type": "module",
|
||||
"files": [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@esotericsoftware/spine-canvas",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"description": "The official Spine Runtimes for the web.",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
@ -31,6 +31,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
|
||||
"dependencies": {
|
||||
"@esotericsoftware/spine-core": "4.2.39"
|
||||
"@esotericsoftware/spine-core": "4.2.40"
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@esotericsoftware/spine-core",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"description": "The official Spine Runtimes for the web.",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
||||
@ -951,7 +951,11 @@ export class TrackEntry {
|
||||
|
||||
set mixDuration (mixDuration: number) {
|
||||
this._mixDuration = mixDuration;
|
||||
if (this.previous != null && this.delay <= 0) this.delay += this.previous.getTrackComplete() - mixDuration;
|
||||
}
|
||||
|
||||
setMixDurationWithDelta(mixDuration: number, delay: number) {
|
||||
this._mixDuration = mixDuration;
|
||||
if (this.previous != null && this.delay <= 0) this.delay += this.previous.getTrackComplete() - delay;
|
||||
this.delay = this.delay;
|
||||
}
|
||||
|
||||
|
||||
@ -69,11 +69,6 @@ export class IkConstraint implements Updatable {
|
||||
if (!data) throw new Error("data cannot be null.");
|
||||
if (!skeleton) throw new Error("skeleton cannot be null.");
|
||||
this.data = data;
|
||||
this.mix = data.mix;
|
||||
this.softness = data.softness;
|
||||
this.bendDirection = data.bendDirection;
|
||||
this.compress = data.compress;
|
||||
this.stretch = data.stretch;
|
||||
|
||||
this.bones = new Array<Bone>();
|
||||
for (let i = 0; i < data.bones.length; i++) {
|
||||
@ -83,7 +78,13 @@ export class IkConstraint implements Updatable {
|
||||
}
|
||||
let target = skeleton.findBone(data.target.name);
|
||||
if (!target) throw new Error(`Couldn't find bone ${data.target.name}`);
|
||||
|
||||
this.target = target;
|
||||
this.mix = data.mix;
|
||||
this.softness = data.softness;
|
||||
this.bendDirection = data.bendDirection;
|
||||
this.compress = data.compress;
|
||||
this.stretch = data.stretch;
|
||||
}
|
||||
|
||||
isActive () {
|
||||
|
||||
@ -75,6 +75,7 @@ export class PathConstraint implements Updatable {
|
||||
if (!data) throw new Error("data cannot be null.");
|
||||
if (!skeleton) throw new Error("skeleton cannot be null.");
|
||||
this.data = data;
|
||||
|
||||
this.bones = new Array<Bone>();
|
||||
for (let i = 0, n = data.bones.length; i < n; i++) {
|
||||
let bone = skeleton.findBone(data.bones[i].name);
|
||||
@ -84,6 +85,7 @@ export class PathConstraint implements Updatable {
|
||||
let target = skeleton.findSlot(data.target.name);
|
||||
if (!target) throw new Error(`Couldn't find target bone ${data.target.name}`);
|
||||
this.target = target;
|
||||
|
||||
this.position = data.position;
|
||||
this.spacing = data.spacing;
|
||||
this.mixRotate = data.mixRotate;
|
||||
|
||||
@ -79,7 +79,9 @@ export class PhysicsConstraint implements Updatable {
|
||||
constructor (data: PhysicsConstraintData, skeleton: Skeleton) {
|
||||
this.data = data;
|
||||
this.skeleton = skeleton;
|
||||
|
||||
this.bone = skeleton.bones[data.bone.index];
|
||||
|
||||
this.inertia = data.inertia;
|
||||
this.strength = data.strength;
|
||||
this.damping = data.damping;
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
import { Attachment } from "./attachments/Attachment.js";
|
||||
import { ClippingAttachment } from "./attachments/ClippingAttachment.js";
|
||||
import { MeshAttachment } from "./attachments/MeshAttachment.js";
|
||||
import { PathAttachment } from "./attachments/PathAttachment.js";
|
||||
import { RegionAttachment } from "./attachments/RegionAttachment.js";
|
||||
@ -35,6 +36,7 @@ import { Bone } from "./Bone.js";
|
||||
import { IkConstraint } from "./IkConstraint.js";
|
||||
import { PathConstraint } from "./PathConstraint.js";
|
||||
import { PhysicsConstraint } from "./PhysicsConstraint.js";
|
||||
import { SkeletonClipping } from "./SkeletonClipping.js";
|
||||
import { SkeletonData } from "./SkeletonData.js";
|
||||
import { Skin } from "./Skin.js";
|
||||
import { Slot } from "./Slot.js";
|
||||
@ -46,6 +48,7 @@ import { Color, Utils, MathUtils, Vector2, NumberArrayLike } from "./Utils.js";
|
||||
*
|
||||
* See [Instance objects](http://esotericsoftware.com/spine-runtime-architecture#Instance-objects) in the Spine Runtimes Guide. */
|
||||
export class Skeleton {
|
||||
private static quadTriangles = [0, 1, 2, 2, 3, 0];
|
||||
static yDown = false;
|
||||
|
||||
/** The skeleton's setup pose data. */
|
||||
@ -606,8 +609,9 @@ export class Skeleton {
|
||||
/** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.
|
||||
* @param offset An output value, the distance from the skeleton origin to the bottom left corner of the AABB.
|
||||
* @param size An output value, the width and height of the AABB.
|
||||
* @param temp Working memory to temporarily store attachments' computed world vertices. */
|
||||
getBounds (offset: Vector2, size: Vector2, temp: Array<number> = new Array<number>(2)) {
|
||||
* @param temp Working memory to temporarily store attachments' computed world vertices.
|
||||
* @param clipper {@link SkeletonClipping} to use. If <code>null</code>, no clipping is applied. */
|
||||
getBounds (offset: Vector2, size: Vector2, temp: Array<number> = new Array<number>(2), clipper: SkeletonClipping | null = null) {
|
||||
if (!offset) throw new Error("offset cannot be null.");
|
||||
if (!size) throw new Error("size cannot be null.");
|
||||
let drawOrder = this.drawOrder;
|
||||
@ -617,18 +621,29 @@ export class Skeleton {
|
||||
if (!slot.bone.active) continue;
|
||||
let verticesLength = 0;
|
||||
let vertices: NumberArrayLike | null = null;
|
||||
let triangles: NumberArrayLike | null = null;
|
||||
let attachment = slot.getAttachment();
|
||||
if (attachment instanceof RegionAttachment) {
|
||||
verticesLength = 8;
|
||||
vertices = Utils.setArraySize(temp, verticesLength, 0);
|
||||
(<RegionAttachment>attachment).computeWorldVertices(slot, vertices, 0, 2);
|
||||
attachment.computeWorldVertices(slot, vertices, 0, 2);
|
||||
triangles = Skeleton.quadTriangles;
|
||||
} else if (attachment instanceof MeshAttachment) {
|
||||
let mesh = (<MeshAttachment>attachment);
|
||||
verticesLength = mesh.worldVerticesLength;
|
||||
vertices = Utils.setArraySize(temp, verticesLength, 0);
|
||||
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
||||
triangles = mesh.triangles;
|
||||
} else if (attachment instanceof ClippingAttachment && clipper != null) {
|
||||
clipper.clipStart(slot, attachment);
|
||||
continue;
|
||||
}
|
||||
if (vertices) {
|
||||
if (vertices && triangles) {
|
||||
if (clipper != null && clipper.isClipping()) {
|
||||
clipper.clipTriangles(vertices, verticesLength, triangles, triangles.length);
|
||||
vertices = clipper.clippedVertices;
|
||||
verticesLength = clipper.clippedVertices.length;
|
||||
}
|
||||
for (let ii = 0, nn = vertices.length; ii < nn; ii += 2) {
|
||||
let x = vertices[ii], y = vertices[ii + 1];
|
||||
minX = Math.min(minX, x);
|
||||
@ -637,7 +652,9 @@ export class Skeleton {
|
||||
maxY = Math.max(maxY, y);
|
||||
}
|
||||
}
|
||||
if (clipper != null) clipper.clipEndWithSlot(slot);
|
||||
}
|
||||
if (clipper != null) clipper.clipEnd();
|
||||
offset.set(minX, minY);
|
||||
size.set(maxX - minX, maxY - minY);
|
||||
}
|
||||
|
||||
@ -80,7 +80,90 @@ export class SkeletonClipping {
|
||||
return this.clipAttachment != null;
|
||||
}
|
||||
|
||||
clipTriangles (vertices: NumberArrayLike, verticesLength: number, triangles: NumberArrayLike, trianglesLength: number): void;
|
||||
clipTriangles (vertices: NumberArrayLike, verticesLength: number, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike,
|
||||
light: Color, dark: Color, twoColor: boolean): void;
|
||||
clipTriangles (vertices: NumberArrayLike, verticesLength: number, triangles: NumberArrayLike, trianglesLength: number, uvs?: NumberArrayLike,
|
||||
light?: Color, dark?: Color, twoColor?: boolean): void {
|
||||
|
||||
if (uvs && light && dark && typeof twoColor === 'boolean')
|
||||
this.clipTrianglesRender(vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor);
|
||||
else
|
||||
this.clipTrianglesNoRender(vertices, verticesLength, triangles, trianglesLength);
|
||||
}
|
||||
private clipTrianglesNoRender (vertices: NumberArrayLike, verticesLength: number, triangles: NumberArrayLike, trianglesLength: number) {
|
||||
|
||||
let clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;
|
||||
let clippedTriangles = this.clippedTriangles;
|
||||
let polygons = this.clippingPolygons!;
|
||||
let polygonsCount = polygons.length;
|
||||
let vertexSize = 2;
|
||||
|
||||
let index = 0;
|
||||
clippedVertices.length = 0;
|
||||
clippedTriangles.length = 0;
|
||||
outer:
|
||||
for (let i = 0; i < trianglesLength; i += 3) {
|
||||
let vertexOffset = triangles[i] << 1;
|
||||
let x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];
|
||||
|
||||
vertexOffset = triangles[i + 1] << 1;
|
||||
let x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];
|
||||
|
||||
vertexOffset = triangles[i + 2] << 1;
|
||||
let x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];
|
||||
|
||||
for (let p = 0; p < polygonsCount; p++) {
|
||||
let s = clippedVertices.length;
|
||||
if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {
|
||||
let clipOutputLength = clipOutput.length;
|
||||
if (clipOutputLength == 0) continue;
|
||||
|
||||
let clipOutputCount = clipOutputLength >> 1;
|
||||
let clipOutputItems = this.clipOutput;
|
||||
let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize);
|
||||
for (let ii = 0; ii < clipOutputLength; ii += 2) {
|
||||
let x = clipOutputItems[ii], y = clipOutputItems[ii + 1];
|
||||
clippedVerticesItems[s] = x;
|
||||
clippedVerticesItems[s + 1] = y;
|
||||
s += 2;
|
||||
}
|
||||
|
||||
s = clippedTriangles.length;
|
||||
let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));
|
||||
clipOutputCount--;
|
||||
for (let ii = 1; ii < clipOutputCount; ii++) {
|
||||
clippedTrianglesItems[s] = index;
|
||||
clippedTrianglesItems[s + 1] = (index + ii);
|
||||
clippedTrianglesItems[s + 2] = (index + ii + 1);
|
||||
s += 3;
|
||||
}
|
||||
index += clipOutputCount + 1;
|
||||
|
||||
} else {
|
||||
let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * vertexSize);
|
||||
clippedVerticesItems[s] = x1;
|
||||
clippedVerticesItems[s + 1] = y1;
|
||||
|
||||
clippedVerticesItems[s + 2] = x2;
|
||||
clippedVerticesItems[s + 3] = y2;
|
||||
|
||||
clippedVerticesItems[s + 4] = x3;
|
||||
clippedVerticesItems[s + 5] = y3;
|
||||
|
||||
s = clippedTriangles.length;
|
||||
let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);
|
||||
clippedTrianglesItems[s] = index;
|
||||
clippedTrianglesItems[s + 1] = (index + 1);
|
||||
clippedTrianglesItems[s + 2] = (index + 2);
|
||||
index += 3;
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private clipTrianglesRender (vertices: NumberArrayLike, verticesLength: number, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike,
|
||||
light: Color, dark: Color, twoColor: boolean) {
|
||||
|
||||
let clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;
|
||||
|
||||
@ -58,12 +58,7 @@ export class TransformConstraint implements Updatable {
|
||||
if (!data) throw new Error("data cannot be null.");
|
||||
if (!skeleton) throw new Error("skeleton cannot be null.");
|
||||
this.data = data;
|
||||
this.mixRotate = data.mixRotate;
|
||||
this.mixX = data.mixX;
|
||||
this.mixY = data.mixY;
|
||||
this.mixScaleX = data.mixScaleX;
|
||||
this.mixScaleY = data.mixScaleY;
|
||||
this.mixShearY = data.mixShearY;
|
||||
|
||||
this.bones = new Array<Bone>();
|
||||
for (let i = 0; i < data.bones.length; i++) {
|
||||
let bone = skeleton.findBone(data.bones[i].name);
|
||||
@ -73,6 +68,13 @@ export class TransformConstraint implements Updatable {
|
||||
let target = skeleton.findBone(data.target.name);
|
||||
if (!target) throw new Error(`Couldn't find target bone ${data.target.name}.`);
|
||||
this.target = target;
|
||||
|
||||
this.mixRotate = data.mixRotate;
|
||||
this.mixX = data.mixX;
|
||||
this.mixY = data.mixY;
|
||||
this.mixScaleX = data.mixScaleX;
|
||||
this.mixScaleY = data.mixScaleY;
|
||||
this.mixShearY = data.mixShearY;
|
||||
}
|
||||
|
||||
isActive () {
|
||||
|
||||
|
Before Width: | Height: | Size: 369 KiB After Width: | Height: | Size: 379 KiB |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@esotericsoftware/spine-phaser",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"description": "The official Spine Runtimes for the Phaser.",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
@ -31,8 +31,8 @@
|
||||
},
|
||||
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
|
||||
"dependencies": {
|
||||
"@esotericsoftware/spine-core": "4.2.39",
|
||||
"@esotericsoftware/spine-webgl": "4.2.39",
|
||||
"@esotericsoftware/spine-canvas": "4.2.39"
|
||||
"@esotericsoftware/spine-core": "4.2.40",
|
||||
"@esotericsoftware/spine-webgl": "4.2.40",
|
||||
"@esotericsoftware/spine-canvas": "4.2.40"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 369 KiB After Width: | Height: | Size: 379 KiB |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@esotericsoftware/spine-pixi",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"description": "The official Spine Runtimes for the web.",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
@ -31,7 +31,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
|
||||
"dependencies": {
|
||||
"@esotericsoftware/spine-core": "4.2.39"
|
||||
"@esotericsoftware/spine-core": "4.2.40"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@pixi/core": "^7.2.4",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@esotericsoftware/spine-player",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"description": "The official Spine Runtimes for the web.",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
@ -31,6 +31,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
|
||||
"dependencies": {
|
||||
"@esotericsoftware/spine-webgl": "4.2.39"
|
||||
"@esotericsoftware/spine-webgl": "4.2.40"
|
||||
}
|
||||
}
|
||||
@ -771,10 +771,11 @@ export class SpinePlayer implements Disposable {
|
||||
let minX = 100000000, maxX = -100000000, minY = 100000000, maxY = -100000000;
|
||||
let offset = new Vector2(), size = new Vector2();
|
||||
|
||||
const tempArray = new Array<number>(2);
|
||||
for (let i = 0; i < steps; i++, time += stepTime) {
|
||||
animation.apply(this.skeleton!, time, time, false, [], 1, MixBlend.setup, MixDirection.mixIn);
|
||||
this.skeleton!.updateWorldTransform(Physics.update);
|
||||
this.skeleton!.getBounds(offset, size);
|
||||
this.skeleton!.getBounds(offset, size, tempArray, this.sceneRenderer!.skeletonRenderer.getSkeletonClipping());
|
||||
|
||||
if (!isNaN(offset.x) && !isNaN(offset.y) && !isNaN(size.x) && !isNaN(size.y)) {
|
||||
minX = Math.min(offset.x, minX);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@esotericsoftware/spine-threejs",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"description": "The official Spine Runtimes for the web.",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
@ -31,6 +31,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
|
||||
"dependencies": {
|
||||
"@esotericsoftware/spine-core": "4.2.39"
|
||||
"@esotericsoftware/spine-core": "4.2.40"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 369 KiB After Width: | Height: | Size: 379 KiB |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@esotericsoftware/spine-webgl",
|
||||
"version": "4.2.39",
|
||||
"version": "4.2.40",
|
||||
"description": "The official Spine Runtimes for the web.",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
@ -31,6 +31,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/esotericsoftware/spine-runtimes#readme",
|
||||
"dependencies": {
|
||||
"@esotericsoftware/spine-core": "4.2.39"
|
||||
"@esotericsoftware/spine-core": "4.2.40"
|
||||
}
|
||||
}
|
||||
@ -205,4 +205,9 @@ export class SkeletonRenderer {
|
||||
}
|
||||
clipper.clipEnd();
|
||||
}
|
||||
|
||||
/** Returns the {@link SkeletonClipping} used by this renderer for use with e.g. {@link Skeleton.getBounds} **/
|
||||
public getSkeletonClipping (): SkeletonClipping {
|
||||
return this.clipper;
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 341 KiB After Width: | Height: | Size: 351 KiB |
@ -134,6 +134,7 @@ void USpineWidget::Tick(float DeltaTime, bool CallDelegates) {
|
||||
state->update(DeltaTime);
|
||||
state->apply(*skeleton);
|
||||
if (CallDelegates) BeforeUpdateWorldTransform.Broadcast(this);
|
||||
skeleton->update(DeltaTime);
|
||||
skeleton->updateWorldTransform(Physics_Update);
|
||||
if (CallDelegates) AfterUpdateWorldTransform.Broadcast(this);
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ namespace Spine.Unity.Examples {
|
||||
|
||||
/// <summary>
|
||||
/// When enabled, this component renders a skeleton to a RenderTexture and
|
||||
/// then draws this RenderTexture at a UI RawImage quad of the same size.
|
||||
/// then draws this RenderTexture at a UI SkeletonSubmeshGraphic quad of the same size.
|
||||
/// This allows changing transparency at a single quad, which produces a more
|
||||
/// natural fadeout effect.
|
||||
/// Note: It is recommended to keep this component disabled as much as possible
|
||||
@ -64,7 +64,7 @@ namespace Spine.Unity.Examples {
|
||||
protected SkeletonGraphic skeletonGraphic;
|
||||
public List<TextureMaterialPair> meshRendererMaterialForTexture = new List<TextureMaterialPair>();
|
||||
protected CanvasRenderer quadCanvasRenderer;
|
||||
protected RawImage quadRawImage;
|
||||
protected SkeletonSubmeshGraphic quadMaskableGraphic;
|
||||
protected readonly Vector3[] worldCorners = new Vector3[4];
|
||||
|
||||
protected override void Awake () {
|
||||
@ -79,10 +79,10 @@ namespace Spine.Unity.Examples {
|
||||
}
|
||||
|
||||
void CreateQuadChild () {
|
||||
quad = new GameObject(this.name + " RenderTexture", typeof(CanvasRenderer), typeof(RawImage));
|
||||
quad = new GameObject(this.name + " RenderTexture", typeof(CanvasRenderer), typeof(SkeletonSubmeshGraphic));
|
||||
quad.transform.SetParent(this.transform.parent, false);
|
||||
quadCanvasRenderer = quad.GetComponent<CanvasRenderer>();
|
||||
quadRawImage = quad.GetComponent<RawImage>();
|
||||
quadMaskableGraphic = quad.GetComponent<SkeletonSubmeshGraphic>();
|
||||
|
||||
quadMesh = new Mesh();
|
||||
quadMesh.MarkDynamic();
|
||||
@ -212,12 +212,12 @@ namespace Spine.Unity.Examples {
|
||||
}
|
||||
|
||||
protected void SetupQuad () {
|
||||
quadRawImage.texture = this.renderTexture;
|
||||
quadRawImage.color = color;
|
||||
quadCanvasRenderer.SetMaterial(Canvas.GetDefaultCanvasMaterial(), this.renderTexture);
|
||||
quadMaskableGraphic.color = color;
|
||||
quadCanvasRenderer.SetColor(color);
|
||||
|
||||
RectTransform srcRectTransform = skeletonGraphic.rectTransform;
|
||||
RectTransform dstRectTransform = quadRawImage.rectTransform;
|
||||
RectTransform dstRectTransform = quadMaskableGraphic.rectTransform;
|
||||
|
||||
dstRectTransform.anchorMin = srcRectTransform.anchorMin;
|
||||
dstRectTransform.anchorMax = srcRectTransform.anchorMax;
|
||||
|
||||
|
Before Width: | Height: | Size: 369 KiB After Width: | Height: | Size: 379 KiB |
@ -2,7 +2,7 @@
|
||||
"name": "com.esotericsoftware.spine.spine-unity-examples",
|
||||
"displayName": "spine-unity Runtime Examples",
|
||||
"description": "This plugin provides example scenes and scripts for the spine-unity runtime.",
|
||||
"version": "4.2.28",
|
||||
"version": "4.2.29",
|
||||
"unity": "2018.3",
|
||||
"author": {
|
||||
"name": "Esoteric Software",
|
||||
|
||||
@ -645,6 +645,11 @@ namespace Spine.Unity {
|
||||
readonly ExposedList<Material> usedMaterials = new ExposedList<Material>();
|
||||
readonly ExposedList<Texture> usedTextures = new ExposedList<Texture>();
|
||||
|
||||
/// <summary>Returns the <see cref="SkeletonClipping"/> used by this renderer for use with e.g.
|
||||
/// <see cref="Skeleton.GetBounds(out float, out float, out float, out float, ref float[], SkeletonClipping)"/>
|
||||
/// </summary>
|
||||
public SkeletonClipping SkeletonClipping { get { return meshGenerator.SkeletonClipping; } }
|
||||
|
||||
public ExposedList<Mesh> MeshesMultipleCanvasRenderers { get { return meshes; } }
|
||||
public ExposedList<Material> MaterialsMultipleCanvasRenderers { get { return usedMaterials; } }
|
||||
public ExposedList<Texture> TexturesMultipleCanvasRenderers { get { return usedTextures; } }
|
||||
|
||||
@ -270,6 +270,11 @@ namespace Spine.Unity {
|
||||
[System.NonSerialized] readonly SkeletonRendererInstruction currentInstructions = new SkeletonRendererInstruction();
|
||||
readonly MeshGenerator meshGenerator = new MeshGenerator();
|
||||
[System.NonSerialized] readonly MeshRendererBuffers rendererBuffers = new MeshRendererBuffers();
|
||||
|
||||
/// <summary>Returns the <see cref="SkeletonClipping"/> used by this renderer for use with e.g.
|
||||
/// <see cref="Skeleton.GetBounds(out float, out float, out float, out float, ref float[], SkeletonClipping)"/>
|
||||
/// </summary>
|
||||
public SkeletonClipping SkeletonClipping { get { return meshGenerator.SkeletonClipping; } }
|
||||
#endregion
|
||||
|
||||
#region Cached component references
|
||||
|
||||
@ -156,6 +156,11 @@ namespace Spine.Unity {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Returns the <see cref="SkeletonClipping"/> used by this mesh generator for use with e.g.
|
||||
/// <see cref="Skeleton.GetBounds(out float, out float, out float, out float, ref float[], SkeletonClipping)"/>
|
||||
/// </summary>
|
||||
public SkeletonClipping SkeletonClipping { get { return clipper; } }
|
||||
|
||||
public MeshGenerator () {
|
||||
submeshes.TrimExcess();
|
||||
}
|
||||
|
||||