Open jeremyfa opened 1 year ago
Here is a modified AutoLayers_3_Mosaic.ldtk
file that I used to identify the issue: it's reduced to a 5x5 grid with only the Walls layer, but we can see the autoLayerTiles
array in the file contains way more tiles than the 25 that are required.
This is what the tilemap looks like in the LDtk editor:
And what I get if I render it with flixel + ldtk-haxe-api:
I noticed that in some situations,
autoLayerTiles
contains tiles that are out of the bounds of the layer grid. Also noticed that some tiles are not discarded and removed fromautoLayerTiles
as well although they are below another opaque tile.The
AutoLayers_3_Mosaic.ldtk
sample project does have those issues in the Walls layer, which is using "stamp" auto layer rules.This is not blocking because I managed to discard those out of bound tiles in my parser (in Ceramic) by checking for each tile if it's not outside those bounds, and also managed to discard tiles below opaque ones thanks to the tileset's
cachedPixelData
, but I guess that would be better to handle this beforehand in LDtk editor directly, to make reading that data easier for parser.Out of curiosity, I tested the rendering code for flixel provided by ldtk-haxe-api, and it does display tiles, even those that are out of bounds, so the issue is not specific to my parser.