A piece at an extreme coordinate expands the grid to millions of lines, causing excessive allocations or a truncated vertex buffer size followed by writes past its end. Larger coordinates can also exceed the integer range during conversion.
Clamp finite grid bounds before converting to integers, limiting the vertex buffer to less than 1 MB, and use the default grid for non-finite bounds. Calculate texture extents in floating point to avoid integer overflow with large spacing values.
Replace manual piece-data retain/release bookkeeping with shared copyable
asset-reference handles. Pieces, models, selection, minifigs, thumbnails,
and stored insertion previews retain their dependencies explicitly, while
transient queries continue to borrow pointers.
Separate registered lookup and acquisition from asynchronous load requests
and explicit readiness waits. Keep loader-held references through work and
notification delivery, resetting shared request handles on the UI thread
and guarding callback-triggered library teardown.
Validated with the Qt 6.10 debug build and 26 offscreen lifecycle checks,
including cancellation, stale requests, copy/move operations, model/preview
teardown, undo, project merge/export, and loader shutdown.
Use PieceData consistently for the shared part/model record, its related
APIs and variables, and its source files. Keep the existing reference
counting and loading behavior so ownership and readiness changes can be
reviewed separately.
Keep piece readiness, mesh publication, and settled synth errors in the
library while the loader manages scheduling, request outcomes, cancellation,
and deferred notifications. Capture synth inputs and base identities at the
library boundary so the loader treats pieces as opaque identities.
Use a shared asset readiness enum for pieces and textures. Keep texture
queueing, decoding, and retry progress in requests, pass resolved sources to
the loader, and centralize texture failure messages in lcTexture. Preserve
scoped wait failure and cancellation results alongside final readiness checks.
Consolidate shared priorities, sources, snapshots, build results, and texture
error codes in lc_assettypes.h, replacing lc_filesource.h. Forward declarations
remove the loader header's piece, library, and texture-manager dependencies.
Validated with the Qt Debug build, header isolation compilation, asset loader
lifecycle and scheduling regression checks, and 14 first/repeat export checks.
Replace load flags and the loader's separate priority enum with Low, Normal, and Blocking priorities. Blocking loads wait for completion; asynchronous loads and internal scheduling retain promotion-only behavior.
Acquire consumer references in the library, reuse loader loading for stud-style rebuilds, and remove QueuePiece, single-piece readiness wrappers, and the library texture readiness wrapper. Rename scoped readiness APIs to WaitFor functions and document their scheduling and lifetime contracts.
Validated with a Debug build and a temporary lifecycle harness covering priority promotion, blocking loads, reference cleanup, selective style reloads, cancellation, pause/resume, and shutdown.
The fixed-function renderer was removed, but shader capability guards,
bitmap text paths, and legacy attribute state still implied a working
shaderless fallback. Remove that obsolete state and check shader support
once when initializing rendering resources.
Return detailed context and shader errors through lcResult and show fatal
startup errors in GUI mode. Keep lighting, conditional lines, SDF text,
view sphere, and outlines optional, with program validity checks selecting
Flat shading, skipping unavailable overlays, or retaining selection tint.
Non-rendering exports initialize only the context needed for asset loading.
Apply icon availability to every parts list without overwriting requested
sizes. Disable unavailable lighting and view-sphere preference controls,
make attribute aliases explicit, and prevent signed-byte glyph indexing.
Validation: macOS debug build, GUI and image export under forced optional
shader compile/link failures, Flat fallback image comparisons, export
initialization checks, preference preservation, and glyph byte-range checks.
Render selected pieces with an outline above scene geometry and a faint selection-colored fill only over obscured portions. Preserve line-only selection colors and insertion preview tint, and suppress bounding box corners in outline mode.
Keep the existing tint and edges mode as a preference and fallback when outline rendering is unavailable. Own outline framebuffers in each view, keep OpenGL operations in lcContext, and capture selection visibility before the grid through a callback scoped to each scene draw.
Validation: debug build and desktop OpenGL checks passed for occlusion, transparency, MSAA, HiDPI, line-only selection, framebuffer fallback, grid exclusion, and widget resource cleanup.
Large models can extend beyond the default far plane after fitting,
leaving the view blank or clipped. Pass an explicit adjustment flag
through view, model, and camera fitting, and reuse the fitted bounds
to expand clipping with a margin, rounded up to multiples of 10,000.
Adjust restored ordinary cameras after applying their saved state.
Preserve named cameras and explicit command-line clipping planes,
and avoid recalculating clipping during redraws or navigation.
Route output fitting through the view and move the bounds policy
definition out of the precompiled header.
Report missing generated meshes and failed image writes, keep thumbnails and interactive geometry using their fallback behavior, and frame command-line images at the requested step or full range. Use explicit mesh loader flags and reject incomplete synthesized meshes. Keep selection and ray tests aligned with the rendered mesh.
Queue model geometry builds and mesh conversion on workers so project opening can return after parsing. Keep complete-asset waits for previews and output, and show project loading progress in the status bar.
Preserve live pieces when project names overlap, restore mappings after failed loads, and include detached pieces in buffer and stud-style updates.
- Draw a shared cube for parts whose meshes or textures are still loading.
- Update model bounds, picking, views, and loading status as assets complete.
- Wait for required assets before thumbnails, screenshots, instructions,
and geometry exports; report failures instead of rendering placeholders.
- Render and pick direct geometry in external projects.
- Defer shared buffer repacking until pending loads finish.
Generate SDF glyphs for viewport overlays with configurable text and halo colors. Render view-sphere labels directly on the sphere surface from a compact vertical atlas, fitting translated labels to the printable area. Preserve the bitmap paths when shader objects are unavailable.
Add a camera-facing rotation ring with hover feedback, and replace free XYZ rotation with a trackball interaction. Improve rotation-disc feedback, cursor behavior, snapping, and submodel transform handling.