This commit is contained in:
spayton 2015-11-17 16:02:38 +00:00
commit 2d1ab1ab8c
3 changed files with 11 additions and 5 deletions

View file

@ -279,6 +279,8 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
### Bug Fixes
* Buttons (or any Sprites) that don't have a texture, but have children, would incorrectly render the children under WebGL due to the baseTexture.skipRender property (thanks @puzzud #2141)
* TilemapParser accidentally redeclared `i` when parsing the ImageCollections which would cause an infinite loop (thanks DanHett)
* BitmapData.update causes a snowballing memory leak under WebGL due to a Context.getImageData call. BitmapData.clear used to call update automatically but no longer does. This resolves the issue of the Debug class causing excessive memory build-up in Chrome. Firefox and IE were unaffected (thanks @kingjerod #2208)
### Pixi Updates

View file

@ -441,6 +441,9 @@ Phaser.BitmapData.prototype = {
* You can optionally define the area to clear.
* If the arguments are left empty it will clear the entire canvas.
*
* You may need to call BitmapData.update after this in order to clear out the pixel data,
* but Phaser will not do this automatically for you.
*
* @method Phaser.BitmapData#clear
* @param {number} [x=0] - The x coordinate of the top-left of the area to clear.
* @param {number} [y=0] - The y coordinate of the top-left of the area to clear.
@ -457,8 +460,6 @@ Phaser.BitmapData.prototype = {
this.context.clearRect(x, y, width, height);
this.update();
this.dirty = true;
return this;
@ -567,6 +568,8 @@ Phaser.BitmapData.prototype = {
* It then re-builds the ArrayBuffer, the data Uint8ClampedArray reference and the pixels Int32Array.
* If not given the dimensions defaults to the full size of the context.
*
* Warning: This is a very expensive operation, so use it sparingly.
*
* @method Phaser.BitmapData#update
* @param {number} [x=0] - The x coordinate of the top-left of the image data area to grab from.
* @param {number} [y=0] - The y coordinate of the top-left of the image data area to grab from.

View file

@ -78,6 +78,7 @@ Phaser.TilemapParser = {
* Parses a CSV file into valid map data.
*
* @method Phaser.TilemapParser.parseCSV
* @param {string} key - The name you want to give the map data.
* @param {string} data - The CSV file data.
* @param {number} [tileWidth=32] - The pixel width of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data.
* @param {number} [tileHeight=32] - The pixel height of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data.
@ -446,10 +447,10 @@ Phaser.TilemapParser = {
{
var newCollection = new Phaser.ImageCollection(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing, set.properties);
for (var i in set.tiles)
for (var ti in set.tiles)
{
var image = set.tiles[i].image;
var gid = set.firstgid + parseInt(i, 10);
var image = set.tiles[ti].image;
var gid = set.firstgid + parseInt(ti, 10);
newCollection.addImage(gid, image);
}