[cpp] 4.3 porting WIP

This commit is contained in:
Mario Zechner 2025-07-02 16:16:52 +02:00
parent bfe1f856f7
commit c1ba842c15
6 changed files with 15 additions and 15 deletions

View File

@ -64,6 +64,8 @@ namespace spine {
friend class TranslateYTimeline;
friend class Slot;
public:
BoneData(int index, const String &name, BoneData *parent = NULL);

View File

@ -60,6 +60,7 @@ namespace spine {
friend class TranslateYTimeline;
friend class InheritTimeline;
friend class Skeleton;
friend class Slot;
public:
PosedData(const spine::String& name);
@ -117,6 +118,7 @@ namespace spine {
friend class PhysicsConstraintMassTimeline;
friend class PhysicsConstraintWindTimeline;
friend class PhysicsConstraintGravityTimeline;
friend class Slot;
protected:
P _setup;

View File

@ -42,9 +42,7 @@ namespace spine {
class Slider;
class Skeleton;
/// Stores the setup pose for a PhysicsConstraint.
///
/// See https://esotericsoftware.com/spine-physics-constraints Physics constraints in the Spine User Guide.
/// Stores the setup pose for a Slider
class SP_API SliderData : public ConstraintDataGeneric<Slider, SliderPose> {
friend class SkeletonBinary;
friend class SkeletonJson;

View File

@ -62,6 +62,7 @@ namespace spine {
friend class TransformConstraintTimeline;
friend class TranslateTimeline;
friend class TwoColorTimeline;
friend class Slot;
public:
SlotData(int index, const String& name, BoneData& boneData);

View File

@ -39,7 +39,7 @@ using namespace spine;
Slot::Slot(SlotData &data, Skeleton &skeleton) : PosedGeneric<SlotData, SlotPose, SlotPose>(data),
_skeleton(skeleton),
_bone(*skeleton.getBones()[data.getBoneData().getIndex()]),
_bone(*skeleton.getBones()[data._boneData._index]),
_attachmentState(0) {
if (data.getSetupPose().hasDarkColor()) {
@ -49,19 +49,18 @@ Slot::Slot(SlotData &data, Skeleton &skeleton) : PosedGeneric<SlotData, SlotPose
setupPose();
}
Bone &Slot::getBone() {
return _bone;
}
void Slot::setupPose() {
_pose.getColor().set(_data.getSetupPose().getColor());
if (_pose.hasDarkColor()) _pose.getDarkColor().set(_data.getSetupPose().getDarkColor());
_pose.setSequenceIndex(_data.getSetupPose().getSequenceIndex());
if (_data.getAttachmentName().isEmpty())
_pose._color.set(_data._setup._color);
if (_pose._hasDarkColor) _pose._darkColor.set(_data._setup._darkColor);
_pose._sequenceIndex = _data._setup._sequenceIndex;
if (_data._attachmentName.isEmpty())
_pose.setAttachment(NULL);
else {
_pose.setAttachment(NULL);
_pose.setAttachment(_skeleton.getAttachment(_data.getIndex(), _data.getAttachmentName()));
_pose._attachment = NULL;
_pose.setAttachment(_skeleton.getAttachment(_data._index, _data._attachmentName));
}
}
}

View File

@ -33,9 +33,7 @@ import com.badlogic.gdx.utils.Null;
import com.esotericsoftware.spine.TransformConstraintData.FromProperty;
/** Stores the setup pose for a {@link PhysicsConstraint}.
* <p>
* See <a href="https://esotericsoftware.com/spine-physics-constraints">Physics constraints</a> in the Spine User Guide. */
/** Stores the setup pose for a {@link Slider}. */
public class SliderData extends ConstraintData<Slider, SliderPose> {
Animation animation;
boolean additive, loop;