feat(editor): add --validate-wom static sanity checker

Adds a validator for .wom files mirroring --validate-wol /
--validate-wow. Catches malformed hand-built or import-
corrupted models before they reach the renderer (where bad
data usually crashes or renders blank with no diagnostic).

Hard errors (exit non-zero):
  • version not in 1..3
  • empty vertex / index list
  • index count not a multiple of 3
  • triangle indices referencing out-of-range vertices
  • boneIndices referencing out-of-range bones
  • parentBone referencing out-of-range bones
  • inverted AABB (boundMin > boundMax on any axis)
  • WOM3 batch.textureIndex out of range
  • WOM3 batch range past end of index buffer
  • animation has wrong number of bone tracks

Warnings (informational, exit zero):
  • boneWeight slots not summing to 0 or 255
  • triangles uncovered or double-covered by WOM3 batches
  • boundRadius <= 0 (frustum-cull failure)

Adds 451st kArgRequired entry. Smoke test: 0/0/0 errors on
all generated procedural primitives. Both text and --json
output supported, mirroring the other validators.
This commit is contained in:
Kelsi 2026-05-09 14:34:22 -07:00
parent b907b69fa7
commit 6c3f5cb33f
3 changed files with 192 additions and 0 deletions

View file

@ -20,6 +20,7 @@ const char* const kArgRequired[] = {
"--export-wol-json", "--import-wol-json",
"--export-wow-json", "--import-wow-json",
"--info-wow", "--validate-wow",
"--validate-wom",
"--gen-weather-temperate", "--gen-weather-arctic",
"--gen-weather-desert", "--gen-weather-stormy",
"--gen-zone-atmosphere",