Add atlas-spec loader with duplicate handling
loadAtlasDirs walks one level deep into each --atlas-dir, picks up */tiles.atlas.json, and builds bidirectional name/id maps. On duplicate atlas_id across paths the first registration wins and a warning string is returned (callers decide whether to print).
This commit is contained in:
9
tests/fixtures/atlases-dup/atlas_a/tiles.atlas.json
vendored
Normal file
9
tests/fixtures/atlases-dup/atlas_a/tiles.atlas.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"atlas_id": "atlas_a",
|
||||
"atlas_version": 1,
|
||||
"atlas_size_px": [32, 32],
|
||||
"tile_size_px": 32,
|
||||
"tiles": [
|
||||
{ "id": 1, "name": "ALT_grass", "uv": [0, 0, 32, 32] }
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user