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

@ -815,6 +815,8 @@ void printUsage(const char* argv0) {
std::printf(" Print WOW weather entries (zone + per-state type / intensity / weight / duration) and exit\n");
std::printf(" --validate-wow <wow-base> [--json]\n");
std::printf(" Walk every WOW entry; check typeId / intensity bounds [0,1] / weight > 0 / duration min ≤ max\n");
std::printf(" --validate-wom <wom-base> [--json]\n");
std::printf(" Static sanity checks on .wom: index range, bone refs, bound box, batch coverage, animation track count\n");
std::printf(" --gen-weather-temperate <wow-base> [zoneName]\n");
std::printf(" Emit .wow weather schedule: clear-dominant + occasional rain + fog (forest / grassland)\n");
std::printf(" --gen-weather-arctic <wow-base> [zoneName]\n");