mirror of
https://github.com/photonstorm/phaser
synced 2024-11-21 20:23:19 +00:00
spine4.1 plugin about createSkeleton perf issue (also optimize spine plugin spineFileCallback func)
This commit is contained in:
parent
9841602bbe
commit
9fa74e7dc4
26 changed files with 155082 additions and 133386 deletions
62504
plugins/spine/dist/SpineCanvasPlugin.js
vendored
62504
plugins/spine/dist/SpineCanvasPlugin.js
vendored
File diff suppressed because it is too large
Load diff
1255
plugins/spine/dist/SpineCanvasPlugin.min.js
vendored
1255
plugins/spine/dist/SpineCanvasPlugin.min.js
vendored
File diff suppressed because one or more lines are too long
8208
plugins/spine/dist/SpineCanvasPluginDebug.js
vendored
8208
plugins/spine/dist/SpineCanvasPluginDebug.js
vendored
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
63501
plugins/spine/dist/SpinePlugin.js
vendored
63501
plugins/spine/dist/SpinePlugin.js
vendored
File diff suppressed because it is too large
Load diff
1273
plugins/spine/dist/SpinePlugin.min.js
vendored
1273
plugins/spine/dist/SpinePlugin.min.js
vendored
File diff suppressed because one or more lines are too long
76783
plugins/spine/dist/SpinePluginDebug.js
vendored
76783
plugins/spine/dist/SpinePluginDebug.js
vendored
File diff suppressed because it is too large
Load diff
2
plugins/spine/dist/SpinePluginDebug.js.map
vendored
2
plugins/spine/dist/SpinePluginDebug.js.map
vendored
File diff suppressed because one or more lines are too long
62858
plugins/spine/dist/SpineWebGLPlugin.js
vendored
62858
plugins/spine/dist/SpineWebGLPlugin.js
vendored
File diff suppressed because it is too large
Load diff
1267
plugins/spine/dist/SpineWebGLPlugin.min.js
vendored
1267
plugins/spine/dist/SpineWebGLPlugin.min.js
vendored
File diff suppressed because one or more lines are too long
8224
plugins/spine/dist/SpineWebGLPluginDebug.js
vendored
8224
plugins/spine/dist/SpineWebGLPluginDebug.js
vendored
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
|
@ -653,12 +653,14 @@ var SpinePlugin = new Class({
|
|||
* @param {boolean} [preMultipliedAlpha=false] - Do the texture files include pre-multiplied alpha or not?
|
||||
* @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the Spine json file. Used in replacement of the Loaders default XHR Settings.
|
||||
* @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the Spine atlas file. Used in replacement of the Loaders default XHR Settings.
|
||||
* @param {object} [settings] - An external Settings configuration object { prefix: '' }
|
||||
*
|
||||
* @return {Phaser.Loader.LoaderPlugin} The Loader instance.
|
||||
*/
|
||||
spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings)
|
||||
spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings, settings)
|
||||
{
|
||||
var multifile;
|
||||
settings = settings || {};
|
||||
|
||||
if (Array.isArray(key))
|
||||
{
|
||||
|
@ -666,6 +668,9 @@ var SpinePlugin = new Class({
|
|||
{
|
||||
multifile = new SpineFile(this, key[i]);
|
||||
|
||||
// Support prefix key
|
||||
multifile.prefix = multifile.prefix || settings.prefix || '';
|
||||
|
||||
this.addFile(multifile.files);
|
||||
}
|
||||
}
|
||||
|
@ -673,6 +678,9 @@ var SpinePlugin = new Class({
|
|||
{
|
||||
multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings);
|
||||
|
||||
// Support prefix key
|
||||
multifile.prefix = multifile.prefix || settings.prefix || '';
|
||||
|
||||
this.addFile(multifile.files);
|
||||
}
|
||||
|
||||
|
|
40
plugins/spine4.1/dist/SpineCanvasPlugin.js
vendored
40
plugins/spine4.1/dist/SpineCanvasPlugin.js
vendored
|
@ -24620,35 +24620,33 @@ var SpinePlugin = new Class({
|
|||
return null;
|
||||
}
|
||||
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
if (this.isWebGL)
|
||||
if (!this.spineTextures.has(atlasKey))
|
||||
{
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
else
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
}
|
||||
else
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var spineTextureKey = atlasData.prefix ? atlasData.prefix + atlasKey : atlasKey;
|
||||
|
||||
if (!this.spineTextures.has(spineTextureKey))
|
||||
{
|
||||
this.spineTextures.add(spineTextureKey, atlas);
|
||||
this.spineTextures.add(atlasKey, atlas);
|
||||
}
|
||||
|
||||
var preMultipliedAlpha = atlasData.preMultipliedAlpha;
|
||||
|
|
File diff suppressed because one or more lines are too long
40
plugins/spine4.1/dist/SpineCanvasPluginDebug.js
vendored
40
plugins/spine4.1/dist/SpineCanvasPluginDebug.js
vendored
|
@ -37208,35 +37208,33 @@ var SpinePlugin = new Class({
|
|||
return null;
|
||||
}
|
||||
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
if (this.isWebGL)
|
||||
if (!this.spineTextures.has(atlasKey))
|
||||
{
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
else
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
}
|
||||
else
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var spineTextureKey = atlasData.prefix ? atlasData.prefix + atlasKey : atlasKey;
|
||||
|
||||
if (!this.spineTextures.has(spineTextureKey))
|
||||
{
|
||||
this.spineTextures.add(spineTextureKey, atlas);
|
||||
this.spineTextures.add(atlasKey, atlas);
|
||||
}
|
||||
|
||||
var preMultipliedAlpha = atlasData.preMultipliedAlpha;
|
||||
|
|
File diff suppressed because one or more lines are too long
40
plugins/spine4.1/dist/SpinePlugin.js
vendored
40
plugins/spine4.1/dist/SpinePlugin.js
vendored
|
@ -15141,35 +15141,33 @@ var SpinePlugin = new Class({
|
|||
return null;
|
||||
}
|
||||
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
if (this.isWebGL)
|
||||
if (!this.spineTextures.has(atlasKey))
|
||||
{
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
else
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
}
|
||||
else
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var spineTextureKey = atlasData.prefix ? atlasData.prefix + atlasKey : atlasKey;
|
||||
|
||||
if (!this.spineTextures.has(spineTextureKey))
|
||||
{
|
||||
this.spineTextures.add(spineTextureKey, atlas);
|
||||
this.spineTextures.add(atlasKey, atlas);
|
||||
}
|
||||
|
||||
var preMultipliedAlpha = atlasData.preMultipliedAlpha;
|
||||
|
|
2
plugins/spine4.1/dist/SpinePlugin.min.js
vendored
2
plugins/spine4.1/dist/SpinePlugin.min.js
vendored
File diff suppressed because one or more lines are too long
40
plugins/spine4.1/dist/SpinePluginDebug.js
vendored
40
plugins/spine4.1/dist/SpinePluginDebug.js
vendored
|
@ -37443,35 +37443,33 @@ var SpinePlugin = new Class({
|
|||
return null;
|
||||
}
|
||||
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
if (this.isWebGL)
|
||||
if (!this.spineTextures.has(atlasKey))
|
||||
{
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
else
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
}
|
||||
else
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var spineTextureKey = atlasData.prefix ? atlasData.prefix + atlasKey : atlasKey;
|
||||
|
||||
if (!this.spineTextures.has(spineTextureKey))
|
||||
{
|
||||
this.spineTextures.add(spineTextureKey, atlas);
|
||||
this.spineTextures.add(atlasKey, atlas);
|
||||
}
|
||||
|
||||
var preMultipliedAlpha = atlasData.preMultipliedAlpha;
|
||||
|
|
File diff suppressed because one or more lines are too long
40
plugins/spine4.1/dist/SpineWebGLPlugin.js
vendored
40
plugins/spine4.1/dist/SpineWebGLPlugin.js
vendored
|
@ -27178,35 +27178,33 @@ var SpinePlugin = new Class({
|
|||
return null;
|
||||
}
|
||||
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
if (this.isWebGL)
|
||||
if (!this.spineTextures.has(atlasKey))
|
||||
{
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
else
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
}
|
||||
else
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var spineTextureKey = atlasData.prefix ? atlasData.prefix + atlasKey : atlasKey;
|
||||
|
||||
if (!this.spineTextures.has(spineTextureKey))
|
||||
{
|
||||
this.spineTextures.add(spineTextureKey, atlas);
|
||||
this.spineTextures.add(atlasKey, atlas);
|
||||
}
|
||||
|
||||
var preMultipliedAlpha = atlasData.preMultipliedAlpha;
|
||||
|
|
File diff suppressed because one or more lines are too long
40
plugins/spine4.1/dist/SpineWebGLPluginDebug.js
vendored
40
plugins/spine4.1/dist/SpineWebGLPluginDebug.js
vendored
|
@ -37328,35 +37328,33 @@ var SpinePlugin = new Class({
|
|||
return null;
|
||||
}
|
||||
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
if (this.isWebGL)
|
||||
if (!this.spineTextures.has(atlasKey))
|
||||
{
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
else
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
}
|
||||
else
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var spineTextureKey = atlasData.prefix ? atlasData.prefix + atlasKey : atlasKey;
|
||||
|
||||
if (!this.spineTextures.has(spineTextureKey))
|
||||
{
|
||||
this.spineTextures.add(spineTextureKey, atlas);
|
||||
this.spineTextures.add(atlasKey, atlas);
|
||||
}
|
||||
|
||||
var preMultipliedAlpha = atlasData.preMultipliedAlpha;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -638,6 +638,7 @@ var SpinePlugin = new Class({
|
|||
* @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the Spine json file. Used in replacement of the Loaders default XHR Settings.
|
||||
* @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the Spine atlas file. Used in replacement of the Loaders default XHR Settings.
|
||||
* @param {object} [settings] - An external Settings configuration object { prefix: '' }
|
||||
*
|
||||
* @return {Phaser.Loader.LoaderPlugin} The Loader instance.
|
||||
*/
|
||||
spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings, settings)
|
||||
|
@ -971,35 +972,33 @@ var SpinePlugin = new Class({
|
|||
return null;
|
||||
}
|
||||
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
if (this.isWebGL)
|
||||
if (!this.spineTextures.has(atlasKey))
|
||||
{
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
var gl = this.gl;
|
||||
var i;
|
||||
var atlasPage;
|
||||
var realTextureKey;
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||
}
|
||||
else
|
||||
|
||||
for (i = 0; i < atlas.pages.length; i ++)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
atlasPage = atlas.pages[i];
|
||||
realTextureKey = atlasData.prefix ? atlasData.prefix + atlasPage.name : atlasPage.name;
|
||||
if (this.isWebGL)
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.GLTexture(gl, this.textures.get(realTextureKey).getSourceImage(), false));
|
||||
}
|
||||
else
|
||||
{
|
||||
atlasPage.setTexture(new this.runtime.CanvasTexture(this.textures.get(realTextureKey).getSourceImage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var spineTextureKey = atlasData.prefix ? atlasData.prefix + atlasKey : atlasKey;
|
||||
|
||||
if (!this.spineTextures.has(spineTextureKey))
|
||||
{
|
||||
this.spineTextures.add(spineTextureKey, atlas);
|
||||
this.spineTextures.add(atlasKey, atlas);
|
||||
}
|
||||
|
||||
var preMultipliedAlpha = atlasData.preMultipliedAlpha;
|
||||
|
|
Loading…
Reference in a new issue