Skip to content

Unify surface editing via WdgSurfaceEdit; per-surface no-light/no-glow/no-fog - #9

Merged
Marzac merged 6 commits into
mainfrom
texture-props-wall-flags
Jul 12, 2026
Merged

Unify surface editing via WdgSurfaceEdit; per-surface no-light/no-glow/no-fog#9
Marzac merged 6 commits into
mainfrom
texture-props-wall-flags

Conversation

@Marzac

@Marzac Marzac commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add WdgSurfaceEdit, a single reusable panel for editing a Surface (texture id, scale, shift, alpha/no-light/no-glow/no-fog), and wire it into the Walls, Doors, Lifts, and Staircases tabs, replacing the per-tab hand-rolled texture/scale/shift controls.
  • Retire per-object alpha (WALL_FLAG_ALPHA, DOOR_FLAG_ALPHA, LIFT_FLAG_ALPHA) in favor of per-surface SURFACE_FLAG_ALPHA, since Doors/Lifts already render through the same synthetic-wall path as Walls and their per-object alpha flags were dead code at render time. Fixes a bit collision between SURFACE_FLAG_NO_GLOW/SURFACE_FLAG_NO_FOG.
  • Implement the three new per-surface flags in the renderer (surfaceDraw for floors/ceilings, vstripDraw for wall faces): NO_LIGHT replaces the sun ambient/ray term with full white, NO_GLOW skips the glowmap sample, NO_FOG suppresses the atmospheric fog blend — with the no-glow/fog branch resolved once per call via compile-time-tagged lambda dispatch rather than inside the per-pixel hot loop.
  • Rename WdgTexSelector/WdgTexView to WdgTextureSelector/WdgTextureView for clarity; extract the shared silent spinbox/checkbox setters into wdgutilities.cpp/h.
  • Fix a lift render offset bug: the synthetic walls for a Lift's sides/top/bottom didn't follow the platform's current travel offset.

Test plan

  • Rebuilt via CMake/Ninja (llvm-mingw/clang++) after every change; clean with -Wall -Wextra
  • Launched the editor to confirm it starts without crashing
  • Manual pass in the editor: select a wall/door/lift/staircase, flip through each surface slot, edit id/scale/shift/flags, confirm multi-select propagation and undo (Walls only) still work
  • Visually confirm NO_LIGHT/NO_GLOW/NO_FOG render as expected in the 3D view

Marzac added 6 commits June 26, 2026 17:51
Rig model/primitives (Joint, Bone, Rig, .rig load/save) in common/engine,
plus the Qt animator app: cylinder-view editor widget with joint editing,
rectangle selection, joint and viewer property panels, and File/Help menus.
Move drawer.cpp/h from animator/ to common/engine/ so Waller and Rigger
can share the same software quad/triangle rasteriser. Extract Viewpoint,
Texture, D2R/R2D into a new primitives.h, and scope the renderer's flags
as the nested Renderer::FLAGS enum instead of free RENDERER_FLAG_* macros.
Add colorsAlphaBlendSSE4 (used by the drawer) to colors.h.

Updates Waller's call sites and build file for the renamed flags and the
new primitives.h header.
Bones: connect joints into bones, select/move/delete, rectangle-select,
billboard quad with width/length/offset/minWidth, mirror and rotate
flags, per-view-arc images (Front/Right/Back/Left), and a swap button
for the two joints.

Flesh: render the bones as textured billboard quads via the shared
drawer; extract the rendering loop into Rigger::renderFlesh, plus
Rigger::renderAnimationFrame for a bounding-box-fitted, frame-interpolated
bake of a single animation pose into an arbitrary image.

UI: a texture-strip selector (WdgTexSelector) and per-bone texture
preview (WdgTexView) for assigning images, a frame-card selector
(WdgFrameSelector) for picking/adding/deleting/reordering animation
frames, joint/bone property panels, display toggles (joints/bones/flesh)
and editAllFrames, viewer pan/diameter/y controls, J/B/Esc shortcuts,
and lastrig.rig session persistence.
The synthetic walls generated for a Lift's sides/top/bottom were
anchored at the node position and never accounted for the platform's
current travel offset, so the visible geometry didn't move together
with the animated lift.
… and Staircases

Introduces WdgSurfaceEdit, a single reusable panel for editing a
Surface (texture id, scale, shift, and per-surface alpha/no-light/
no-glow/no-fog flags), and wires it into the Walls, Doors, Lifts, and
Staircases tabs, replacing the hand-rolled, duplicated texture/scale/
shift controls each of those tabs carried separately. The widget edits
a local value copy and reports changes via a surfaceChanged(Surface)
signal; MainWindow owns every write into the map data (including
propagating an edited wall surface across a multi-selection), which
sidesteps the Qt implicit-sharing pitfalls of caching a raw Surface*
into a QList-backed container across signal round-trips.

Per-object alpha (WALL_FLAG_ALPHA, DOOR_FLAG_ALPHA, LIFT_FLAG_ALPHA)
is retired in favor of per-surface SURFACE_FLAG_ALPHA, since Doors and
Lifts render through the same synthetic-wall path as Walls
(Map::passDoors/passLifts) and their per-object alpha flags were
already dead code w.r.t. rendering. Also fixes a bit collision between
SURFACE_FLAG_NO_GLOW and SURFACE_FLAG_NO_FOG (both were 0x0010).

The renderer now honors the three new per-surface flags in
surfaceDraw (floors/ceilings) and vstripDraw (wall faces): NO_LIGHT
replaces the sun ambient/ray contribution with full white, NO_GLOW
skips the glowmap sample entirely, and NO_FOG suppresses the
atmospheric fog blend. In surfaceDraw the no-glow/fog decisions are
resolved once per call via a compile-time-tagged lambda dispatch
(if constexpr on std::true_type/false_type) rather than branching
inside the per-pixel hot loop.

Also renames WdgTexSelector/WdgTexView to WdgTextureSelector/
WdgTextureView for clarity, and extracts the shared silent
spinbox/checkbox setters used across MainWindow and WdgSurfaceEdit
into wdgutilities.cpp/h.
@Marzac
Marzac merged commit 0cf46a0 into main Jul 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant