@@ -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);
0 commit comments