mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[cpp] 4.3 porting WIP
This commit is contained in:
parent
bfe1f856f7
commit
c1ba842c15
@ -64,6 +64,8 @@ namespace spine {
|
|||||||
|
|
||||||
friend class TranslateYTimeline;
|
friend class TranslateYTimeline;
|
||||||
|
|
||||||
|
friend class Slot;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BoneData(int index, const String &name, BoneData *parent = NULL);
|
BoneData(int index, const String &name, BoneData *parent = NULL);
|
||||||
|
|
||||||
|
|||||||
@ -60,6 +60,7 @@ namespace spine {
|
|||||||
friend class TranslateYTimeline;
|
friend class TranslateYTimeline;
|
||||||
friend class InheritTimeline;
|
friend class InheritTimeline;
|
||||||
friend class Skeleton;
|
friend class Skeleton;
|
||||||
|
friend class Slot;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PosedData(const spine::String& name);
|
PosedData(const spine::String& name);
|
||||||
@ -117,6 +118,7 @@ namespace spine {
|
|||||||
friend class PhysicsConstraintMassTimeline;
|
friend class PhysicsConstraintMassTimeline;
|
||||||
friend class PhysicsConstraintWindTimeline;
|
friend class PhysicsConstraintWindTimeline;
|
||||||
friend class PhysicsConstraintGravityTimeline;
|
friend class PhysicsConstraintGravityTimeline;
|
||||||
|
friend class Slot;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
P _setup;
|
P _setup;
|
||||||
|
|||||||
@ -42,9 +42,7 @@ namespace spine {
|
|||||||
class Slider;
|
class Slider;
|
||||||
class Skeleton;
|
class Skeleton;
|
||||||
|
|
||||||
/// Stores the setup pose for a PhysicsConstraint.
|
/// Stores the setup pose for a Slider
|
||||||
///
|
|
||||||
/// See https://esotericsoftware.com/spine-physics-constraints Physics constraints in the Spine User Guide.
|
|
||||||
class SP_API SliderData : public ConstraintDataGeneric<Slider, SliderPose> {
|
class SP_API SliderData : public ConstraintDataGeneric<Slider, SliderPose> {
|
||||||
friend class SkeletonBinary;
|
friend class SkeletonBinary;
|
||||||
friend class SkeletonJson;
|
friend class SkeletonJson;
|
||||||
|
|||||||
@ -62,6 +62,7 @@ namespace spine {
|
|||||||
friend class TransformConstraintTimeline;
|
friend class TransformConstraintTimeline;
|
||||||
friend class TranslateTimeline;
|
friend class TranslateTimeline;
|
||||||
friend class TwoColorTimeline;
|
friend class TwoColorTimeline;
|
||||||
|
friend class Slot;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SlotData(int index, const String& name, BoneData& boneData);
|
SlotData(int index, const String& name, BoneData& boneData);
|
||||||
|
|||||||
@ -39,7 +39,7 @@ using namespace spine;
|
|||||||
|
|
||||||
Slot::Slot(SlotData &data, Skeleton &skeleton) : PosedGeneric<SlotData, SlotPose, SlotPose>(data),
|
Slot::Slot(SlotData &data, Skeleton &skeleton) : PosedGeneric<SlotData, SlotPose, SlotPose>(data),
|
||||||
_skeleton(skeleton),
|
_skeleton(skeleton),
|
||||||
_bone(*skeleton.getBones()[data.getBoneData().getIndex()]),
|
_bone(*skeleton.getBones()[data._boneData._index]),
|
||||||
_attachmentState(0) {
|
_attachmentState(0) {
|
||||||
|
|
||||||
if (data.getSetupPose().hasDarkColor()) {
|
if (data.getSetupPose().hasDarkColor()) {
|
||||||
@ -49,19 +49,18 @@ Slot::Slot(SlotData &data, Skeleton &skeleton) : PosedGeneric<SlotData, SlotPose
|
|||||||
setupPose();
|
setupPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Bone &Slot::getBone() {
|
Bone &Slot::getBone() {
|
||||||
return _bone;
|
return _bone;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Slot::setupPose() {
|
void Slot::setupPose() {
|
||||||
_pose.getColor().set(_data.getSetupPose().getColor());
|
_pose._color.set(_data._setup._color);
|
||||||
if (_pose.hasDarkColor()) _pose.getDarkColor().set(_data.getSetupPose().getDarkColor());
|
if (_pose._hasDarkColor) _pose._darkColor.set(_data._setup._darkColor);
|
||||||
_pose.setSequenceIndex(_data.getSetupPose().getSequenceIndex());
|
_pose._sequenceIndex = _data._setup._sequenceIndex;
|
||||||
if (_data.getAttachmentName().isEmpty())
|
if (_data._attachmentName.isEmpty())
|
||||||
_pose.setAttachment(NULL);
|
_pose.setAttachment(NULL);
|
||||||
else {
|
else {
|
||||||
_pose.setAttachment(NULL);
|
_pose._attachment = NULL;
|
||||||
_pose.setAttachment(_skeleton.getAttachment(_data.getIndex(), _data.getAttachmentName()));
|
_pose.setAttachment(_skeleton.getAttachment(_data._index, _data._attachmentName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,9 +33,7 @@ import com.badlogic.gdx.utils.Null;
|
|||||||
|
|
||||||
import com.esotericsoftware.spine.TransformConstraintData.FromProperty;
|
import com.esotericsoftware.spine.TransformConstraintData.FromProperty;
|
||||||
|
|
||||||
/** Stores the setup pose for a {@link PhysicsConstraint}.
|
/** Stores the setup pose for a {@link Slider}. */
|
||||||
* <p>
|
|
||||||
* See <a href="https://esotericsoftware.com/spine-physics-constraints">Physics constraints</a> in the Spine User Guide. */
|
|
||||||
public class SliderData extends ConstraintData<Slider, SliderPose> {
|
public class SliderData extends ConstraintData<Slider, SliderPose> {
|
||||||
Animation animation;
|
Animation animation;
|
||||||
boolean additive, loop;
|
boolean additive, loop;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user