Skip to content

Commit 4489a12

Browse files
committed
Sprite.loadTexture and Image.loadTexture now no longer call updateTexture if the texture given is a RenderTexture. This fixes issues with RetroFonts in IE11 WebGL as well as other RenderTexture related IE11 problems (phaserjs#1310 phaserjs#1381 phaserjs#1523)
1 parent c154b8c commit 4489a12

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ Thanks to @pnstickne for vast majority of this update.
131131
* P2.Body.clearCollision default values were incorrectly set to `false` if no parameters were provided, even though the docs said they were `true` (thanks @brianbunch #1597)
132132
* BitmapText.font wouldn't update an internal Pixi property (fontName) causing the text to fail to change font (thanks @starnut #1602)
133133
* Fixed issue in PIXI.Text where it was using the wrong string for descender text measurements.
134+
* Sprite.loadTexture and Image.loadTexture now no longer call `updateTexture` if the texture given is a RenderTexture. This fixes issues with RetroFonts in IE11 WebGL as well as other RenderTexture related IE11 problems (#1310 #1381 #1523)
134135

135136
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
136137

src/gameobjects/Image.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,10 @@ Phaser.Image.prototype.loadTexture = function (key, frame) {
297297
}
298298
}
299299

300-
this.texture.baseTexture.dirty();
300+
if (!key instanceof Phaser.RenderTexture)
301+
{
302+
this.texture.baseTexture.dirty();
303+
}
301304

302305
if (setFrame)
303306
{

src/gameobjects/Sprite.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,10 @@ Phaser.Sprite.prototype.loadTexture = function (key, frame, stopAnimation) {
437437
}
438438
}
439439

440-
this.texture.baseTexture.dirty();
440+
if (!key instanceof Phaser.RenderTexture)
441+
{
442+
this.texture.baseTexture.dirty();
443+
}
441444

442445
if (setFrame)
443446
{

src/pixi/renderers/webgl/WebGLRenderer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,6 @@ PIXI.WebGLRenderer.prototype.updateTexture = function(texture)
424424
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
425425

426426
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
427-
428427

429428
if(texture.mipmap && PIXI.isPowerOfTwo(texture.width, texture.height))
430429
{

0 commit comments

Comments
 (0)