From 083a465f8d752f6716d08c34dabecbe3d3c1f08f Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Mon, 6 Feb 2023 17:35:50 +0000 Subject: [PATCH] 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 --- plugins/spine/src/SpineFile.js | 2 +- plugins/spine/src/SpinePlugin.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/spine/src/SpineFile.js b/plugins/spine/src/SpineFile.js index 3f57b63fc..3bf318e0c 100644 --- a/plugins/spine/src/SpineFile.js +++ b/plugins/spine/src/SpineFile.js @@ -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); diff --git a/plugins/spine/src/SpinePlugin.js b/plugins/spine/src/SpinePlugin.js index d51afe2ea..16f2ff84c 100644 --- a/plugins/spine/src/SpinePlugin.js +++ b/plugins/spine/src/SpinePlugin.js @@ -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); }); }