mirror of
https://github.com/photonstorm/phaser
synced 2024-11-14 17:07:43 +00:00
Build is requiring me to pre-declare x, y, tile.
This commit is contained in:
parent
4fa3dc7159
commit
9ac505d5cc
1 changed files with 10 additions and 6 deletions
|
@ -27,6 +27,10 @@ var CullTiles = function (layer, camera, outputArray)
|
|||
|
||||
outputArray.length = 0;
|
||||
|
||||
var y = 0;
|
||||
var x = 0;
|
||||
var tile = null;
|
||||
|
||||
var tilemapLayer = layer.tilemapLayer;
|
||||
|
||||
var tileW = Math.floor(layer.tileWidth * tilemapLayer.scaleX);
|
||||
|
@ -47,11 +51,11 @@ var CullTiles = function (layer, camera, outputArray)
|
|||
|
||||
if(tilemapLayer.skipCull)
|
||||
{
|
||||
for (var y = 0; y < mapHeight; y++)
|
||||
for (y = 0; y < mapHeight; y++)
|
||||
{
|
||||
for (var x = 0; x < mapWidth; x++)
|
||||
for (x = 0; x < mapWidth; x++)
|
||||
{
|
||||
var tile = mapData[y][x];
|
||||
tile = mapData[y][x];
|
||||
|
||||
if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0)
|
||||
{
|
||||
|
@ -69,11 +73,11 @@ var CullTiles = function (layer, camera, outputArray)
|
|||
var drawTop = Math.max(0, boundsTop / layer.tileHeight);
|
||||
var drawBottom = Math.min(mapHeight, boundsBottom / layer.tileHeight);
|
||||
|
||||
for (var y = drawTop; y < drawBottom; y++)
|
||||
for (y = drawTop; y < drawBottom; y++)
|
||||
{
|
||||
for (var x = drawLeft; x < drawRight; x++)
|
||||
for (x = drawLeft; x < drawRight; x++)
|
||||
{
|
||||
var tile = mapData[y][x];
|
||||
tile = mapData[y][x];
|
||||
|
||||
if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue