Add map inspector that emits a human-readable stats report
Counts set vs empty cells per layer, lists the top-10 most frequent non-empty GIDs with decoded components, and reports roof coverage. When an atlas registry is supplied, atlas-id+tile-name annotations are added; without one the report still works using indices only.
This commit is contained in:
10
tests/fixtures/atlases-inspector/atlas_a/tiles.atlas.json
vendored
Normal file
10
tests/fixtures/atlases-inspector/atlas_a/tiles.atlas.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"atlas_id": "atlas_a",
|
||||
"atlas_version": 1,
|
||||
"atlas_size_px": [64, 64],
|
||||
"tile_size_px": 32,
|
||||
"tiles": [
|
||||
{ "id": 1, "name": "grass", "uv": [0, 0, 32, 32], "walkable": true },
|
||||
{ "id": 2, "name": "stone", "uv": [32, 0, 32, 32], "walkable": false, "blocks_sight": true }
|
||||
]
|
||||
}
|
||||
30
tests/fixtures/maps/inspect_sample.map.json
vendored
Normal file
30
tests/fixtures/maps/inspect_sample.map.json
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"schema_version": 2,
|
||||
"id": "inspect_sample",
|
||||
"size": { "w": 4, "h": 4 },
|
||||
"atlases": ["atlas_a", "atlas_b"],
|
||||
"layers": {
|
||||
"surface": {
|
||||
"tiles": [
|
||||
16, 16, 16, 16,
|
||||
16, 32, 32, 16,
|
||||
16, 32, 32, 16,
|
||||
16, 16, 16, 16
|
||||
]
|
||||
},
|
||||
"wall": {
|
||||
"tiles": [
|
||||
16777232, 16777232, 16777232, 16777232,
|
||||
16777232, 0, 0, 16777232,
|
||||
16777232, 0, 0, 16777232,
|
||||
16777232, 16777232, 16777232, 16777232
|
||||
]
|
||||
}
|
||||
},
|
||||
"roof": [
|
||||
0, 0, 0, 0,
|
||||
0, 1, 1, 0,
|
||||
0, 1, 1, 0,
|
||||
0, 0, 0, 0
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user