Merge branch '3.8' into 3.9-beta

This commit is contained in:
badlogic 2019-11-05 15:21:06 +01:00
commit 60c9d8c252
19 changed files with 69 additions and 8 deletions

View File

@ -412,6 +412,7 @@
* Added `Attachment#copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices. * Added `Attachment#copy()` to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.
* Added `MeshAttachment#newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh. * Added `MeshAttachment#newLinkedMesh()`, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.
* Added IK softness. * Added IK softness.
* Added `AssetManager.setRawDataURI(path, data)`. Allows to embed data URIs for skeletons, atlases and atlas page images directly in the HTML/JS without needing to load it from a separate file.
### WebGL backend ### WebGL backend
* `Input` can now take a partially defined implementation of `InputListener`. * `Input` can now take a partially defined implementation of `InputListener`.
@ -424,6 +425,7 @@
### Player ### Player
* `SpinePlayer#setAnimation()` can now be called directly to set the animation being displayed. * `SpinePlayer#setAnimation()` can now be called directly to set the animation being displayed.
* The player supports loading `.skel` binary skeleton files by setting the `SpinePlayerConfig#skelUrl` field instead of `SpinePlayerConfig#jsonUrl`. * The player supports loading `.skel` binary skeleton files by setting the `SpinePlayerConfig#skelUrl` field instead of `SpinePlayerConfig#jsonUrl`.
* Added `SpinePlayerConfig#rawDataURIs`. Allows to embed data URIs for skeletons, atlases and atlas page images directly in the HTML/JS without needing to load it from a separate file. See the example for a demonstration.
# 3.7 # 3.7

View File

@ -1874,6 +1874,7 @@ declare module spine {
jsonUrl: string; jsonUrl: string;
skelUrl: string; skelUrl: string;
atlasUrl: string; atlasUrl: string;
rawDataURIs: Map<string>;
animation: string; animation: string;
animations: string[]; animations: string[];
defaultMix: number; defaultMix: number;

View File

@ -798,6 +798,7 @@ var spine;
case MixBlend.replace: case MixBlend.replace:
for (var i_5 = 0; i_5 < vertexCount; i_5++) for (var i_5 = 0; i_5 < vertexCount; i_5++)
deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha; deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha;
break;
case MixBlend.add: case MixBlend.add:
var vertexAttachment = slotAttachment; var vertexAttachment = slotAttachment;
if (vertexAttachment.bones == null) { if (vertexAttachment.bones == null) {
@ -1836,6 +1837,7 @@ var spine;
entry.interruptAlpha = 1; entry.interruptAlpha = 1;
entry.mixTime = 0; entry.mixTime = 0;
entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);
entry.mixBlend = spine.MixBlend.replace;
return entry; return entry;
}; };
AnimationState.prototype.disposeNext = function (entry) { AnimationState.prototype.disposeNext = function (entry) {
@ -11667,6 +11669,12 @@ var spine;
return dom; return dom;
} }
this.assetManager = new spine.webgl.AssetManager(this.context); this.assetManager = new spine.webgl.AssetManager(this.context);
if (config.rawDataURIs) {
for (var path in config.rawDataURIs) {
var data = config.rawDataURIs[path];
this.assetManager.setRawDataURI(path, data);
}
}
if (config.jsonUrl) if (config.jsonUrl)
this.assetManager.loadText(config.jsonUrl); this.assetManager.loadText(config.jsonUrl);
else else

File diff suppressed because one or more lines are too long

View File

@ -798,6 +798,7 @@ var spine;
case MixBlend.replace: case MixBlend.replace:
for (var i_5 = 0; i_5 < vertexCount; i_5++) for (var i_5 = 0; i_5 < vertexCount; i_5++)
deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha; deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha;
break;
case MixBlend.add: case MixBlend.add:
var vertexAttachment = slotAttachment; var vertexAttachment = slotAttachment;
if (vertexAttachment.bones == null) { if (vertexAttachment.bones == null) {
@ -1836,6 +1837,7 @@ var spine;
entry.interruptAlpha = 1; entry.interruptAlpha = 1;
entry.mixTime = 0; entry.mixTime = 0;
entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);
entry.mixBlend = spine.MixBlend.replace;
return entry; return entry;
}; };
AnimationState.prototype.disposeNext = function (entry) { AnimationState.prototype.disposeNext = function (entry) {

File diff suppressed because one or more lines are too long

View File

@ -798,6 +798,7 @@ var spine;
case MixBlend.replace: case MixBlend.replace:
for (var i_5 = 0; i_5 < vertexCount; i_5++) for (var i_5 = 0; i_5 < vertexCount; i_5++)
deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha; deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha;
break;
case MixBlend.add: case MixBlend.add:
var vertexAttachment = slotAttachment; var vertexAttachment = slotAttachment;
if (vertexAttachment.bones == null) { if (vertexAttachment.bones == null) {
@ -1836,6 +1837,7 @@ var spine;
entry.interruptAlpha = 1; entry.interruptAlpha = 1;
entry.mixTime = 0; entry.mixTime = 0;
entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);
entry.mixBlend = spine.MixBlend.replace;
return entry; return entry;
}; };
AnimationState.prototype.disposeNext = function (entry) { AnimationState.prototype.disposeNext = function (entry) {

File diff suppressed because one or more lines are too long

View File

@ -1782,6 +1782,7 @@ declare module spine {
jsonUrl: string; jsonUrl: string;
skelUrl: string; skelUrl: string;
atlasUrl: string; atlasUrl: string;
rawDataURIs: Map<string>;
animation: string; animation: string;
animations: string[]; animations: string[];
defaultMix: number; defaultMix: number;

View File

@ -798,6 +798,7 @@ var spine;
case MixBlend.replace: case MixBlend.replace:
for (var i_5 = 0; i_5 < vertexCount; i_5++) for (var i_5 = 0; i_5 < vertexCount; i_5++)
deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha; deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha;
break;
case MixBlend.add: case MixBlend.add:
var vertexAttachment = slotAttachment; var vertexAttachment = slotAttachment;
if (vertexAttachment.bones == null) { if (vertexAttachment.bones == null) {
@ -1836,6 +1837,7 @@ var spine;
entry.interruptAlpha = 1; entry.interruptAlpha = 1;
entry.mixTime = 0; entry.mixTime = 0;
entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);
entry.mixBlend = spine.MixBlend.replace;
return entry; return entry;
}; };
AnimationState.prototype.disposeNext = function (entry) { AnimationState.prototype.disposeNext = function (entry) {
@ -10991,6 +10993,12 @@ var spine;
return dom; return dom;
} }
this.assetManager = new spine.webgl.AssetManager(this.context); this.assetManager = new spine.webgl.AssetManager(this.context);
if (config.rawDataURIs) {
for (var path in config.rawDataURIs) {
var data = config.rawDataURIs[path];
this.assetManager.setRawDataURI(path, data);
}
}
if (config.jsonUrl) if (config.jsonUrl)
this.assetManager.loadText(config.jsonUrl); this.assetManager.loadText(config.jsonUrl);
else else

File diff suppressed because one or more lines are too long

View File

@ -798,6 +798,7 @@ var spine;
case MixBlend.replace: case MixBlend.replace:
for (var i_5 = 0; i_5 < vertexCount; i_5++) for (var i_5 = 0; i_5 < vertexCount; i_5++)
deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha; deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha;
break;
case MixBlend.add: case MixBlend.add:
var vertexAttachment = slotAttachment; var vertexAttachment = slotAttachment;
if (vertexAttachment.bones == null) { if (vertexAttachment.bones == null) {
@ -1836,6 +1837,7 @@ var spine;
entry.interruptAlpha = 1; entry.interruptAlpha = 1;
entry.mixTime = 0; entry.mixTime = 0;
entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);
entry.mixBlend = spine.MixBlend.replace;
return entry; return entry;
}; };
AnimationState.prototype.disposeNext = function (entry) { AnimationState.prototype.disposeNext = function (entry) {

File diff suppressed because one or more lines are too long

View File

@ -798,6 +798,7 @@ var spine;
case MixBlend.replace: case MixBlend.replace:
for (var i_5 = 0; i_5 < vertexCount; i_5++) for (var i_5 = 0; i_5 < vertexCount; i_5++)
deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha; deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha;
break;
case MixBlend.add: case MixBlend.add:
var vertexAttachment = slotAttachment; var vertexAttachment = slotAttachment;
if (vertexAttachment.bones == null) { if (vertexAttachment.bones == null) {
@ -1836,6 +1837,7 @@ var spine;
entry.interruptAlpha = 1; entry.interruptAlpha = 1;
entry.mixTime = 0; entry.mixTime = 0;
entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);
entry.mixBlend = spine.MixBlend.replace;
return entry; return entry;
}; };
AnimationState.prototype.disposeNext = function (entry) { AnimationState.prototype.disposeNext = function (entry) {

File diff suppressed because one or more lines are too long

View File

@ -948,6 +948,7 @@ module spine {
case MixBlend.replace: case MixBlend.replace:
for (let i = 0; i < vertexCount; i++) for (let i = 0; i < vertexCount; i++)
deform[i] += (lastVertices[i] - deform[i]) * alpha; deform[i] += (lastVertices[i] - deform[i]) * alpha;
break;
case MixBlend.add: case MixBlend.add:
let vertexAttachment = slotAttachment as VertexAttachment; let vertexAttachment = slotAttachment as VertexAttachment;
if (vertexAttachment.bones == null) { if (vertexAttachment.bones == null) {

View File

@ -676,6 +676,7 @@ module spine {
entry.interruptAlpha = 1; entry.interruptAlpha = 1;
entry.mixTime = 0; entry.mixTime = 0;
entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation); entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);
entry.mixBlend = MixBlend.replace;
return entry; return entry;
} }

File diff suppressed because one or more lines are too long

View File

@ -49,6 +49,12 @@ module spine {
/* the URL of the skeleton .atlas file. Atlas page images are automatically resolved. */ /* the URL of the skeleton .atlas file. Atlas page images are automatically resolved. */
atlasUrl: string atlasUrl: string
/* Raw data URIs, mapping from a path to base 64 encoded raw data. When the player
resolves a path of the `jsonUrl`, `skelUrl`, `atlasUrl`, or the image paths
referenced in the atlas, it will first look for that path in this array of
raw data URIs. This allows embedding of resources directly in HTML/JS. */
rawDataURIs: Map<string>
/* Optional: the name of the animation to be played. Default: first animation in the skeleton. */ /* Optional: the name of the animation to be played. Default: first animation in the skeleton. */
animation: string animation: string
@ -421,6 +427,12 @@ module spine {
// Load the assets // Load the assets
this.assetManager = new spine.webgl.AssetManager(this.context); this.assetManager = new spine.webgl.AssetManager(this.context);
if (config.rawDataURIs) {
for (let path in config.rawDataURIs) {
let data = config.rawDataURIs[path];
this.assetManager.setRawDataURI(path, data);
}
}
if (config.jsonUrl) this.assetManager.loadText(config.jsonUrl); if (config.jsonUrl) this.assetManager.loadText(config.jsonUrl);
else this.assetManager.loadBinary(config.skelUrl); else this.assetManager.loadBinary(config.skelUrl);
this.assetManager.loadTextureAtlas(config.atlasUrl); this.assetManager.loadTextureAtlas(config.atlasUrl);