Skip to content

Commit 72cb334

Browse files
committed
cleaning up debug prints and such
1 parent cec71a8 commit 72cb334

7 files changed

Lines changed: 78 additions & 24 deletions

File tree

dist/phaser-arcade-physics.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175712,11 +175712,33 @@ var CullTiles = function (layer, camera, outputArray, renderOrder)
175712175712
{
175713175713
// Camera world view bounds, snapped for scaled tile size
175714175714
// Cull Padding values are given in tiles, not pixels
175715-
175716175715
var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX;
175717175716
var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX;
175718-
var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY;
175719-
var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY;
175717+
175718+
var boundsTop;
175719+
var boundsBottom;
175720+
175721+
if (layer.orientation === 'orthogonal')
175722+
{
175723+
boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY;
175724+
boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY;
175725+
}
175726+
else if (layer.orientation === 'staggered')
175727+
{
175728+
boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH / 2, 0, true) - tilemapLayer.cullPaddingY;
175729+
boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH / 2, 0, true) + tilemapLayer.cullPaddingY;
175730+
}
175731+
else if (layer.orientation === 'hexagonal')
175732+
{
175733+
var sidel = layer.hexSideLength;
175734+
var rowH = ((tileH - sidel) / 2 + sidel);
175735+
175736+
boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, rowH, 0, true) - tilemapLayer.cullPaddingY;
175737+
boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, rowH, 0, true) + tilemapLayer.cullPaddingY;
175738+
}
175739+
175740+
175741+
175720175742

175721175743
drawLeft = Math.max(0, boundsLeft);
175722175744
drawRight = Math.min(mapWidth, boundsRight);

dist/phaser-arcade-physics.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/phaser.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183440,11 +183440,33 @@ var CullTiles = function (layer, camera, outputArray, renderOrder)
183440183440
{
183441183441
// Camera world view bounds, snapped for scaled tile size
183442183442
// Cull Padding values are given in tiles, not pixels
183443-
183444183443
var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX;
183445183444
var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX;
183446-
var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY;
183447-
var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY;
183445+
183446+
var boundsTop;
183447+
var boundsBottom;
183448+
183449+
if (layer.orientation === 'orthogonal')
183450+
{
183451+
boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY;
183452+
boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY;
183453+
}
183454+
else if (layer.orientation === 'staggered')
183455+
{
183456+
boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH / 2, 0, true) - tilemapLayer.cullPaddingY;
183457+
boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH / 2, 0, true) + tilemapLayer.cullPaddingY;
183458+
}
183459+
else if (layer.orientation === 'hexagonal')
183460+
{
183461+
var sidel = layer.hexSideLength;
183462+
var rowH = ((tileH - sidel) / 2 + sidel);
183463+
183464+
boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, rowH, 0, true) - tilemapLayer.cullPaddingY;
183465+
boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, rowH, 0, true) + tilemapLayer.cullPaddingY;
183466+
}
183467+
183468+
183469+
183448183470

183449183471
drawLeft = Math.max(0, boundsLeft);
183450183472
drawRight = Math.min(mapWidth, boundsRight);

dist/phaser.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tilemaps/Tile.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -721,31 +721,19 @@ var Tile = new Class({
721721
// this is crucial for wordtotile, tiletoworld to work.
722722
this.pixelX = (this.x - this.y) * this.baseWidth * 0.5;
723723
this.pixelY = (this.x + this.y) * this.baseHeight * 0.5;
724-
725724
}
726725
else if (this.layer.orientation === 'staggered')
727726
{
728-
var tmap = this.layer.tilemapLayer.tilemap;
729727
this.pixelX = this.x * this.baseWidth + this.y % 2 * (this.baseWidth / 2);
730728
this.pixelY = this.y * (this.baseHeight / 2);
731-
732729
}
733730
else if (this.layer.orientation === 'hexagonal')
734731
{
735-
736-
// var tmap = this.layer.tilemapLayer.tilemap;
737-
console.log(this.layer.hexSideLength);
738732
var sidel = this.layer.hexSideLength;
739-
740733
var rowHeight = ((this.baseHeight - sidel) / 2 + sidel);
741734
this.pixelX = this.x * this.baseWidth + this.y % 2 * (this.baseWidth / 2);
742735
this.pixelY = this.y * rowHeight;
743-
744-
console.log('hexapix', this.pixelX, this.pixelY);
745736
}
746-
747-
// this.pixelY = this.y * this.baseHeight - (this.height - this.baseHeight);
748-
console.log(this.layer);
749737
return this;
750738
},
751739

src/tilemaps/components/CullTiles.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,33 @@ var CullTiles = function (layer, camera, outputArray, renderOrder)
5353
{
5454
// Camera world view bounds, snapped for scaled tile size
5555
// Cull Padding values are given in tiles, not pixels
56-
5756
var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX;
5857
var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX;
59-
var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY;
60-
var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY;
58+
59+
var boundsTop;
60+
var boundsBottom;
61+
62+
if (layer.orientation === 'orthogonal')
63+
{
64+
boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY;
65+
boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY;
66+
}
67+
else if (layer.orientation === 'staggered')
68+
{
69+
boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH / 2, 0, true) - tilemapLayer.cullPaddingY;
70+
boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH / 2, 0, true) + tilemapLayer.cullPaddingY;
71+
}
72+
else if (layer.orientation === 'hexagonal')
73+
{
74+
var sidel = layer.hexSideLength;
75+
var rowH = ((tileH - sidel) / 2 + sidel);
76+
77+
boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, rowH, 0, true) - tilemapLayer.cullPaddingY;
78+
boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, rowH, 0, true) + tilemapLayer.cullPaddingY;
79+
}
80+
81+
82+
6183

6284
drawLeft = Math.max(0, boundsLeft);
6385
drawRight = Math.min(mapWidth, boundsRight);

src/tilemaps/components/TileToWorldX.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var TileToWorldX = function (tileX, camera, layer)
3838
{
3939
return layerWorldX + tileX * tileWidth;
4040
}
41-
else if (orientation === 'isometric' || orientation === 'staggered' || orientation === 'hexagonal' )
41+
else if (orientation === 'isometric' || orientation === 'staggered' || orientation === 'hexagonal')
4242
{
4343
// Not Best Solution ?
4444
console.warn('With the current map type you have to use the TileToWorldXY function.');

0 commit comments

Comments
 (0)