mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 05:33:35 +00:00
Update TextureSource.js
This commit is contained in:
parent
9607ce89c7
commit
556b5b05be
1 changed files with 8 additions and 6 deletions
|
@ -228,23 +228,25 @@ var TextureSource = new Class({
|
||||||
*/
|
*/
|
||||||
init: function (game)
|
init: function (game)
|
||||||
{
|
{
|
||||||
if (this.renderer)
|
var renderer = this.renderer;
|
||||||
|
|
||||||
|
if (renderer)
|
||||||
{
|
{
|
||||||
if (this.renderer.gl)
|
if (renderer.gl)
|
||||||
{
|
{
|
||||||
if (this.isCanvas)
|
if (this.isCanvas)
|
||||||
{
|
{
|
||||||
this.glTexture = this.renderer.createCanvasTexture(this.image, false, this.flipY);
|
this.glTexture = renderer.createCanvasTexture(this.image, false, this.flipY);
|
||||||
}
|
}
|
||||||
else if (this.isVideo)
|
else if (this.isVideo)
|
||||||
{
|
{
|
||||||
this.glTexture = this.renderer.createVideoTexture(this.image, false, this.flipY);
|
this.glTexture = renderer.createVideoTexture(this.image, false, this.flipY);
|
||||||
}
|
}
|
||||||
else if (this.isRenderTexture)
|
else if (this.isRenderTexture)
|
||||||
{
|
{
|
||||||
this.image = this.source.canvas;
|
this.image = this.source.canvas;
|
||||||
|
|
||||||
this.glTexture = this.renderer.createTextureFromSource(null, this.width, this.height, this.scaleMode);
|
this.glTexture = renderer.createTextureFromSource(null, this.width, this.height, this.scaleMode);
|
||||||
}
|
}
|
||||||
else if (this.isGLTexture)
|
else if (this.isGLTexture)
|
||||||
{
|
{
|
||||||
|
@ -252,7 +254,7 @@ var TextureSource = new Class({
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.glTexture = this.renderer.createTextureFromSource(this.image, this.width, this.height, this.scaleMode);
|
this.glTexture = renderer.createTextureFromSource(this.image, this.width, this.height, this.scaleMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (this.isRenderTexture)
|
else if (this.isRenderTexture)
|
||||||
|
|
Loading…
Reference in a new issue