refactor(editor): extract WOB/WHM/WOC IO into cli_world_io.cpp

Moves all six world-asset interchange handlers (--export-wob-glb,
--export-wob-obj, --import-wob-obj, --export-whm-glb,
--export-whm-obj, --export-woc-obj) out of main.cpp into a new
cli_world_io.{hpp,cpp} module. WOB / WHM / WOC are our open
replacements for proprietary WMO / ADT-heightmap / ADT-collision
data; these are the bridge that lets the open formats round-trip
through Blender, MeshLab, Three.js, and the rest of the standard
3D toolchain.

main.cpp shrinks by 858 lines (8,997 to 8,140). The single-mesh
--import-obj handler stays inline for now -- it shadow-mirrors
cli_wom_io's --import-stl semantics and will move there next.
This commit is contained in:
Kelsi 2026-05-09 07:03:14 -07:00
parent 61bc9dfb15
commit e128d91d66
4 changed files with 958 additions and 862 deletions

View file

@ -0,0 +1,24 @@
#pragma once
namespace wowee {
namespace editor {
namespace cli {
// Dispatch the world-asset interchange handlers. WOB / WHM / WOC
// are our open replacements for proprietary WMO / ADT-heightmap /
// ADT-collision data; these handlers bridge them to the formats
// every other 3D tool understands so the open-format ecosystem
// is actually usable.
// --export-wob-glb WOB -> glTF 2.0 binary
// --export-wob-obj WOB -> Wavefront OBJ (per-group)
// --import-wob-obj Wavefront OBJ -> WOB (preserves doodads)
// --export-whm-glb WHM/WOT terrain -> glTF 2.0 (per-chunk)
// --export-whm-obj WHM/WOT terrain -> Wavefront OBJ
// --export-woc-obj WOC collision -> OBJ (grouped by walkability)
//
// Returns true if matched; outRc holds the exit code.
bool handleWorldIo(int& i, int argc, char** argv, int& outRc);
} // namespace cli
} // namespace editor
} // namespace wowee