Previously, it wasn't possible for multiple Spine Atlases to use PNGs with the exact same filename, even if they were in different folders. The SpineFile loader has now been updated so that the always-unique Spine key is pre-pended to the filename, for example if the key was bonus and the PNG in the atlas was coin.png then the final key (as stored in the Texture Manager) is now bonus:coin.png. The SpinePlugin.getAtlasCanvas and getAtlasWebGL methods have been updated to reflect this change. Fix #6022

This commit is contained in:
Richard Davey 2023-02-06 17:35:50 +00:00
parent b4ea85107b
commit 083a465f8d
2 changed files with 3 additions and 3 deletions

View file

@ -176,7 +176,7 @@ var SpineFile = new Class({
{
var textureURL = textures[i];
var key = textureURL;
var key = this.key + ':' + textureURL;
var image = new ImageFile(loader, key, textureURL, textureXhrSettings);

View file

@ -547,7 +547,7 @@ var SpinePlugin = new Class({
atlas = new Spine.TextureAtlas(atlasEntry.data, function (path)
{
return new Spine.canvas.CanvasTexture(textures.get(atlasEntry.prefix + path).getSourceImage());
return new Spine.canvas.CanvasTexture(textures.get(atlasEntry.prefix + key + ':' + path).getSourceImage());
});
}
@ -592,7 +592,7 @@ var SpinePlugin = new Class({
atlas = new Spine.TextureAtlas(atlasEntry.data, function (path)
{
return new Spine.webgl.GLTexture(gl, textures.get(atlasEntry.prefix + path).getSourceImage(), false);
return new Spine.webgl.GLTexture(gl, textures.get(atlasEntry.prefix + key + ':' + path).getSourceImage(), false);
});
}