import { xpAutotileRef } from '@datamoc/mwg/two-d/render';
console.log(xpAutotileRef(97)); // { index: 2, pattern: 1 } - second image, second pattern
console.log(xpAutotileRef(0)); // null - EMPTY is blank, never an autotile
console.log(xpAutotileRef(384)); // null - the first static tileset tile
Decodes a raw XP map cell into its autotile image and pattern, or null when the cell holds no autotile reference:
EMPTY, a static tileset tile (384 and up), or anything outside the 1-383 autotile range.