called for every cell in range, and for the 8 neighbours around each -
including cells outside width/height, so a caller wanting a hard map edge should have
it return false there rather than relying on this to bounds-check
the 47 frames a blobIndex of 0 to 46 selects between, drawn (or arranged)
against BLOB_SHAPES
one frame index per cell, row-major, EMPTY wherever sameTerrain is false
import { autotileFrames, BLOB_SHAPES } from '@datamoc/mw_games/two-d/render';
const water = new Set([0, 1, 10, 11]); // a 2x2 pond in a wider grid
const frames = Array.from({ length: BLOB_SHAPES.length }, (_, index) => index); // frame N = shape N
const cellFrames = autotileFrames(10, 10, (x, y) => water.has(y * 10 + x), frames);
console.log(cellFrames[0]); // the blob frame for the pond's top-left corner
One frame per cell of a terrain, autotiled from a same-terrain test alone.