mirror of
https://github.com/wassname/phaser.git
synced 2026-07-12 00:50:45 +08:00
StateManager fixes for when you change state in the create function.
TilemapLayer update for WebGL.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user