Skip to content

Commit 8b7085e

Browse files
committed
RenderTexture guards.
1 parent e93ded3 commit 8b7085e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/gameobjects/components/LoadTexture.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ Phaser.Component.LoadTexture.prototype = {
3131

3232
var setFrame = true;
3333
var smoothed = !this.texture.baseTexture.scaleMode;
34+
var isRenderTexture = false;
3435

35-
if (key instanceof Phaser.RenderTexture)
36+
if (Phaser.RenderTexture && key instanceof Phaser.RenderTexture)
3637
{
3738
this.key = key.key;
3839
this.setTexture(key);
40+
isRenderTexture = true;
3941
}
40-
else if (key instanceof Phaser.BitmapData)
42+
else if (Phaser.BitmapData && key instanceof Phaser.BitmapData)
4143
{
4244
// This works from a reference, which probably isn't what we need here
4345
this.setTexture(key.texture);
@@ -72,7 +74,7 @@ Phaser.Component.LoadTexture.prototype = {
7274
}
7375
}
7476

75-
if (!key instanceof Phaser.RenderTexture)
77+
if (!isRenderTexture)
7678
{
7779
this.texture.baseTexture.dirty();
7880
}

0 commit comments

Comments
 (0)