[cpp] 4.3 porting WIP

This commit is contained in:
Mario Zechner 2025-07-04 22:57:16 +02:00
parent ac2046c1a5
commit 782620c737
5 changed files with 13 additions and 10 deletions

View File

@ -43,10 +43,10 @@ namespace spine {
public:
LinkedMesh(MeshAttachment *mesh, const int skinIndex, size_t slotIndex, const String &parent,
bool inheritTimeline);
bool inheritTimelines);
LinkedMesh(MeshAttachment *mesh, const String &skin, size_t slotIndex, const String &parent,
bool inheritTimeline);
bool inheritTimelines);
private:
MeshAttachment *_mesh;
@ -54,7 +54,7 @@ namespace spine {
String _skin;
size_t _slotIndex;
String _parent;
bool _inheritTimeline;
bool _inheritTimelines;
};
}

View File

@ -35,6 +35,9 @@
namespace spine {
/// Changes a transform constraint's TransformConstraintPose::getMixRotate(), TransformConstraintPose::getMixX(),
/// TransformConstraintPose::getMixY(), TransformConstraintPose::getMixScaleX(),
/// TransformConstraintPose::getMixScaleY(), and TransformConstraintPose::getMixShearY().
class SP_API TransformConstraintTimeline : public CurveTimeline, public ConstraintTimeline {
friend class SkeletonBinary;
@ -49,7 +52,7 @@ namespace spine {
virtual void
apply(Skeleton &skeleton, float lastTime, float time, Vector<Event *> *pEvents, float alpha, MixBlend blend,
MixDirection direction, bool appliedPose);
MixDirection direction, bool appliedPose) override;
/// Sets the time, rotate mix, translate mix, scale mix, and shear mix for the specified frame.
/// @param frame Between 0 and frameCount, inclusive.

View File

@ -34,19 +34,19 @@
using namespace spine;
LinkedMesh::LinkedMesh(MeshAttachment *mesh, const int skinIndex, size_t slotIndex, const String &parent,
bool inheritTimeline) : _mesh(mesh),
bool inheritTimelines) : _mesh(mesh),
_skinIndex(skinIndex),
_skin(""),
_slotIndex(slotIndex),
_parent(parent),
_inheritTimeline(inheritTimeline) {
_inheritTimelines(inheritTimelines) {
}
LinkedMesh::LinkedMesh(MeshAttachment *mesh, const String &skin, size_t slotIndex, const String &parent,
bool inheritTimeline) : _mesh(mesh),
bool inheritTimelines) : _mesh(mesh),
_skinIndex(-1),
_skin(skin),
_slotIndex(slotIndex),
_parent(parent),
_inheritTimeline(inheritTimeline) {
_inheritTimelines(inheritTimelines) {
}

View File

@ -355,7 +355,7 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons
setError("Parent mesh not found: ", linkedMesh->_parent.buffer());
return NULL;
}
linkedMesh->_mesh->_timelineAttachment = linkedMesh->_inheritTimeline ? static_cast<VertexAttachment *>(parent)
linkedMesh->_mesh->_timelineAttachment = linkedMesh->_inheritTimelines ? static_cast<VertexAttachment *>(parent)
: linkedMesh->_mesh;
linkedMesh->_mesh->setParentMesh(static_cast<MeshAttachment *>(parent));
if (linkedMesh->_mesh->_region) linkedMesh->_mesh->updateRegion();

View File

@ -798,7 +798,7 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) {
setError(root, "Parent mesh not found: ", linkedMesh->_parent.buffer());
return NULL;
}
linkedMesh->_mesh->_timelineAttachment = linkedMesh->_inheritTimeline ? static_cast<VertexAttachment *>(parent)
linkedMesh->_mesh->_timelineAttachment = linkedMesh->_inheritTimelines ? static_cast<VertexAttachment *>(parent)
: linkedMesh->_mesh;
linkedMesh->_mesh->setParentMesh(static_cast<MeshAttachment *>(parent));
if (linkedMesh->_mesh->_region != NULL) linkedMesh->_mesh->updateRegion();