The pattern
bool jsonOut = (i + 1 < argc &&
std::strcmp(argv[i + 1], "--json") == 0);
if (jsonOut) i++;
is repeated ~50 times across the editor — every --info-*
and --validate-* handler writes the same three lines to
detect and consume an optional --json follower. Extract
to consumeJsonFlag(int& i, int argc, char** argv) in
cli_arg_parse.hpp (the same header that already hosts
parseOptInt / parseOptFloat / parseOptUint / parseOptArg
for similar repeated patterns).
Adopted in the recently-added files:
• cli_world_map.cpp — both --info-womx and --validate-womx
• cli_sound_catalog.cpp — both --info-wsnd and --validate-wsnd
• cli_wom_info.cpp — all 7 --info-* / --validate-wom
handlers (replace_all)
Also adopted the shared stripExt() helper from
cli_box_emitter.hpp instead of the new files' rolled-
own stripWomxExt / stripWsndExt — same observable behavior,
no more local copies of the extension-strip logic.
Future --info-/-validate handlers added to other formats
(WSP, WTC, etc.) get the same one-line jsonOut detection
without reinventing the peek-and-advance dance. Any later
adoption of consumeJsonFlag in the older 50+ sites is now
a mechanical replace_all edit per file.
Behavior preserved: --validate-wom and --info-womx and
--info-wsnd round-trip exactly as before, both text and
--json output unchanged.
Mirrors the WOL/WOW JSON pair from earlier batches: gives
hand-editable access to .womx world-map manifests for
quick tile-bitmap edits without writing a binary patcher.
Tile bitmap is represented as a JSON array of '1'/'0' row
strings — one string per row of the grid. Visual layout
makes missing-row patterns obvious at a glance:
"tiles": [
"10000001",
"01000010",
"00100100",
"00011000",
...
]
Sparse [[x,y]] pair arrays were considered but rejected:
4× larger for a full continent (4096 tiles), and the dense
visual layout is far easier to spot-read for typical
edits like "carve out a hole in this region".
The importer tolerates missing optional fields (uses
WoweeWorldMap defaults), and accepts either worldType
int or worldTypeName string so JSON can be authored by
hand or by tools.
Verified byte-identical round-trip on a 4x4 instance and
a hand-authored 8x8 sparse continent (16/64 tiles, both
defaultLightId and defaultWeatherId preserved through the
JSON layer).
Adds 2 flags to reach 458 documented kArgRequired entries.
All 9 open formats now have established CLI tooling — WOM,
WOB, WOC, WOT, JsonDBC, PNG, WOL, WOW, and WOMX.
Novel open replacement for Blizzard's WDT (top-level world
definition table). The 9th open format added to the editor.
A WOMX file holds the manifest of which terrain tiles exist
within a world plus a tiny bit of map-level metadata. The
runtime consults it before attempting to load any individual
tile (so missing tiles produce a clean "no data" result
instead of a file-not-found error).
Format:
• magic "WMPX", version 1, little-endian
• mapName + worldType (continent/instance/battleground/arena)
• gridSize 1..128 (typically 64 for continents)
• defaultLightId / defaultWeatherId (atmosphere preset
refs, 0 if none — wires into the WOL/WOW pair)
• packed bitmap, 1 bit per tile, row-major
• A 64x64 manifest is exactly 512 bytes of bitmap
API: WoweeWorldMapLoader::save / load / exists; presets
makeContinent (64x64 full), makeInstance (4x4 full),
makeArena (1x1 full).
CLI added (5 flags, 456 total now):
--gen-world-map <base> [name] (continent)
--gen-world-map-instance <base> [name] (4x4)
--gen-world-map-arena <base> [name] (1x1)
--info-womx <base> [--json]
--validate-womx <base> [--json]
Round-trip verified: continent + instance + arena presets
all save / load / re-validate to byte-identical state with
correct tile counts.