Unify surface editing via WdgSurfaceEdit; per-surface no-light/no-glow/no-fog - #9
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WdgSurfaceEdit, a single reusable panel for editing aSurface(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.WALL_FLAG_ALPHA,DOOR_FLAG_ALPHA,LIFT_FLAG_ALPHA) in favor of per-surfaceSURFACE_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 betweenSURFACE_FLAG_NO_GLOW/SURFACE_FLAG_NO_FOG.surfaceDrawfor floors/ceilings,vstripDrawfor wall faces):NO_LIGHTreplaces the sun ambient/ray term with full white,NO_GLOWskips the glowmap sample,NO_FOGsuppresses 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.WdgTexSelector/WdgTexViewtoWdgTextureSelector/WdgTextureViewfor clarity; extract the shared silent spinbox/checkbox setters intowdgutilities.cpp/h.Test plan
-Wall -Wextra