Skip to content

Commit

Permalink
Update spine-core.js
Browse files Browse the repository at this point in the history
  • Loading branch information
dumganhar committed Oct 22, 2024
1 parent 8b39415 commit 985f5a8
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions cocos/spine/lib/spine-core.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
var spine;
(function (spine) {

var enums = [];
function defineReverseKeyEnum(e) {
for (var key in e) {
var value = e[key];
e[value] = key;
}
}

var e = spine.MixBlend = {
setup: 0,
first: 1,
replace: 2,
add: 3
};
enums.push(e);
defineReverseKeyEnum(e);

e = spine.MixDirection = {
mixIn: 0,
mixOut: 1
};
enums.push(e);
defineReverseKeyEnum(e);

e = spine.TimelineType = {
rotate: 0,
Expand All @@ -34,7 +39,7 @@ var spine;
pathConstraintMix: 13,
twoColor: 14
};
enums.push(e);
defineReverseKeyEnum(e);

e = spine.EventType = {
start:0,
Expand All @@ -44,15 +49,15 @@ var spine;
complete: 4,
event: 5
};
enums.push(e);
defineReverseKeyEnum(e);

e = spine.BlendMode = {
Normal:0,
Additive: 1,
Multiply: 2,
Screen: 3
};
enums.push(e);
defineReverseKeyEnum(e);

e = spine.TransformMode = {
Normal: 0,
Expand All @@ -61,27 +66,27 @@ var spine;
NoScale: 3,
NoScaleOrReflection: 4
};
enums.push(e);
defineReverseKeyEnum(e);

e = spine.PositionMode = {
Fixed: 0,
Percent: 1
};
enums.push(e);
defineReverseKeyEnum(e);

e = spine.SpacingMode = {
Length: 0,
Fixed: 1,
Percent: 2
};
enums.push(e);
defineReverseKeyEnum(e);

e = spine.RotateMode = {
Tangent: 0,
Chain: 1,
ChainScale: 2
};
enums.push(e);
defineReverseKeyEnum(e);

e = spine.TextureFilter = {
Nearest: 9728,
Expand All @@ -92,14 +97,14 @@ var spine;
MipMapNearestLinear: 9986,
MipMapLinearLinear: 9987
};
enums.push(e);
defineReverseKeyEnum(e);

e = spine.TextureWrap = {
MirroredRepeat: 33648,
ClampToEdge: 33071,
Repeat: 10497
};
enums.push(e);
defineReverseKeyEnum(e);

e = spine.AttachmentType = {
Region: 0,
Expand All @@ -110,15 +115,7 @@ var spine;
Point: 5,
Clipping: 6
};
enums.push(e);

// Support reverse keys
enums.forEach((e) => {
for (var key in e) {
var value = e[key];
e[value] = key;
}
});
defineReverseKeyEnum(e);

e = null;

Expand Down

0 comments on commit 985f5a8

Please sign in to comment.