Commit Graph

11 Commits

Author SHA1 Message Date
Axel Meyer
d5fb03b8d0 feat(write-sprite): compose atlas image + UV-JSON + lock output 2026-06-16 21:17:32 +02:00
Axel Meyer
33f43a1d8e feat(lock-sprite): stable alias-set + source-file persistence across re-bakes 2026-06-16 21:13:30 +02:00
Axel Meyer
348b226c26 feat(pack-shelf): height-sort desc shelf packing with oversize loud-error 2026-06-16 21:09:06 +02:00
Axel Meyer
61c44b4569 fix(fixtures): platform-neutral collision pair (avoid Windows case-insensitivity) 2026-06-16 21:04:30 +02:00
Axel Meyer
50a0a3508f feat(scan-sprite): walk dir, normalise aliases, detect collisions 2026-06-16 21:02:06 +02:00
Axel Meyer
775ad58308 feat(alias): filename -> snake_case alias converter 2026-06-16 20:57:07 +02:00
Axel Meyer
dea2d8fb88 Wire bake orchestrator and CLI
Connects scan + lock + pack + write into the full pipeline. CLI entry
parses args, dispatches to bake(), prints summary or error. Five
integration tests cover fresh bake, lock-aware ID preservation,
deleted-tile tracking, oversize hard-fail, and bit-identical
determinism across re-bakes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 22:48:08 +02:00
Axel Meyer
589bdaef10 Add atlas composers and output writers
composeAtlas blits placed tile pixels into bounds-sized RGBA + L8 PNGs,
synthesizing L8=0 planes for unpaired diffuse tiles. buildAtlasJson
emits the metadata with deterministic ID-sorted tile arrays and applies
the optional blocks_sight regex.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 22:45:54 +02:00
Axel Meyer
52689e9a9c Add MaxRects Best-Area-Fit packer
Deterministic placement heuristic (Best-Area-Fit with tiebreak on
shorter remaining short side). Power-of-2-rounded output bounds for
GPU friendliness. Oversize hard-fails with packed-area diagnostic.

Test bounds corrected: guillotine split fills tiles left-to-right,
so 3x 32x32 tiles produce boundsW=128 (not 64 as the plan draft had).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 22:44:00 +02:00
Axel Meyer
83499850fb Add lock-file load and stable ID assignment
Lock-file determinism guarantees re-bakes do not renumber existing
tiles. Atlas_id mismatch is a hard-fail to prevent silent corruption.
Deleted tile IDs move to deleted[] and are not recycled.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 22:40:50 +02:00
Axel Meyer
b64e3e87a9 Init atlas-baker tool with source-dir scan and pair-detection
Creates the sporel-tool-atlas-baker Node CLI scaffold and the first
phase of the bake pipeline: scan a source directory for *_diffuse.png
files, pair them with optional *_height.png companions, and return
alphabetically-sorted sources for deterministic re-bakes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 22:38:42 +02:00