CellTileBuffer
ldtk.rules.CellTileBuffer (Class)
Cell indexed tile store for runtime use, supporting partial recomputes: the tiles of any cell can be cleared and
rewritten in place (RuleEngine.computeRect). Records live in a reusable pool of STRIDE ints, chained per cell;
the capacity is kept between computes and nothing is allocated once the pool has reached its peak size.
Record layout: ruleIndex (index in the evaluation order), tid, flips, x, y, srcX, srcY, alpha*4096, next record (-1 = end).
Static Members
Instance Members
Number of cells of the layer (set by reset)
Number of rules declared by the last setRules
Size the store for a layer of cellCount cells and empty it
Declare the rules of the next compute (evaluation order). Must be called before beginRule.
Returns TRUE if the rule list differs from the previous one: the stored rule indexes are then stale
and the store must be fully recomputed.
Remove the tiles of a cell (the records go back to the free list)
Remove the tiles of every cell of a rectangle (inclusive bounds)
Write every tile in display order (rules from the last evaluated to the first, cells in ascending order,
tiles of a cell in production order) as 7 ints per tile: tid, flips, x, y, srcX, srcY, alpha*4096.
This is the autoLayerTiles layout and the exact order produced by RuleEngine.flatten in the editor.
out is reused and resized; returns the number of ints written.
First record of a cell, or -1
Record following i, or -1
Private Members