mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
The SpineFile
will no longer throw a warning if adding a texture into the Texture Manager that already exists. This allows you to have multiple Spine JSON use the same texture file, however, it also means you now get no warning if you accidentally load a texture that exists, so be careful with your keys! Fix #4947
This commit is contained in:
parent
2c79753ef3
commit
798fa8f5fd
1 changed files with 5 additions and 1 deletions
|
@ -211,6 +211,7 @@ var SpineFile = new Class({
|
|||
var atlasKey = '';
|
||||
var combinedAtlasData = '';
|
||||
var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false;
|
||||
var textureManager = this.loader.textureManager;
|
||||
|
||||
for (var i = 1; i < this.files.length; i++)
|
||||
{
|
||||
|
@ -230,7 +231,10 @@ var SpineFile = new Class({
|
|||
var pos = src.indexOf('_');
|
||||
var key = src.substr(pos + 1);
|
||||
|
||||
this.loader.textureManager.addImage(key, file.data);
|
||||
if (!textureManager.exists(key))
|
||||
{
|
||||
textureManager.addImage(key, file.data);
|
||||
}
|
||||
}
|
||||
|
||||
file.pendingDestroy();
|
||||
|
|
Loading…
Reference in a new issue