refactor(editor): extract mesh ⇄ heightmap I/O into cli_mesh_io.cpp

Moves the three mesh-PNG bridge handlers (--displace-mesh,
--gen-mesh-from-heightmap, --export-mesh-heightmap) out of
main.cpp into their own translation unit. These three are
distinct from the gen-mesh-* primitive generators in that
they read or write external image files rather than synthesize
geometry from parameters alone.

main.cpp drops 21,061 → 20,741 lines (-320). Behavior verified
by re-running gen-mesh-from-heightmap → validate-wom → and
displace-mesh on a fresh plane.
This commit is contained in:
Kelsi 2026-05-09 00:04:27 -07:00
parent 326f7bcdaa
commit 3d5a786ca9
4 changed files with 397 additions and 324 deletions

View file

@ -0,0 +1,17 @@
#pragma once
namespace wowee {
namespace editor {
namespace cli {
// Dispatch the mesh ⇄ heightmap I/O ops:
// --displace-mesh (perturb verts along normal by PNG)
// --gen-mesh-from-heightmap (generate WOM grid from PNG heightmap)
// --export-mesh-heightmap (sample WOM Y to PNG heightmap)
//
// Returns true if matched; outRc holds the exit code.
bool handleMeshIO(int& i, int argc, char** argv, int& outRc);
} // namespace cli
} // namespace editor
} // namespace wowee