Moves the WOM model inspection commands out of main.cpp:
--info (bare WOM summary)
--info-batches (per-batch material info)
--info-textures (texture path list)
--info-doodads (WOB doodad set / instance list)
--info-attachments ⎫ combined handler with same M2 load +
--info-particles ⎬ skin merge but different sub-array
--info-sequences ⎭ iteration
--info-bones (bone hierarchy)
--export-bones-dot (Graphviz DOT output)
main.cpp drops 20,005 → 19,446 lines (-559). Behavior verified
by running --info, --info-batches, --info-textures on a fresh
WOM. Build error during extraction (combined-or handler header
spanned 4 lines, the transform script only stripped the first;
also missing #include for WoweeBuildingLoader) caught by build
and fixed before commit.
Composite cart: rectangular bed box + 2 axis-along-Z cylindrical
wheels mounted on each side at the bottom of the bed. Each wheel
has 16 angular segments + front/back caps. Bed sits at y=wheelR
so the wheels touch the ground at y=0.
Defaults: 1.6×0.8×0.5 bed, wheelR=0.35. Useful for medieval
village clutter, market scenes, NPC vendor decoration. Brings
the procedural mesh primitive set to 30.
Moves the WOM mesh editing/transform handlers out of main.cpp:
--add-texture-to-mesh --scale-mesh
--translate-mesh --strip-mesh
--rotate-mesh --center-mesh
--flip-mesh-normals --mirror-mesh
--smooth-mesh-normals --merge-meshes
These are the post-generation manipulators (load → mutate → save)
distinct from the geometry generators in cli_gen_mesh.cpp and
the heightmap I/O in cli_mesh_io.cpp.
main.cpp drops 20,741 → 20,005 lines (-736). Behavior verified
by piping a fresh cube through scale → translate → center.
Multi-octave cosine-product noise (4 octaves at doubling
frequency, halving amplitude) thresholded by `coverage` so
values above the threshold blend toward cloud color and below
fade to sky. A 0.15-wide smoothstep band feathers cloud edges
instead of stepping hard.
Defaults: coverage=0.5 (mixed clouds), seed=1. Useful for
skybox cubemaps, distant sky planes, atmospheric backdrop
art. Brings the procedural texture pattern set to 25.
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.
Composite mushroom: 12-segment cylindrical stalk + 16×8
hemisphere cap on top (top half of a UV sphere). Cap radius
is independent of stalk radius so the silhouette can match
anything from a slim toadstool to a wide morel. Stalk has a
bottom cap and the hemisphere's lower edge is sealed against
a flat -Y disc (the "gills") so the mesh is watertight from
all viewing angles.
Defaults: stalkR=0.1, stalkH=0.6, capR=0.4. Useful for
forest decoration, swamp zones, fairy-ring set dressing.
Brings the procedural mesh primitive set to 29.
Moves the bare --gen-mesh dispatcher (cube/plane/sphere/cylinder/
torus/cone/ramp internal switch — 391 lines) and the related
--gen-mesh-textured handler (~72 lines) into the existing
cli_gen_mesh.cpp module.
The bare --gen-mesh handler renamed to handleMeshDispatch since
'handleMesh' would shadow the dispatcher class. --gen-mesh-textured
matched first in the dispatch chain to keep the longer-name
convention consistent with --gen-texture-noise vs -noise-color.
main.cpp drops 21,526 → 21,061 lines (-465). Behavior verified
by re-running --gen-mesh cube/sphere/torus.
Vertical streaks of varying brightness (per-column hash gives
each streak a stable shade in 0.85..1.10) sway-warped per-row
via a slow cosine offset, plus dark vertical cracks at random
columns where bark splits as the trunk expands.
Defaults: density=0.04 (~4% of columns become cracks), seed=1.
Useful for tree-trunk textures, wooden palisades, bark-clad
buildings. Brings the procedural texture pattern set to 24.
Moves stairs, grid, disc, tube, capsule, arch, pyramid, fence,
and tree into the existing cli_gen_mesh.cpp module. Together
with the 12 composite props extracted in 00754941 and the
anvil added in cd4bdfec, the module now contains 22 of the
28 procedural mesh primitives.
Remaining mesh handlers in main.cpp: --gen-mesh dispatcher
(cube/plane/sphere/cylinder/torus/cone/ramp), --gen-mesh-from-
heightmap, --gen-mesh-textured. Those have specialized I/O or
embedded sub-dispatch and will move in a follow-up batch.
main.cpp drops 22,681 → 21,526 lines (-1,155). Behavior
verified by re-running stairs/disc/fence/tree.
Composite anvil silhouette: 4-step pedestal (wide base → narrow
waist → wide cap → flat work face), each step a single addBox
call, plus a 4-vertex tapered prism for the horn extending in
+X past the face. The prism's 4 side triangles converge to a
single tip vertex (the horn point), with a sealed base square
behind it.
Defaults: length=1.0, width=0.4, hornLen=0.5, bodyH=0.5. Useful
for blacksmith shops, dwarven forges, weapon-crafting set
dressing. Brings the procedural mesh primitive set to 28.
Added directly to cli_gen_mesh.cpp — proves the modular file
accepts new primitives the same way as extracted ones.
Moves the recently-added composite-prop mesh handlers (rock,
pillar, bridge, tower, house, fountain, statue, altar, portal,
archway, barrel, chest) into their own translation unit. These
12 handlers were the most contiguous block of similar-shaped
mesh code in main.cpp.
Other mesh handlers (--gen-mesh dispatcher, fence, tree, grid,
stairs, disc, tube, capsule, arch, pyramid, from-heightmap,
textured) still live in main.cpp and may be migrated in
subsequent batches.
main.cpp drops 24,270 → 22,681 lines (-1,589). Behavior
verified by re-running rock/chest/archway/fountain.
Per-cell pattern: each pixel falls into a tile cell with grout
on every grid edge. Tiles get a stable per-tile shade jitter
(via integer-cell hash) so adjacent tiles look distinct rather
than identical. Grout is the constant separator color.
First new texture added directly to cli_gen_texture.cpp instead
of main.cpp — proves the modular pattern works for new
additions, not just extractions.
Defaults: tilePx=32, groutPx=2. Useful for floors, plaza
paving, dungeon walls. Brings the procedural texture pattern
set to 23.
Completes the texture-family extraction started in 6ea2dfcf.
Moves the 11 older simpler texture handlers (gradient, noise,
noise-color, radial, stripes, dots, rings, checker, brick, wood,
grass, fabric) into the existing cli_gen_texture.cpp module.
Each previously had its own ~30-line copy of parseHex; all now
use the shared helper at file scope.
Also fixed a pre-existing match-order issue: the dispatcher
checks --gen-texture-noise-color before --gen-texture-noise so
the prefix-match doesn't shadow the longer name.
main.cpp drops 25,494 → 24,270 lines (-1,224). All 19 texture
generators (12 just-extracted + 7 from the previous batch) now
live in their own translation unit. Behavior verified by
re-running gradient/noise/noise-color/checker/fabric.
Composite procedural chest: rectangular body box + slightly
inset lid box on top + 3 thin iron bands wrapping around the
body (15% / 50% / 85% along width) + a small lock plate on
the front face. 6 boxes assembled into one batch.
Defaults: 1.4 × 0.9 × 0.9 body with 0.25-tall lid. Useful
for dungeon loot, room decoration, quest objectives. Brings
the procedural mesh primitive set to 27.
Moves the Worley/cellular-noise-based texture handlers
(--gen-texture-cobble, -marble, -metal, -leather, -sand,
-snow, -lava) into their own translation unit. Each handler
previously had its own ~33-line copy of the parseHex lambda;
all 7 copies are replaced with a single shared parseHex
helper at file scope.
Older simpler generators (gradient/noise/radial/stripes/dots/
rings/checker/brick/wood/grass/fabric) still live in main.cpp
and will be migrated in subsequent batches.
main.cpp drops 26,286 → 25,494 lines (-792). Behavior
unchanged across all 7 handlers (re-verified).
Worley cellular noise where each cell is a chunk of cooled
crust and the inter-cell boundaries glow as bright cracks of
exposed magma. Each pixel finds its 2 nearest jittered cell
centers; pixels close to the boundary (small gap between
distances) become hot, with a soft penumbra falling off into
the dark crust interior.
Defaults: crackScale=32px, seed=1. Useful for volcanic zones,
elemental dungeons, lava lakes. Brings the procedural texture
pattern set to 22.
Pulls the 597-line block of printf calls that emits the --help
text out of main.cpp into its own translation unit. printUsage
is the longest single function in main.cpp by far and was pure
boilerplate (no logic, just a flat list of help lines).
Function moved verbatim to wowee::editor::cli::printUsage; all
6 in-tree callers (--list-commands, --info-cli-stats,
--info-cli-categories, --info-cli-help, --validate-cli-help,
and the bare --help/-h handler) updated to the namespaced name.
The CLI-meta commands continue to capture printUsage's stdout
the same way, so behavior is identical (verified by re-running
--validate-cli-help, --info-cli-stats, --list-commands).
main.cpp drops 26,650 → 26,286 lines (-364 net; -597 from the
removal, +233 from the include and namespace-prefixing the
six call sites... wait, no, +6). Actually main.cpp net delta
matches the body extraction.
Cylindrical body with a smooth cosine-bulge radius profile
(topR at the rims, midR at the middle — the classic stave-
cooper barrel silhouette), plus 2 raised hoop bands at 25%
and 75% of the height for the iron straps that hold staves
together.
Defaults: rim=0.4, bulge=0.5, height=1, hoop=0.06. Useful
for tavern decoration, cargo, treasure containers, dungeon
clutter. Brings the procedural mesh primitive set to 26.
Mirrors the --list-project-meshes-detail rename from 976549fe.
After the c0f2ab75 inventory extraction, the older per-mesh
sorted-by-tris listing was shadowed by the per-zone aggregate
that now lives in cli_zone_inventory.cpp.
Renames the older handler to --list-zone-meshes-detail (and
updates its help text + kArgRequired entry) so both views
coexist:
--list-zone-meshes — per-zone aggregate (extracted)
--list-zone-meshes-detail — sorted-by-tris listing
Removes the last duplicate-flag dead code from main.cpp.
Cool-white base with low-frequency cosine luminance variation
(soft uneven powdery look) plus per-pixel jitter, then a
sparkle pass scatters bright single-pixel highlights at the
configured density (the "ice crystals catching light" effect).
Defaults: density=0.005 (~0.5% of pixels sparkle), seed=1.
Useful for winter zones, snowy mountains, ice caves, frozen
wastes. Brings the procedural texture pattern set to 21.
Pairs with the per-zone inventory module from c0f2ab75. Moves
the five project-wide inventory handlers into their own file:
--list-project-meshes (per-zone WOM aggregate)
--list-project-meshes-detail (per-mesh sorted listing)
--list-project-audio (per-zone WAV aggregate)
--list-project-textures (per-zone + global texture refs)
--info-project-summary (BOOTSTRAPPED/PARTIAL/EMPTY rollup)
All five enumerate zones the same way; consolidated that into
a shared enumerateZones() helper at file scope.
main.cpp drops 27,200 → 26,650 lines (-550). Behavior unchanged
across all 5 commands (verified against /tmp/proj_starter).
Continues the modularization. Moves the four per-zone inventory
handlers into their own file:
--list-zone-meshes (WOM stats)
--list-zone-audio (WAV header parse)
--list-zone-textures (texture-ref histogram)
--info-zone-summary (BOOTSTRAPPED/PARTIAL/EMPTY status)
Each consumes a trailing --json flag the same way; consolidated
that check into a consumeJsonFlag helper at the top.
main.cpp drops 27,445 → 27,200 lines (-245). Per-zone inventory
behavior unchanged (re-verified all 4 commands).
A pre-existing duplicate --list-zone-meshes handler (the older
detailed per-mesh listing, similar to the --list-project-meshes
collision fixed in 976549fe) is now dead code in the in-line
chain since the extracted module dispatches first. Will rename
or remove that duplicate in a follow-up cleanup.
Per-pixel salt-and-pepper grain jitter (the individual sand
grains) overlaid with wide sinusoidal ripple bands aligned
along an offset that drifts smoothly across rows (the wind-
formed dune ridges). Result reads as windswept beach or
desert.
Defaults: rippleSpacing=24px, seed=1. Useful for desert
zones, beaches, oases, dungeon floors. Brings the procedural
texture pattern set to 20.
Continues the modularization. Moves --gen-zone-readme and
--gen-project-readme into their own translation unit using the
established handle<Family> dispatch pattern. Consolidated the
trailing --out flag parser into a single parseOutFlag helper
(was duplicated between the two handlers).
main.cpp drops 27,736 → 27,445 lines (-291). Behavior unchanged
(verified by re-generating README and PROJECT.md, contents
identical to pre-refactor output).
Continues the modularization. Moves the four audit handlers
(--validate-zone-pack, --validate-project-packs, --info-zone-deps,
--info-project-deps) into their own file using the same
handle<Family>(int& i, int argc, char** argv, int& outRc) pattern.
Side-cleanup: the two project-scope audits had identical
subprocess-fanout structure (enumerate zones → run per-zone
command → tally PASS/FAIL → print summary). Consolidated that
into a shared runPerZoneAudit helper. Saves ~80 lines of
duplicated dispatch code.
main.cpp drops 28,070 → 27,736 lines (-334). Audit family is
fully self-contained (~330 lines), behavior unchanged
(verified all 4 commands against existing test zones).
Continues the modularization started in 6c9ab6fa. Moves the four
pack-orchestrator handlers (--gen-zone-texture-pack, -mesh-pack,
-starter-pack, --gen-project-starter-pack) into their own file
following the same handle<Family> pattern.
Side cleanup:
- Consolidated the duplicated --seed flag parser into a single
parseSeedFlag helper
- Consolidated the std::system + > /dev/null wrap into runSilently
main.cpp drops 28,329 → 28,070 lines (-259). Pack family is fully
self-contained (~260 lines), behavior unchanged (verified by
re-running gen-zone-starter-pack and confirming 6 PNGs + 5 WOMs).
main.cpp had grown past 28k lines, with each new procedural-
generation command adding 100-200 lines to the inline if/else
dispatch chain. This commit starts breaking that up by moving
the four audio-related handlers (--gen-audio-tone, -noise,
-sweep, --gen-zone-audio-pack) into their own translation unit.
Pattern established here for future family extractions:
- Family lives in cli_<family>.{hpp,cpp}
- Single dispatch entry point: bool handle<Family>(int& i, int argc,
char** argv, int& outRc) — true if matched (writes outRc), false
to fall through.
- main.cpp's argv loop calls each family's dispatcher first and
returns its outRc on match, before the legacy in-line chain.
Side-benefit: consolidated the duplicated 25-line WAV header
writer + 5ms attack/release envelope into shared helpers
(writeWavMono16, applyEdgeEnvelope) at the top of the new file.
main.cpp drops from 28,943 → 28,329 lines (-614). Audio family
is fully self-contained (~440 lines), behavior unchanged
(verified by re-running tone/noise/sweep + zone-audio-pack).
Two cylindrical pillars hold up a curved keystone vault: the
vault is a series of N angular wedge segments tracing a half-
circle from pillar-top to pillar-top. Each wedge has inner +
outer radial faces and front/back side caps.
Defaults: 3w × 3h pillars, thickness=0.4, 12 arch segments.
The fancier sibling of --gen-mesh-portal (flat lintel) — the
archway gives a temple/cathedral aesthetic. Brings the
procedural mesh primitive set to 25.
Project-wide companion to --info-zone-deps. Fans out the
per-zone broken-reference audit across every zone via
subprocess (defers to the canonical resolution logic so
behavior stays consistent) and reports per-zone PASS/FAIL
plus a project rollup. Exits non-zero if any zone has a
broken texture reference — designed as a CI gate.
Procedural doorway: two vertical post boxes plus a horizontal
lintel box across the top. Posts run along the Z axis (so
width spans Z), the opening faces +X. Pass lintelHeight=0
to skip the lintel for two free-standing posts.
Defaults: 2.5w × 4h, post thickness 0.4, lintel 0.5. Useful
for entrances, gates, magical portals, ruins, walls. Brings
the procedural mesh primitive set to 24.
Walks every WOM in a zone, collects texture references from
each model's texturePaths, and checks whether each path
resolves to a real file. Tries 4 candidate paths per ref
(as-is, relative to zone, in textures/, alongside the WOM)
before flagging as missing.
Catches "WOM was added but its texture wasn't copied into
textures/" mistakes before runtime. Exits 1 if any reference
is unresolved — suitable for CI.
Cellular Worley noise at small grain scale: each "pebble" cell
darkens at its boundary with neighbors (the irregular bump
shading characteristic of fine-grain leather), with per-cell
tint variation so the surface doesn't read as uniform.
Defaults: grainSize=4px, seed=1. Useful for armor, saddles,
chairs, book bindings, scabbards. Brings the procedural
texture pattern set to 19.
Procedural altar: stack of N stepped cylindrical discs, each
one wider and shorter than the next so the silhouette descends
like a wedding cake. The top disc is the altar surface; base
discs widen out to anchor the structure visually.
Skips the bottom cap on every disc except the lowest (saves
~24 tris per disc since each is hidden by the next one below).
Defaults: topR=0.7, topH=0.3, 3 steps, stride=0.3. Pairs
naturally with --gen-texture-marble for a temple aesthetic.
Brings the procedural mesh primitive set to 23.
Per-pixel white noise heavily blurred along one axis (long
brush strokes) and lightly along the other (thin variation
across strokes), then contrast-stretched and applied as a
multiplicative tint on the base color. Result: long thin
streaks of varying brightness — the visual signature of
brushed steel/aluminum/iron.
Defaults: horizontal orientation, seed=1. Useful for armor,
weapons, machinery, sci-fi panels. Brings the procedural
texture pattern set to 18.
Project-level companion to --gen-zone-readme. Writes PROJECT.md
with a per-zone status table (BOOTSTRAPPED/PARTIAL/EMPTY plus
biome and per-category counts) and a project-level rollup
(total zones, assets, bytes). Pairs naturally with the per-zone
README — running both gives self-documenting content at every
level.
Procedural statue silhouette: square pedestal block + tall
narrow body cylinder + UV-sphere head. Reads as a statue
without needing limb geometry. The head sphere is 16×12 lat/lon
so silhouette stays smooth at distance.
Defaults: pedestal=1.0, bodyH=2.5, headR=0.4. Useful for
monuments, hero statues, plaza centerpieces, religious
shrines. Brings the procedural mesh primitive set to 22.
Writes README.md to a zone (or to --out path) with a Markdown
asset table covering textures (PNG bytes), meshes (verts/tris/
bones/batches/bytes), and audio (sample rate + duration). Reads
zone.json for the friendly map name and biome.
Saves the manual README maintenance every time content changes.
Marble pattern via warped sinusoidal veining (the canonical
"marble shader"): take a sine wave, warp its input by smooth
multi-octave noise, raise |sin| to a high power so the bright
vein bands stay narrow. Result: irregular bright veins on a
base color with low-freq variation across the texture.
Defaults: sharpness=8, seed=1. Useful for floors, statues,
cathedral walls, ornate furniture. Brings the procedural
texture pattern set to 17.
Project-wide companion to --info-zone-summary. Walks every
zone in <projectDir>, classifies each as BOOTSTRAPPED (textures
+ meshes + audio all non-empty), PARTIAL (some categories), or
EMPTY (none), and shows per-category counts in a status table
with a project total at the bottom.
Quick "what shape is the whole project in" view that pairs
naturally with --validate-project-packs (which actually loads
and verifies every asset).
Procedural fountain: low cylindrical basin with a narrower
spout column rising from its center. Solid (not hollow) for
simplicity but still reads as a fountain because of the spout
silhouette. Cylinder helper builds side ring + top/bottom
caps so basin and spout share the same construction.
Defaults: basin r=1.5 h=0.5, spout r=0.2 h=1.5. Useful for
town squares, plazas, garden centerpieces. Brings the
procedural mesh primitive set to 21.
Compact per-zone status command. Reads zone.json for the
friendly map name, scans textures/, meshes/, audio/ for asset
counts and total bytes per category, and assigns a status:
BOOTSTRAPPED (all 3), PARTIAL (some), or EMPTY (none).
Lighter-weight than --validate-zone-pack (which loads + sanity-
checks every WOM/PNG/WAV) — useful for quick "what shape is
this zone in" checks during interactive editing.
Worley-style cellular pattern: each pixel finds its nearest
"stone center" in a perturbed grid (3x3 neighborhood search).
Pixels with a small gap between closest and second-closest
center become mortar boundaries; everything else is the stone
face with per-stone tint variation and radial darkening for a
3D rounded-stone look.
Defaults: stone=24px, seed=1. Useful for streets, plazas, town
squares. Brings the procedural texture pattern set to 16.
Batch 34's --list-project-meshes (per-zone aggregate) introduced
a flag collision with a pre-existing per-mesh sorted listing
that's been in the codebase. The dispatch chain ran the new
handler first, leaving the older detail view as dead code.
Resolves the duplicate by renaming the older handler to
--list-project-meshes-detail. Both views are now reachable:
the per-zone aggregate stays under the simpler name (covers
the common "how heavy is each zone" case), and the per-mesh
sorted-by-tris detail listing is back as -detail (used for
project-wide outlier detection and mesh-sharing audits).
Procedural house: 4 outward-facing wall quads + a floor slab,
topped by a 4-triangle pyramid roof meeting at a central apex.
Eaves line up with the wall edges so the roof sits flush. Pass
roofHeight=0 for a flat-roof shed.
Defaults: 4×4×3 with 2m roof. Useful for villages, settlements,
quest hubs. Brings the procedural mesh primitive set to 20.
Project-wide bootstrap orchestrator. For every zone in
<projectDir>, runs --gen-zone-starter-pack (textures + meshes)
and --gen-zone-audio-pack (audio). Each zone gets a unique
sub-seed offset from the base seed so per-zone content reads
as distinct (rocks differ, wood grain differs).
Pairs with --validate-project-packs as the inverse: bootstrap
the entire project in one call, audit, ship.
Sine wave whose frequency glides from startHz to endHz across
the duration. Two shape modes:
linear: f(t) = f0 + (f1-f0)*t/T (integrated phase = quadratic)
exp: f(t) = f0 * (f1/f0)^(t/T) (logarithmic glide)
Same RIFF/PCM-16 mono envelope as gen-audio-tone with 5ms
attack/release. Useful for sci-fi door whoosh, alert ramps,
sliding pitch cues, and as a standard signal-engineering test
signal — all hand-synthesized open-format WAV.
Project-wide companion to --list-zone-audio. Walks every
zone in <projectDir> and reports per-zone WAV count + bytes
+ total duration, plus a project grand total. Reuses the
RIFF/WAVE header parse from list-zone-audio.
Completes the project-scope inventory trio alongside
--list-project-meshes and --list-project-textures.
Procedural round castle tower: solid cylindrical shaft with
crenellated battlements ringing the top — alternating raised
merlons and gaps. Each merlon is an extruded arc segment
sitting on the rim. Pass battlementH=0 for a smooth-topped
tower.
Defaults: radius=1.5, height=8, battlements=8, battlementH=0.5.
Useful for keeps, watchtowers, perimeter walls. Brings the
procedural mesh primitive set to 19.
Fans out --validate-zone-pack across every zone in a project
and reports a single PASS/FAIL per zone plus a summary line.
Exits non-zero if any zone fails — designed as a CI gate
before shipping a project's content pack.
Pairs with the existing zone-pack orchestrator family for
end-to-end "bootstrap → audit at project scale" coverage.
Procedural fabric: alternating warp (vertical) and weft
(horizontal) threads on a checkerboard cell grid, with each
thread shaded brighter at center and darker at edges so the
weave reads as 3D yarn rather than flat checker squares.
Defaults: thread=4px, W=H=256. Useful for banners, tapestries,
clothing, sails. Brings the procedural texture pattern set to 15.