Commit Graph

8 Commits

Author SHA1 Message Date
Axel Meyer
b5621c5d08 fix(maps): v0.5.6 — derive bitmask from cell's own corner paint-tiles
compute_cell_bitmask_v3 now reads the 8-bit neighbour bitmask from
the render-cell's own 4 corner paint-tiles (cardinal bit set iff
at least one of the 2 paint-tiles on that edge is painted; diagonal
bit set iff the corner paint-tile is painted), not from the
any-corner material status of the 8 neighbour render-cells.

Pre-0.5.6 used cell-neighbour-material, which let two cells share
connectivity across an empty paint-tile gap whenever any unrelated
corner of either was painted — producing connected blob shapes
where two visually separated 2x2 islands were expected.

Atlas, paint storage, override sublayer, public API and the slot
lookup table all unchanged. Doc comment and README painting-model
section rewritten to describe the dual-grid offset explicitly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-01 17:19:26 +02:00
calic
b4c0e0f4b5 docs(README): bump header 0.2.0 -> 0.5.4 + add v0.3-0.5.4 API summary
Adds schema-version table, v3 painting model (vertex grid + any-corner
rule + blob-14 SLOT_LOOKUP + override sublayer), and a per-version
summary of APIs added between 0.3.0 and 0.5.4. Original v0.2.0 entries
remain in their existing layout below the new summary.
2026-05-29 09:33:29 +02:00
Axel Meyer
5cf07c8549 Bump lib-core.maps to v0.4.0 and document the write APIs
Three new public functions (set_cell_gid, set_roof, save_to_disk)
documented in the README alongside the existing read API. Purely
additive bump — existing consumers continue to compile and run
unchanged.
2026-05-24 00:51:09 +02:00
Axel Meyer
6b2dc22227 Document v0.2.0 API and schema-v2 map format
Update README.md to version 0.2.0: add API entries for the 16 new
public functions (encode_gid, decode_gid, upgrade_v1_to_v2,
validate_map_table_v2, atlas_count, atlas_id_at, has_layer, is_indoor,
cell_gid, tile_at_layer, blocks_walk, blocks_sight,
iterate_layers_pre_entities, iterate_layers_post_entities,
draw_map_pre_entities, draw_map_post_entities), add the schema-v2
reference section documenting layer-stack, packed-u32 GID bit layout,
auto-migration, and a v0.2.0 changelog entry.

Fix tile-id OOB validation regression in build_map_v2: after v1->v2
upgrade, packed GIDs were not checked against atlas palette sizes.
Restore the check in build_map_v2 so loading a map with an out-of-range
tile_id still produces a fatal error with the same message pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 16:33:27 +02:00
Axel Meyer
2b5acb5caf feat: v0.1.2 sprite-mode in draw_map + tile_rotations + load_textures
Sprite-mode in draw_map:
- tilemap-tiles with texture atlas-id render via
  engine.render.draw_sprite_transform with rotation pivot at tile center
- tiles without texture continue to render via draw_rect with color
  (Phase 1 mode preserved)

Tile rotation:
- maps support an optional tile_rotations parallel array in the map
  JSON with per-cell 90-degree rotation values (0/90/180/270)
- absent or nil entries default to 0 (no rotation)
- enables 9-segment tile reuse via rotation rather than per-orientation
  sprites

New API:
- maps.load_textures(asset_aliases) resolves the current tilemap's
  tile atlas-ids to texture-handles via the asset-lib indirection
  (asset_aliases[tilemap.asset_pack] -> lib-id -> atlas.json lookup
  per tile)

Schema additions:
- tilemap.asset_pack (alias-key, optional)
- tile.texture (atlas-id, optional)
- map.tile_rotations (parallel array, optional)

All existing Phase 1 color-only tilemaps render unchanged.
2026-05-18 03:21:52 +02:00
Axel Meyer
a8606ff621 docs: migrate README to API-Doc-Convention (S2-cascade.libs)
Restructured per ADR-0038: Abstract + bold-list Badges + Topology H2
+ H3-API-Subsections (one per public function) + Conventions/Consumer
pattern/CHANGELOG/References.

Topology auto-populated via Sporel.exe --lint --fix. Pre-commit hook
installed via --install-hooks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 16:39:42 +02:00
Axel Meyer
94c2197d46 feat: P.0.lib.maps single-tile-grid implementation (replaces trivial-stub) 2026-05-09 18:13:59 +02:00
Axel Meyer
5cf3d0c2fb feat: P.0.module.skeleton trivial-stub for lib-core.maps 2026-05-09 15:42:39 +02:00