mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +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 Slot;
|
||||
|
||||
public:
|
||||
BoneData(int index, const String &name, BoneData *parent = NULL);
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user