[c][cpp][flutter][ios] Port 7facce33f: Draw order folder timeline property ID per slot with "all" special case.

This commit is contained in:
Mario Zechner 2026-03-18 17:51:40 +01:00
parent fff715d94d
commit 063f163d56
11 changed files with 178 additions and 159 deletions

View File

@ -56,6 +56,7 @@ method: Bone::pose
# Methods that return objects by value (not supported - would need heap allocation)
method: Color::valueOf
method: DrawOrderTimeline::getPropertyId
# Exclude const versions of getSetupPose() - we'll only expose the non-const version
method: BoneData::getSetupPose const

View File

@ -6,37 +6,38 @@ extern "C" {
#endif
typedef enum spine_property {
SPINE_PROPERTY_ROTATE = 1 << 0,
SPINE_PROPERTY_X = 1 << 1,
SPINE_PROPERTY_Y = 1 << 2,
SPINE_PROPERTY_SCALE_X = 1 << 3,
SPINE_PROPERTY_SCALE_Y = 1 << 4,
SPINE_PROPERTY_SHEAR_X = 1 << 5,
SPINE_PROPERTY_SHEAR_Y = 1 << 6,
SPINE_PROPERTY_INHERIT = 1 << 7,
SPINE_PROPERTY_RGB = 1 << 8,
SPINE_PROPERTY_ALPHA = 1 << 9,
SPINE_PROPERTY_RGB2 = 1 << 10,
SPINE_PROPERTY_ATTACHMENT = 1 << 11,
SPINE_PROPERTY_DEFORM = 1 << 12,
SPINE_PROPERTY_EVENT = 1 << 13,
SPINE_PROPERTY_DRAW_ORDER = 1 << 14,
SPINE_PROPERTY_IK_CONSTRAINT = 1 << 15,
SPINE_PROPERTY_TRANSFORM_CONSTRAINT = 1 << 16,
SPINE_PROPERTY_PATH_CONSTRAINT_POSITION = 1 << 17,
SPINE_PROPERTY_PATH_CONSTRAINT_SPACING = 1 << 18,
SPINE_PROPERTY_PATH_CONSTRAINT_MIX = 1 << 19,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_INERTIA = 1 << 20,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_STRENGTH = 1 << 21,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_DAMPING = 1 << 22,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_MASS = 1 << 23,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_WIND = 1 << 24,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_GRAVITY = 1 << 25,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_MIX = 1 << 26,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_RESET = 1 << 27,
SPINE_PROPERTY_SEQUENCE = 1 << 28,
SPINE_PROPERTY_SLIDER_TIME = 1 << 29,
SPINE_PROPERTY_SLIDER_MIX = 1 << 30
SPINE_PROPERTY_ROTATE = 0,
SPINE_PROPERTY_X,
SPINE_PROPERTY_Y,
SPINE_PROPERTY_SCALE_X,
SPINE_PROPERTY_SCALE_Y,
SPINE_PROPERTY_SHEAR_X,
SPINE_PROPERTY_SHEAR_Y,
SPINE_PROPERTY_INHERIT,
SPINE_PROPERTY_RGB,
SPINE_PROPERTY_ALPHA,
SPINE_PROPERTY_RGB2,
SPINE_PROPERTY_ATTACHMENT,
SPINE_PROPERTY_DEFORM,
SPINE_PROPERTY_EVENT,
SPINE_PROPERTY_DRAW_ORDER,
SPINE_PROPERTY_IK_CONSTRAINT,
SPINE_PROPERTY_TRANSFORM_CONSTRAINT,
SPINE_PROPERTY_PATH_CONSTRAINT_POSITION,
SPINE_PROPERTY_PATH_CONSTRAINT_SPACING,
SPINE_PROPERTY_PATH_CONSTRAINT_MIX,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_INERTIA,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_STRENGTH,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_DAMPING,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_MASS,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_WIND,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_GRAVITY,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_MIX,
SPINE_PROPERTY_PHYSICS_CONSTRAINT_RESET,
SPINE_PROPERTY_SEQUENCE,
SPINE_PROPERTY_SLIDER_TIME,
SPINE_PROPERTY_SLIDER_MIX,
SPINE_PROPERTY_DRAW_ORDER_FOLDER
} spine_property;
#ifdef __cplusplus

View File

@ -42,6 +42,8 @@ namespace spine {
RTTI_DECL
public:
static PropertyId getPropertyId();
explicit DrawOrderTimeline(size_t frameCount);
virtual void apply(Skeleton &skeleton, float lastTime, float time, Array<Event *> *events, float alpha, MixBlend blend,

View File

@ -33,37 +33,38 @@
namespace spine {
typedef long long PropertyId;
enum Property {
Property_Rotate = 1 << 0,
Property_X = 1 << 1,
Property_Y = 1 << 2,
Property_ScaleX = 1 << 3,
Property_ScaleY = 1 << 4,
Property_ShearX = 1 << 5,
Property_ShearY = 1 << 6,
Property_Inherit = 1 << 7,
Property_Rgb = 1 << 8,
Property_Alpha = 1 << 9,
Property_Rgb2 = 1 << 10,
Property_Attachment = 1 << 11,
Property_Deform = 1 << 12,
Property_Event = 1 << 13,
Property_DrawOrder = 1 << 14,
Property_IkConstraint = 1 << 15,
Property_TransformConstraint = 1 << 16,
Property_PathConstraintPosition = 1 << 17,
Property_PathConstraintSpacing = 1 << 18,
Property_PathConstraintMix = 1 << 19,
Property_PhysicsConstraintInertia = 1 << 20,
Property_PhysicsConstraintStrength = 1 << 21,
Property_PhysicsConstraintDamping = 1 << 22,
Property_PhysicsConstraintMass = 1 << 23,
Property_PhysicsConstraintWind = 1 << 24,
Property_PhysicsConstraintGravity = 1 << 25,
Property_PhysicsConstraintMix = 1 << 26,
Property_PhysicsConstraintReset = 1 << 27,
Property_Sequence = 1 << 28,
Property_SliderTime = 1 << 29,
Property_SliderMix = 1 << 30
Property_Rotate = 0,
Property_X,
Property_Y,
Property_ScaleX,
Property_ScaleY,
Property_ShearX,
Property_ShearY,
Property_Inherit,
Property_Rgb,
Property_Alpha,
Property_Rgb2,
Property_Attachment,
Property_Deform,
Property_Event,
Property_DrawOrder,
Property_IkConstraint,
Property_TransformConstraint,
Property_PathConstraintPosition,
Property_PathConstraintSpacing,
Property_PathConstraintMix,
Property_PhysicsConstraintInertia,
Property_PhysicsConstraintStrength,
Property_PhysicsConstraintDamping,
Property_PhysicsConstraintMass,
Property_PhysicsConstraintWind,
Property_PhysicsConstraintGravity,
Property_PhysicsConstraintMix,
Property_PhysicsConstraintReset,
Property_Sequence,
Property_SliderTime,
Property_SliderMix,
Property_DrawOrderFolder
};
}

View File

@ -951,7 +951,7 @@ float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton) {
if (from->_mixingFrom != NULL) applyMixingFrom(from, skeleton);
float mix;
if (to->_mixDuration == 0) // Single frame mix to undo mixingFrom changes.
if (to->_mixDuration == 0)// Single frame mix to undo mixingFrom changes.
mix = 1;
else {
mix = to->_mixTime / to->_mixDuration;
@ -1187,10 +1187,14 @@ void AnimationState::computeHold(TrackEntry *entry) {
timelineMode.setSize(timelinesCount, 0);
Array<TrackEntry *> &timelineHoldMix = entry->_timelineHoldMix;
timelineHoldMix.setSize(timelinesCount, 0);
PropertyId drawOrderPropertyId = DrawOrderTimeline::getPropertyId();
if (to != NULL && to->_holdPrevious) {
for (size_t i = 0; i < timelinesCount; i++) {
timelineMode[i] = _propertyIDs.addAll(timelines[i]->getPropertyIds(), true) ? HoldFirst : HoldSubsequent;
bool first = _propertyIDs.addAll(timelines[i]->getPropertyIds(), true);
if (first && timelines[i]->getRTTI().isExactly(DrawOrderFolderTimeline::rtti) && _propertyIDs.containsKey(drawOrderPropertyId))
first = false;
timelineMode[i] = first ? HoldFirst : HoldSubsequent;
}
return;
}
@ -1203,6 +1207,8 @@ continue_outer:
Array<PropertyId> &ids = timeline->getPropertyIds();
if (!_propertyIDs.addAll(ids, true)) {
timelineMode[i] = Subsequent;
} else if (timeline->getRTTI().isExactly(DrawOrderFolderTimeline::rtti) && _propertyIDs.containsKey(drawOrderPropertyId)) {
timelineMode[i] = Subsequent;
} else {
if (to == NULL || timeline->getRTTI().isExactly(AttachmentTimeline::rtti) || timeline->getRTTI().isExactly(DrawOrderTimeline::rtti) ||
timeline->getRTTI().isExactly(DrawOrderFolderTimeline::rtti) || timeline->getRTTI().isExactly(EventTimeline::rtti) ||

View File

@ -41,8 +41,9 @@ using namespace spine;
RTTI_IMPL(DrawOrderFolderTimeline, Timeline)
DrawOrderFolderTimeline::DrawOrderFolderTimeline(size_t frameCount, Array<int> &slots, size_t slotCount) : Timeline(frameCount, 1) {
PropertyId ids[] = {((PropertyId) Property_DrawOrder << 32)};
setPropertyIds(ids, 1);
Array<PropertyId> ids(slots.size());
for (size_t i = 0; i < slots.size(); ++i) ids.add(((PropertyId) Property_DrawOrderFolder << 32) | (PropertyId) slots[i]);
setPropertyIds(ids.buffer(), ids.size());
_slots.addAll(slots);
_drawOrders.ensureCapacity(frameCount);

View File

@ -41,8 +41,12 @@ using namespace spine;
RTTI_IMPL(DrawOrderTimeline, Timeline)
PropertyId DrawOrderTimeline::getPropertyId() {
return ((PropertyId) Property_DrawOrder << 32);
}
DrawOrderTimeline::DrawOrderTimeline(size_t frameCount) : Timeline(frameCount, 1) {
PropertyId ids[] = {((PropertyId) Property_DrawOrder << 32)};
PropertyId ids[] = {getPropertyId()};
setPropertyIds(ids, 1);
_drawOrders.ensureCapacity(frameCount);

View File

@ -31,37 +31,38 @@
/// Property enum
enum Property {
rotate(1),
rotate(0),
x(1),
y(1),
scaleX(1),
scaleY(1),
shearX(1),
shearY(1),
inherit(1),
rgb(1),
alpha(1),
rgb2(1),
attachment(1),
deform(1),
event(1),
drawOrder(1),
ikConstraint(1),
transformConstraint(1),
pathConstraintPosition(1),
pathConstraintSpacing(1),
pathConstraintMix(1),
physicsConstraintInertia(1),
physicsConstraintStrength(1),
physicsConstraintDamping(1),
physicsConstraintMass(1),
physicsConstraintWind(1),
physicsConstraintGravity(1),
physicsConstraintMix(1),
physicsConstraintReset(1),
sequence(1),
sliderTime(1),
sliderMix(1);
y(2),
scaleX(3),
scaleY(4),
shearX(5),
shearY(6),
inherit(7),
rgb(8),
alpha(9),
rgb2(10),
attachment(11),
deform(12),
event(13),
drawOrder(14),
ikConstraint(15),
transformConstraint(16),
pathConstraintPosition(17),
pathConstraintSpacing(18),
pathConstraintMix(19),
physicsConstraintInertia(20),
physicsConstraintStrength(21),
physicsConstraintDamping(22),
physicsConstraintMass(23),
physicsConstraintWind(24),
physicsConstraintGravity(25),
physicsConstraintMix(26),
physicsConstraintReset(27),
sequence(28),
sliderTime(29),
sliderMix(30),
drawOrderFolder(31);
const Property(this.value);
final int value;

View File

@ -49808,37 +49808,38 @@ abstract class spine_position_mode {
}
abstract class spine_property {
static const int SPINE_PROPERTY_ROTATE = 1;
static const int SPINE_PROPERTY_X = 2;
static const int SPINE_PROPERTY_Y = 4;
static const int SPINE_PROPERTY_SCALE_X = 8;
static const int SPINE_PROPERTY_SCALE_Y = 16;
static const int SPINE_PROPERTY_SHEAR_X = 32;
static const int SPINE_PROPERTY_SHEAR_Y = 64;
static const int SPINE_PROPERTY_INHERIT = 128;
static const int SPINE_PROPERTY_RGB = 256;
static const int SPINE_PROPERTY_ALPHA = 512;
static const int SPINE_PROPERTY_RGB2 = 1024;
static const int SPINE_PROPERTY_ATTACHMENT = 2048;
static const int SPINE_PROPERTY_DEFORM = 4096;
static const int SPINE_PROPERTY_EVENT = 8192;
static const int SPINE_PROPERTY_DRAW_ORDER = 16384;
static const int SPINE_PROPERTY_IK_CONSTRAINT = 32768;
static const int SPINE_PROPERTY_TRANSFORM_CONSTRAINT = 65536;
static const int SPINE_PROPERTY_PATH_CONSTRAINT_POSITION = 131072;
static const int SPINE_PROPERTY_PATH_CONSTRAINT_SPACING = 262144;
static const int SPINE_PROPERTY_PATH_CONSTRAINT_MIX = 524288;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_INERTIA = 1048576;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_STRENGTH = 2097152;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_DAMPING = 4194304;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_MASS = 8388608;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_WIND = 16777216;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_GRAVITY = 33554432;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_MIX = 67108864;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_RESET = 134217728;
static const int SPINE_PROPERTY_SEQUENCE = 268435456;
static const int SPINE_PROPERTY_SLIDER_TIME = 536870912;
static const int SPINE_PROPERTY_SLIDER_MIX = 1073741824;
static const int SPINE_PROPERTY_ROTATE = 0;
static const int SPINE_PROPERTY_X = 1;
static const int SPINE_PROPERTY_Y = 2;
static const int SPINE_PROPERTY_SCALE_X = 3;
static const int SPINE_PROPERTY_SCALE_Y = 4;
static const int SPINE_PROPERTY_SHEAR_X = 5;
static const int SPINE_PROPERTY_SHEAR_Y = 6;
static const int SPINE_PROPERTY_INHERIT = 7;
static const int SPINE_PROPERTY_RGB = 8;
static const int SPINE_PROPERTY_ALPHA = 9;
static const int SPINE_PROPERTY_RGB2 = 10;
static const int SPINE_PROPERTY_ATTACHMENT = 11;
static const int SPINE_PROPERTY_DEFORM = 12;
static const int SPINE_PROPERTY_EVENT = 13;
static const int SPINE_PROPERTY_DRAW_ORDER = 14;
static const int SPINE_PROPERTY_IK_CONSTRAINT = 15;
static const int SPINE_PROPERTY_TRANSFORM_CONSTRAINT = 16;
static const int SPINE_PROPERTY_PATH_CONSTRAINT_POSITION = 17;
static const int SPINE_PROPERTY_PATH_CONSTRAINT_SPACING = 18;
static const int SPINE_PROPERTY_PATH_CONSTRAINT_MIX = 19;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_INERTIA = 20;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_STRENGTH = 21;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_DAMPING = 22;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_MASS = 23;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_WIND = 24;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_GRAVITY = 25;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_MIX = 26;
static const int SPINE_PROPERTY_PHYSICS_CONSTRAINT_RESET = 27;
static const int SPINE_PROPERTY_SEQUENCE = 28;
static const int SPINE_PROPERTY_SLIDER_TIME = 29;
static const int SPINE_PROPERTY_SLIDER_MIX = 30;
static const int SPINE_PROPERTY_DRAW_ORDER_FOLDER = 31;
}
abstract class spine_rotate_mode {

View File

@ -33,37 +33,38 @@ import Foundation
/// Property enum
public enum Property: Int32, CaseIterable {
case rotate = 1
case x = 2
case y = 4
case scaleX = 8
case scaleY = 16
case shearX = 32
case shearY = 64
case inherit = 128
case rgb = 256
case alpha = 512
case rgb2 = 1024
case attachment = 2048
case deform = 4096
case event = 8192
case drawOrder = 16384
case ikConstraint = 32768
case transformConstraint = 65536
case pathConstraintPosition = 131072
case pathConstraintSpacing = 262144
case pathConstraintMix = 524288
case physicsConstraintInertia = 1_048_576
case physicsConstraintStrength = 2_097_152
case physicsConstraintDamping = 4_194_304
case physicsConstraintMass = 8_388_608
case physicsConstraintWind = 16_777_216
case physicsConstraintGravity = 33_554_432
case physicsConstraintMix = 67_108_864
case physicsConstraintReset = 134_217_728
case sequence = 268_435_456
case sliderTime = 536_870_912
case sliderMix = 1_073_741_824
case rotate = 0
case x = 1
case y = 2
case scaleX = 3
case scaleY = 4
case shearX = 5
case shearY = 6
case inherit = 7
case rgb = 8
case alpha = 9
case rgb2 = 10
case attachment = 11
case deform = 12
case event = 13
case drawOrder = 14
case ikConstraint = 15
case transformConstraint = 16
case pathConstraintPosition = 17
case pathConstraintSpacing = 18
case pathConstraintMix = 19
case physicsConstraintInertia = 20
case physicsConstraintStrength = 21
case physicsConstraintDamping = 22
case physicsConstraintMass = 23
case physicsConstraintWind = 24
case physicsConstraintGravity = 25
case physicsConstraintMix = 26
case physicsConstraintReset = 27
case sequence = 28
case sliderTime = 29
case sliderMix = 30
case drawOrderFolder = 31
public static func fromValue(_ value: Int32) -> Property? {
return Property(rawValue: value)