Commit graph

887 commits

Author SHA1 Message Date
Kelsi
a4d282b588 refactor(editor): extract 9 export handlers + sha256 helper into cli_export.cpp
Moves the report-export handlers (md / csv / html / sha256 /
graphviz) for zone & project audits out of main.cpp:
  --export-zone-summary-md       --export-zone-csv
  --export-zone-checksum         --export-project-checksum
  --validate-project-checksum    --export-zone-html
  --export-project-html          --export-project-md
  --export-quest-graph

Also moves the file-scope wowee_sha256 namespace (the SHA-256
implementation that the checksum exporters use) into the new
module's anonymous namespace — it had no other callers in
main.cpp so no cross-TU coupling needed.

main.cpp drops 13,120 → 12,119 lines (-1,001). Build error
during extraction (missing #include <unordered_set>) caught
and fixed.
2026-05-09 05:45:00 -07:00
Kelsi
e95dd7692b feat(editor): add --gen-texture-flame fire pattern
Vertical color gradient from dark (bottom) to hot (top), mixed
with multi-octave smooth noise so the flame boundary wavers
randomly rather than reading as a clean horizontal line.
Vertical position curve is squared so the dark stays dark
longer and the hot saturates faster — matches real-flame
appearance where most of the body is dark with a bright tip.

Useful for torches, braziers, magical effects, lava-zone set
dressing, fireplace texture details. Brings the procedural
texture pattern set to 32.
2026-05-09 05:38:18 -07:00
Kelsi
c9831b38ff refactor(editor): extract data-tree inspection into cli_extract_info.cpp
Moves the four extracted-Data-tree audit handlers out of main:
  --info-extract           (per-extension counts + bytes)
  --info-extract-tree      (per-directory rollup)
  --info-extract-budget    (proprietary share + open-format gap)
  --list-missing-sidecars  (find unconverted .m2/.wmo/.blp/.dbc)

All four operate on a Blizzard-format extracted Data tree —
they audit what's there and what's missing in the migration
from proprietary formats to open ones.

main.cpp drops 13,485 → 13,120 lines (-365). Behavior verified
by re-running --info-extract on a test zone (same output).
2026-05-09 05:32:27 -07:00
Kelsi
9973da07ab feat(editor): add --gen-mesh-cage prison-cell primitive
Square cage frame: top + bottom thin slabs + 4 corner posts
(thicker than bars) + N evenly-spaced bars per side. Bars on
each side span perpendicular to that side's plane so the
cage reads as enclosed from any viewing angle.

Defaults: width=1.5, height=2.0, barsPerSide=5, barR=0.04.
Useful for prison cells, animal pens, dungeon set dressing,
caged exhibits. Brings the procedural mesh primitive set to 36.
2026-05-09 05:25:39 -07:00
Kelsi
59ae675b78 refactor(editor): extract 5 item read-only handlers into cli_items.cpp
Moves the items.json read-only inspection handlers out of
main.cpp:
  --list-items            --info-item
  --validate-items        --validate-project-items
  --info-project-items

Item editing handlers (--add-item, --set-item, --remove-item,
--add-quest-reward-item) stay in main.cpp since they share
state with quest reward editing logic and would need a
broader extraction.

main.cpp drops 13,887 → 13,485 lines (-402). Behavior
verified by re-running --list-items on a non-items zone
(same error message).
2026-05-09 05:19:04 -07:00
Kelsi
b2cc1b7523 feat(editor): add --gen-texture-coral branching reef pattern
Water-color background with N branching coral structures
that grow from the bottom edge upward. Each branch walks a
curved path (random angle drift) drawing a thick stroke,
splitting into thinner sub-branches at random intervals so
the result reads as organic coral rather than straight lines.

Iterative stack-based growth (no recursion) with split cap
at 256 to bound runtime. Defaults: branchCount=12, seed=1.
Useful for underwater zones, ocean floor, mer-people set
dressing, swamp coral fungi. Brings the procedural texture
pattern set to 31.
2026-05-09 05:11:40 -07:00
Kelsi
83c7fd9bee refactor(editor): extract 8 spawn/snap handlers into cli_spawn_audit.cpp
Moves the NPC spawn / object placer audit + ground-snap
handlers out of main.cpp:
  --snap-zone-to-ground       --snap-project-to-ground
  --audit-zone-spawns         --audit-project-spawns
  --list-zone-spawns          --list-project-spawns
  --diff-zone-spawns          --info-spawn

All operate on creatures.json + objects.json sidecars and
the WHM terrain heightfield via WoweeTerrainLoader.

main.cpp drops 14,628 → 13,887 lines (-741). Behavior verified
by re-running --audit-zone-spawns on a test zone (PASSED with
0 issues, same as before).
2026-05-09 05:05:22 -07:00
Kelsi
47e78d4e08 feat(editor): add --gen-mesh-totem stacked carved totem primitive
Stack of N square blocks with alternating widths: even-indexed
blocks (0, 2, 4...) get full base width, odd blocks (1, 3, 5...)
get 70% — gives the carved-segment look characteristic of
totem poles.

Defaults: baseW=0.5, 5 segments, segH=0.5. Useful for tribal
zones, druid groves, fairgrounds, primitive village markers.
Brings the procedural mesh primitive set to 35.
2026-05-09 04:57:33 -07:00
Kelsi
a23eb420ef refactor(editor): move --info-quests and --info-objects into cli_content_info.cpp
Picks up two stragglers that should have been part of the
content-info family extraction in c519ee3 — they were earlier
in main.cpp (lines 1079, 1139) than the contiguous block I
extracted, so the prior pass missed them. Moving them now
puts the entire creature/object/quest inspection family in
one translation unit (18 handlers total).

main.cpp drops 14,732 → 14,628 lines (-104). Behavior
verified by re-running --info-quests on a non-zone path
(same error message).
2026-05-09 04:50:26 -07:00
Kelsi
3e3ba5012b feat(editor): add --gen-texture-circuit sci-fi PCB pattern
Solid PCB background plus N traces that walk the surface in
orthogonal Manhattan style — each trace alternates random
horizontal + vertical segments (3-6 segments per trace,
8-32 px each), with a 3×3 "via" dot at every corner so the
routing reads as intentional rather than random scribbles.

Defaults: traceCount=24, seed=1. Useful for sci-fi panels,
hacker zones, magitek/arcanocore set dressing, robot
texture details. Brings the procedural texture pattern set
to 30.
2026-05-09 04:42:31 -07:00
Kelsi
3967c8de57 refactor(editor): extract 10 diff handlers into cli_diff.cpp
Moves the file-comparison handlers out of main.cpp into their
own translation unit:
  --diff-wcp        --diff-zone
  --diff-glb        --diff-wom
  --diff-wob        --diff-whm
  --diff-woc        --diff-jsondbc
  --diff-extract    --diff-checksum

main.cpp drops 15,653 → 14,732 lines (-921). One build error
during extraction (missing #include for NpcSpawner /
ObjectPlacer / QuestEditor used by --diff-zone) caught by
build and fixed.
2026-05-09 04:35:08 -07:00
Kelsi
887dce647e feat(editor): add --gen-mesh-shrine canopy primitive
6-component composite: square base slab + 4 cylindrical
pillars (12-segment, inset by pillarR so they sit fully on
the base) + flat roof slab on top with 5% overhang past the
base footprint. Pillars + roof create an open canopy.

Defaults: size=1.5, pillarH=2, pillarR=0.1, roofT=0.15.
Useful for wayside shrines, gazebos, well covers, market
stalls, religious altars in temples. Brings the procedural
mesh primitive set to 34.

Milestone: kArgRequired entries reaches 300.
2026-05-09 04:25:52 -07:00
Kelsi
5f37221179 refactor(editor): extract data-tree audit/migration into cli_data_tree.cpp
Moves the seven proprietary-data-tree handlers out of main.cpp:
  --migrate-data-tree         --bench-migrate-data-tree
  --list-data-tree-largest    --export-data-tree-md
  --info-data-tree            --strip-data-tree
  --audit-data-tree

All operate on a Blizzard-format extracted Data tree (the .m2/
.skin/.wmo/.blp/.dbc files) — they audit, migrate, or strip
proprietary-format files in support of the open-format
migration story.

Original placement spanned two sub-blocks (12546-12892 and
13093-13417 in main.cpp) interrupted by --gen-texture and
--add-texture-to-zone in the middle. Extraction collapses
both sub-blocks into one cohesive translation unit.

main.cpp drops 16,321 → 15,653 lines (-668). Behavior verified
by re-running --info-data-tree against a missing directory.
2026-05-09 04:14:32 -07:00
Kelsi
4df8661017 feat(editor): add --gen-texture-rust oxidized-metal pattern
3-octave smooth noise field thresholded by `coverage` to make
rust blob regions, blended with the metal base color via a
0.12-wide smoothstep so patches feather into clean metal
rather than stepping. Per-pixel grain jitter on top so neither
material reads as flat.

Defaults: coverage=0.4 (~40% rust), seed=1. Useful for
weathered armor, abandoned machinery, ruined castle gates,
shipwreck debris. Brings the procedural texture pattern
set to 29.
2026-05-09 04:01:49 -07:00
Kelsi
67ede85f7f refactor(editor): extract zone/project metadata info into cli_zone_info.cpp
Moves the three zone & project metadata inspection handlers
out of main.cpp:
  --info-zone              (single zone.json print)
  --info-zone-overview     (high-level zone digest)
  --info-project-overview  (per-zone summary table for a project)

All three load zone.json via wowee::editor::ZoneManifest.

main.cpp drops 16,564 → 16,321 lines (-243). Behavior verified
by re-running --info-zone + --info-project-overview against
existing test zones.
2026-05-09 03:52:44 -07:00
Kelsi
0a5f508f4e feat(editor): add --gen-mesh-bench wooden bench primitive
Three-box composite: long thin seat plank on top + 2 leg
slabs at the ends (positioned at 90% along the bench length
to leave a small overhang on each side). Legs are vertical
Y-aligned slabs spanning the full height from floor to
bottom-of-seat, ~5% of bench length thick.

Defaults: length=1.5, seatY=0.5, seatT=0.06, seatW=0.4. Useful
for taverns, plazas, roadside rest stops, council halls.
Brings the procedural mesh primitive set to 33.
2026-05-09 03:43:11 -07:00
Kelsi
c519ee3e99 refactor(editor): extract creature/object/quest info into cli_content_info.cpp
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Moves 16 contiguous content-inspection handlers out of main.cpp:

  --info-creatures              --info-creatures-by-faction
  --info-creatures-by-level     --info-objects-by-path
  --info-objects-by-type        --info-quests-by-level
  --info-quests-by-xp           --list-creatures
  --list-objects                --list-quests
  --list-quest-objectives       --list-quest-rewards
  --info-quest-graph-stats      --info-creature
  --info-quest                  --info-object

All read JSON sidecars (creatures.json, objects.json, quests.json)
via wowee::editor::{NpcSpawner, ObjectPlacer, QuestEditor} loaders.

main.cpp drops 17,505 → 16,564 lines (-941). Behavior verified
by running --info-creatures (correctly fails with same parse-
error message on a non-zone path).
2026-05-09 03:33:40 -07:00
Kelsi
6b1b901bc5 feat(editor): add --gen-texture-mosaic 3-color tile pattern
Per-cell hash picks one of 3 colors for each square tile, with
1-pixel black grout on the top + left edges of every cell so
tiles read as physically separated. Exit log breaks down how
many tiles got each color so callers can verify the seed
distribution.

Defaults: tilePx=16, seed=1. Useful for cathedral floors,
stained-glass set dressing, ornate plaza paving. Brings the
procedural texture pattern set to 28.
2026-05-09 03:23:01 -07:00
Kelsi
f283ab2ce7 refactor(editor): extract WCP pack handlers into cli_pack.cpp
Moves the six WoWee Content Pack (.wcp) handlers out of
main.cpp:
  --list-wcp           --info-wcp
  --info-pack-budget   --info-pack-tree
  --pack-wcp           --unpack-wcp

All six defer to wowee::editor::ContentPacker for actual pack
I/O; the handlers just parse args and format output, so the
extraction has no behavioral impact on the pack format itself.

main.cpp drops 17,766 → 17,505 lines (-261). Behavior verified
by re-running --info-wcp on a missing file (same error message).
2026-05-09 03:12:09 -07:00
Kelsi
dab7705c0f feat(editor): add --gen-mesh-grave tombstone primitive
Two-box composite: a wider low base + a vertical tablet
centered on top. Base is deeper than tablet (1.5×) and base
height is 20% of tablet height — proportions that read as a
stable foundation supporting an upright stone.

Defaults: tablet 0.6×1.0×0.15, base width 0.8. Useful for
graveyards, undead zones, memorial set dressing, ruined
chapel courtyards. Brings the procedural mesh primitive set
to 32.
2026-05-09 03:00:19 -07:00
Kelsi
08e7d9c689 refactor(editor): extract format inspection handlers into cli_format_info.cpp
Moves the proprietary-format inspection commands out of main.cpp
into their own translation unit. Each reads a Blizzard-format
file and prints its structure:

  --info-png        --info-blp
  --info-m2         --info-wmo
  --info-adt        --info-jsondbc

main.cpp drops 18,198 → 17,766 lines (-432). Behavior verified
by re-running --info-png on a generated noise texture.
2026-05-09 02:48:58 -07:00
Kelsi
9890429e3c feat(editor): add --gen-texture-vines climbing-plant pattern
Solid wall background plus N vine paths that walk upward from
the bottom edge with a smooth cosine drift + tiny per-step
horizontal jitter. Each vine paints 2 pixels wide on every row
it visits so the trail reads as a thin band rather than a
single-pixel line.

Defaults: vineCount=8, seed=1. Useful for ruined castle walls,
overgrown ruins, jungle temple textures, ivy-covered facades.
Brings the procedural texture pattern set to 27.
2026-05-09 02:37:06 -07:00
Kelsi
98c7621e1d refactor(editor): extract batch convert handlers into cli_convert.cpp
Moves the four bulk format-conversion handlers out of main.cpp:
  --convert-m2-batch    (M2 → WOM)
  --convert-wmo-batch   (WMO → WOB)
  --convert-blp-batch   (BLP → PNG)
  --convert-dbc-batch   (DBC → JSON)

These all share the same pattern: walk srcDir recursively for
files of the input extension and fan out to the single-file
--convert-* counterpart via subprocess (preserving the existing
per-file logic as the source of truth, no duplication).

Single-file converters (--convert-m2, --convert-wmo, etc.) and
the --migrate-* meta-commands still live in main.cpp; they're
in dedicated argv-rescan loops that need a different extraction
approach.

main.cpp drops 18,396 → 18,198 lines (-198). Behavior verified
by re-running --convert-blp-batch with a missing directory and
confirming the same error message.
2026-05-09 02:25:05 -07:00
Kelsi
0c1f873029 feat(editor): add --gen-mesh-banner pole + flag primitive
Composite banner: 12-segment vertical pole cylinder with top
and bottom caps + a rectangular flag attached at the top of
the pole, draped along -Z. The flag is two-sided (front faces
+X, back faces -X) so it reads from both viewing angles
without needing backface-culling-disabled materials.

Defaults: poleH=3, poleR=0.05, flagW=0.8, flagH=1.2. Useful
for guild halls, faction territory markers, military camps,
parade dressing. Brings the procedural mesh primitive set
to 31.
2026-05-09 02:10:23 -07:00
Kelsi
b87ece2d5b refactor(editor): extract format validation into cli_format_validate.cpp
Moves the open-format validation + project-audit handlers out
of main.cpp:

  --validate                    --validate-wom
  --validate-wob                --validate-woc
  --validate-whm                --validate-all
  --validate-project            --validate-project-open-only
  --audit-project               --bench-audit-project
  --bench-validate-project

Also moves the four shared validate*Errors helpers (validateWom/
Wob/Woc/WhmErrors, ~365 lines) into the same module's anonymous
namespace — they were file-scope helpers in main.cpp used only
by these handlers, so co-locating eliminates the cross-TU
coupling.

main.cpp drops 19,446 → 18,396 lines (-1,050). Two build errors
caught during extraction (wrong include path for the WHM loader
header; missing #include for ContentPacker / std::set / std::map);
all fixed before commit.
2026-05-09 01:57:37 -07:00
Kelsi
2d81bc9f6b feat(editor): add --gen-texture-stars night-sky pattern
Solid background fill plus randomly placed stars at varied
brightness — most stars dim (30-65% blend toward star color),
occasional bright stars (85-100% blend) — so the sky reads
with depth rather than as uniform noise. Exit log breaks down
how many bright vs faint stars actually landed.

Defaults: density=0.005 (~0.5% of pixels become stars), seed=1.
Useful for skybox top-faces, distant night sky planes, magical
constellation set dressing. Brings the procedural texture
pattern set to 26.
2026-05-09 01:32:08 -07:00
Kelsi
efe0a91335 refactor(editor): extract WOM info handlers into cli_wom_info.cpp
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.
2026-05-09 01:18:09 -07:00
Kelsi
d0c8ea582e feat(editor): add --gen-mesh-cart wagon primitive
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.
2026-05-09 00:52:13 -07:00
Kelsi
3da5e5517f refactor(editor): extract 10 mesh edit ops into cli_mesh_edit.cpp
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.
2026-05-09 00:36:51 -07:00
Kelsi
08f740a1ff feat(editor): add --gen-texture-clouds sky pattern
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.
2026-05-09 00:20:14 -07:00
Kelsi
3d5a786ca9 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.
2026-05-09 00:04:27 -07:00
Kelsi
326f7bcdaa feat(editor): add --gen-mesh-mushroom forest-prop primitive
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.
2026-05-08 23:48:03 -07:00
Kelsi
251a830966 refactor(editor): extract --gen-mesh dispatcher into cli_gen_mesh.cpp
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.
2026-05-08 23:32:04 -07:00
Kelsi
16ae6489c9 feat(editor): add --gen-texture-bark tree-bark pattern
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.
2026-05-08 23:15:03 -07:00
Kelsi
8e73b715e5 refactor(editor): extract 9 more mesh handlers into cli_gen_mesh.cpp
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.
2026-05-08 22:58:21 -07:00
Kelsi
cd4bdfec44 feat(editor): add --gen-mesh-anvil blacksmith primitive
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.
2026-05-08 22:37:47 -07:00
Kelsi
0075494109 refactor(editor): extract 12 composite mesh primitives into cli_gen_mesh.cpp
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.
2026-05-08 22:19:41 -07:00
Kelsi
ec9c7898d2 feat(editor): add --gen-texture-tile square stone tile pattern
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.
2026-05-08 22:01:31 -07:00
Kelsi
36cc2ee11d refactor(editor): extract remaining 12 texture generators into cli_gen_texture.cpp
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.
2026-05-08 21:41:24 -07:00
Kelsi
58d1e40117 feat(editor): add --gen-mesh-chest treasure chest primitive
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.
2026-05-08 21:19:51 -07:00
Kelsi
6ea2dfcf8c refactor(editor): extract 7 newer texture generators into cli_gen_texture.cpp
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).
2026-05-08 20:59:02 -07:00
Kelsi
6272e58212 feat(editor): add --gen-texture-lava molten-rock pattern
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.
2026-05-08 20:33:45 -07:00
Kelsi
68bded4f20 refactor(editor): extract printUsage into cli_help.cpp
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.
2026-05-08 20:12:15 -07:00
Kelsi
637a5d1e74 feat(editor): add --gen-mesh-barrel cooper-style cask primitive
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.
2026-05-08 19:49:19 -07:00
Kelsi
155bb1619c fix(editor): un-shadow zone mesh detail view as -detail variant
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.
2026-05-08 19:28:18 -07:00
Kelsi
bb8580068b feat(editor): add --gen-texture-snow with sparkle pass
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
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.
2026-05-08 19:07:41 -07:00
Kelsi
a773654be5 refactor(editor): extract project inventory into cli_project_inventory.cpp
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).
2026-05-08 18:47:06 -07:00
Kelsi
c0f2ab7515 refactor(editor): extract per-zone inventory into cli_zone_inventory.cpp
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.
2026-05-08 18:24:01 -07:00
Kelsi
adc01ead1e feat(editor): add --gen-texture-sand desert/dune pattern
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.
2026-05-08 17:59:55 -07:00
Kelsi
a39f4e9b43 refactor(editor): extract README generators into cli_readmes.cpp
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).
2026-05-08 17:36:10 -07:00