Skip to content

Commit d206dd0

Browse files
committed
Updates for Pixi v2
1 parent ac27f12 commit d206dd0

4 files changed

Lines changed: 5 additions & 21 deletions

File tree

src/gameobjects/BitmapData.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,13 +1301,9 @@ Phaser.BitmapData.prototype = {
13011301
*/
13021302
render: function () {
13031303

1304-
if (!this.disableTextureUpload && this.game.renderType === Phaser.WEBGL && this.dirty)
1304+
if (!this.disableTextureUpload && this.dirty)
13051305
{
1306-
// Only needed if running in WebGL, otherwise this array will never get cleared down
1307-
// should use the rendersession
1308-
// PIXI.updateWebGLTexture(this.baseTexture, this.game.renderer.gl);
1309-
// this.baseTexture._updateUvs();
1310-
1306+
this.baseTexture.dirty();
13111307
this.dirty = false;
13121308
}
13131309

src/gameobjects/Image.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,7 @@ Phaser.Image.prototype.setFrame = function(frame) {
358358
}
359359
else
360360
{
361-
if (this.game.renderType === Phaser.WEBGL)
362-
{
363-
this.texture._updateUvs();
364-
// PIXI.WebGLRenderer.updateTextureFrame(this.texture);
365-
}
361+
this.texture.baseTexture.dirty();
366362
}
367363

368364
};

src/gameobjects/Sprite.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,7 @@ Phaser.Sprite.prototype.setFrame = function(frame) {
474474
}
475475
else
476476
{
477-
if (this.game.renderType === Phaser.WEBGL)
478-
{
479-
this.texture._updateUvs();
480-
// PIXI.WebGLRenderer.updateTextureFrame(this.texture);
481-
}
477+
this.texture.baseTexture.dirty();
482478
}
483479

484480
};

src/gameobjects/TileSprite.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,7 @@ Phaser.TileSprite.prototype.setFrame = function(frame) {
424424
this.texture.trim = null;
425425
}
426426

427-
if (this.game.renderType === Phaser.WEBGL)
428-
{
429-
this.texture._updateUvs();
430-
// PIXI.WebGLRenderer.updateTextureFrame(this.texture);
431-
}
427+
this.texture.baseTexture.dirty();
432428

433429
};
434430

0 commit comments

Comments
 (0)