Merge remote-tracking branch 'origin/master'

This commit is contained in:
Pavle Goloskokovic 2017-11-30 14:39:33 +01:00
commit 5f21646e6c
2 changed files with 6 additions and 5 deletions

View file

@ -306,7 +306,8 @@ var Tilemap = new Class({
row = [];
for (var tileX = 0; tileX < width; tileX++)
{
row.push(new Tile(layerData, -1, tileX, tileY, tileWidth, tileHeight));
row.push(new Tile(layerData, -1, tileX, tileY, tileWidth, tileHeight,
this.tileWidth, this.tileHeight));
}
layerData.data.push(row);
}

View file

@ -30,10 +30,10 @@ var CullTiles = function (layer, camera, outputArray)
if (tile === null || (tile.index <= 0 && tilemapLayer.skipIndexZero)) { continue; }
var tileX = tile.x * tileWidth - left;
var tileY = tile.y * tileHeight - top;
var cullW = camera.width + tileWidth;
var cullH = camera.height + tileHeight;
var tileX = tile.worldX - left;
var tileY = tile.worldY - top;
var cullW = camera.width + tile.width;
var cullH = camera.height + tile.height;
if (tile.visible &&
tileX > -tileWidth && tileY > -tileHeight &&