StateManager fixes for when you change state in the create function.

TilemapLayer update for WebGL.
This commit is contained in:
photonstorm
2014-02-26 00:58:19 +00:00
parent d958b34f43
commit 994eaff92b
11 changed files with 310 additions and 88 deletions
+5 -11
View File
@@ -141,13 +141,12 @@ Phaser.StateManager.prototype = {
if (typeof this._pendingState === 'string')
{
// State was already added, so just start it
this.start(this._pendingState, false, false);
// this.start(this._pendingState, false, false);
}
else
{
this.add('default', this._pendingState, true);
}
}
},
@@ -251,12 +250,6 @@ Phaser.StateManager.prototype = {
{
this._args = Array.prototype.splice.call(arguments, 3);
}
// Already got a state running?
if (this.current)
{
this.onShutDownCallback.call(this.callbackContext, this.game);
}
}
},
@@ -307,7 +300,6 @@ Phaser.StateManager.prototype = {
if (this.game.load.totalQueuedFiles() === 0)
{
this.loadComplete();
// this.game.loadComplete();
}
else
{
@@ -319,10 +311,12 @@ Phaser.StateManager.prototype = {
{
// No init? Then there was nothing to load either
this.loadComplete();
// this.game.loadComplete();
}
this._pendingState = null;
if (this.current === this._pendingState)
{
this._pendingState = null;
}
}
},
+2 -1
View File
@@ -669,7 +669,8 @@ Phaser.TilemapLayer.prototype.render = function () {
// Only needed if running in WebGL, otherwise this array will never get cleared down I don't think!
if (this.game.renderType === Phaser.WEBGL)
{
PIXI.texturesToUpdate.push(this.baseTexture);
// PIXI.updateWebGLTexture(this.baseTexture, renderSession.gl);
PIXI.updateWebGLTexture(this.baseTexture, this.game.renderer.gl);
}
this.dirty = false;