move 'dirty' flag for Tilemap to a per-layer flag. Fixes #242

This commit is contained in:
Josh Shepard (jcs)
2013-12-04 09:42:25 -08:00
parent 666df67453
commit 539dcdd18a
2 changed files with 11 additions and 21 deletions
+6 -6
View File
@@ -359,7 +359,7 @@ Phaser.TilemapLayer.prototype.updateMapData = function (tilemap, layer) {
this.layer = this.tilemap.layers[layer];
this.index = layer;
this.updateMax();
this.tilemap.dirty = true;
this.tilemap.layers[layer].dirty = true;
}
}
@@ -633,7 +633,7 @@ Phaser.TilemapLayer.prototype.updateMax = function () {
*/
Phaser.TilemapLayer.prototype.render = function () {
if (this.tilemap && this.tilemap.dirty)
if (this.tilemap && this.tilemap.layers[this.index].dirty )
{
this.dirty = true;
}
@@ -694,10 +694,10 @@ Phaser.TilemapLayer.prototype.render = function () {
this.dirty = false;
if (this.tilemap.dirty)
{
this.tilemap.dirty = false;
}
if( this.tilemap.layers[this.index].dirty )
{
this.tilemap.layers[this.index].dirty = false;
}
return true;