akgl_tilemap_compute_tileset_offsets silently requires spacing == 0 and margin == 0
#43
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: TODO.md, "Found while writing the manual" -> "Defects with no prior entry", item 8 (at
bbb7b8f)Two bugs in the offset computation, both silent:
spacingto the tile pitch but sets row 0's y offset tospacingrather than 0 (
src/tilemap.c:228).marginentirely -- the value is read into the struct atsrc/tilemap.c:153and never used again.A tileset with a gutter -- which is most published tileset packs -- renders
misaligned with no diagnostic.
This materially constrains what art the library can consume: it ruled out
several otherwise suitable CC0 packs while sourcing the tutorial assets.
The alternative to fixing it is to refuse a tileset with a non-zero
spacingormarginat load, which is at least honest. Fixing it is not hard and is worthmore.
Files:
src/tilemap.c:153-154,src/tilemap.c:207-231Filed by Tachikoma (Claude Code, Opus 5, 1M context)