Commit Graph
181 Commits
Author SHA1 Message Date
Leonardo Zide 41e5432395 Extract piece registration storage into lcPieceManager
Library and project name registries were accessed directly by source discovery,
cache processing and UI consumers. Centralize their storage and index operations
in a library-owned lcPieceManager, with ordered borrowed snapshots and copied
file metadata for worker include lookup.

Keep source resolution, reference counts, unload/deletion policy, cache I/O and
existing synchronization in lcPiecesLibrary. Preserve project-index collisions,
name normalization and reentrant teardown ordering while routing registration
changes through the manager.

Return the GetParts snapshot by value, name model rename/reservation operations
RenameModelPieceData, and centralize manager forward declarations in the PCH.
Document the registry boundary and register the new files in qmake.

Validation: macOS Qt 6.10 Debug build, whitespace checks and 35 offscreen lifecycle
checks, including archive/directory cold and warm caches, source precedence,
worker includes, borrowed snapshot lifetimes, rename collisions, project transfer
and nested external-project destruction. Successful GPU rendering is not covered
by the offscreen checks.
2026-10-19 11:07:43 -07:00
Leonardo Zide 61be531444 Manage piece data ownership with scoped asset references
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.
2026-10-19 10:02:26 -07:00
Leonardo Zide 7bc6c018b1 Rename PieceInfo to lcPieceData
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.
2026-10-18 23:22:28 -07:00
Leonardo Zide 74e16b0d13 Enable shadow warnings for non-MSVC builds
Enable -Wshadow to bring GCC and Clang shadowing diagnostics closer to the MSVC warning configuration. Rename the filename extension variable to avoid shadowing the file type extension, and remove the unused synthesized-piece failure counter.

Validated with a macOS debug rebuild with no warnings or errors.
2026-10-17 13:41:41 -07:00
Leonardo Zide 58f60b9423 Separate asset readiness from loader request progress
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.
2026-10-16 17:42:16 -07:00
Leonardo Zide b69db29428 Replace custom Image buffers with QImage
Texture decoding and generated atlases previously used a custom packed-pixel
container alongside QImage, duplicating storage and image-processing code.
Use QImage throughout texture preparation and upload, remove Image and its
pixel-format enum, and store font and string masks in Alpha8 atlases.

Preserve power-of-two dimensions with smooth scaling and keep the existing
OpenGL formats, shaders, and CPU mipmap filtering. Handle padded scanlines,
restore the caller's unpack alignment on every upload return, and centralize
binding cleanup so failed uploads do not leave stale texture caches.

Validation: full application build and diff checks passed. OpenGL readback
checks covered RGB/RGBA/alpha data, padded and custom strides, generated and
supplied mipmaps, unpack-state restoration, and failure cleanup. All nine
grid mip levels matched the previous generator. Visual rendering was checked
by the user.
2026-10-12 19:24:44 -07:00
Leonardo Zide 05ba97dd88 Simplify texture sources and remove unused loading paths
The direct texture-loading overloads and synchronous library/manager chain
have no callers. Remove them and the filename image-loading overload so
texture requests use the existing loader path.

Replace the texture's separate source fields with a shared lcFileSource
value in its own header. Keep source identity comparisons unchanged,
including content-based embedded texture checks during project merging.
The loader copies the source directly into its request, eliminating the
library and manager snapshot forwarding methods. Preserve the library
header's regrouping and update the asset-loading documentation.

Validated the debug build, file ownership/cursor/error checks, loader
failure and retry behavior, 800 concurrent archive reads, and matching
embedded/disk texture renders.
2026-10-12 12:15:48 -07:00
Leonardo Zide 1098c2de75 Separate texture management from library source access
Texture lookup, references, decoding, and scheduling were mixed into the pieces library. Introduce lcTextureManager to own texture identities, references, and CPU decoding, while keeping source lookup and file indexes in the library and asynchronous scheduling, uploads, retries, and publication in lcAssetLoader.

Add lcFileSourceSnapshot and OpenFile to return owned disk or memory streams. The library opens files on the existing loading thread and passes lcFile references to the manager. Image decoding uses QFile or existing memory buffers directly, preserving file cursors without an extra adapter.

Hide loader-only texture services, centralize failure state and diagnostics in lcTexture::SetFailed, and use each zip archive internal extraction lock instead of a library-wide mutex. Workers are drained before archive replacement or texture-manager teardown.

Validation: debug build, file ownership and cursor checks, texture lookup and decoding checks, bounded upload-retry and reference-release checks, 800 concurrent archive reads, and matching native GPU renders for embedded and disk textures.
2026-10-12 11:45:25 -07:00
Leonardo Zide c791447cdb Merge pull request #1037 from schodet/fix-appdata
Fix AppStream metadata
2026-09-30 15:28:27 -07:00
Leonardo Zide a719139d47 Replace asset loading progress bar with animated spinner 2026-09-30 10:15:44 -07:00
Nicolas Schodet c33d3c04d4 Fix AppStream metadata
Reported by appstream validate-tree:

    leocad.appdata.xml
      I: org.leocad.LeoCAD:15: developer-name-tag-deprecated
         The toplevel `developer_name` element is deprecated. Please use the `name` element in a
         `developer` block instead.

      I: org.leocad.LeoCAD:~: developer-info-missing
         This component contains no `developer` element with information about its author.

      W: org.leocad.LeoCAD:~: metainfo-filename-cid-mismatch
         The metainfo filename does not match the component ID.

    ✘ Validation failed: warnings: 1, infos: 2, pedantic: 2
2026-09-30 09:58:38 +02:00
Leonardo Zide 29c9c98402 Introduce asset loader boundary for streaming groundwork
Move part scheduling and futures into a library-owned lcAssetLoader while preserving current loading behavior. Hold queued parts alive through completion, deliver completion notifications on the UI thread, and drain work before library teardown.

Pause queued work during stud-style changes, rebuild affected meshes, and use an unambiguous mesh-cache settings key. Guard mesh-buffer rebuilding against allocation failure.

Add the loader to the qmake build and document common build conventions.
2026-09-24 18:56:48 -07:00
Leonardo Zide 4059c474de Update release version to 26.09 2026-09-18 16:43:20 -07:00
Leonardo Zide 949f91f878 Build universal macOS app in AppVeyor 2026-09-12 13:45:39 -07:00
Leonardo Zide f1802487da Build macos arm64. 2026-09-08 21:39:07 -07:00
Leonardo Zide 9dbe3695b7 Add new lcResult class to handle task failures more cleanly. 2026-07-29 22:48:12 -07:00
Leonardo Zide 638f7f1c95 Switch Qt versions on CI. 2026-07-19 22:01:59 -07:00
Leonardo Zide 57e9c9bb4f Fix Qt5 macos build. 2026-07-19 16:26:09 -07:00
Leonardo Zide 357301b3f1 Fix ios compile errors. 2026-06-11 20:07:56 -07:00
Leonardo Zide 2171a3cfba Move Sets Database dialog. 2026-05-03 15:00:07 -07:00
Leonardo Zide 80ea68245c Move Select Dialog. 2026-05-02 16:06:27 -07:00
Leonardo Zide 664429f635 Move Image Dialog files. 2026-05-02 15:51:08 -07:00
Leonardo Zide 6ee89e743c Move HTML dialog files. 2026-05-02 15:08:13 -07:00
Leonardo Zide f52308f9d2 Fix whitespace. 2026-04-05 21:08:47 -07:00
Leonardo Zide 422669ca0d Merge pull request #1018 from BIMCoderLiang/master
Add Chinese language translation.
2026-04-05 20:55:34 -07:00
BIMCoderLiang 2190b87d0e Fix translation error bug. 2026-03-31 21:15:05 +08:00
Leonardo Zide 4939ad2c31 Renamed lcUpdateDialog. 2026-03-30 22:50:17 -07:00
Leonardo Zide 9ccf245373 Renamed the lcEditGroupsDialog class. 2026-03-30 22:33:23 -07:00
BIMCoderLiang 9f07aeac76 update language lists and add item in ui. 2026-03-29 14:34:59 +08:00
Leonardo Zide 6b84216dd8 Renamed history classes. 2026-03-12 23:12:10 -07:00
Leonardo Zide 2da8a27095 Replaced strcpy with a safe function. 2025-12-07 16:48:07 -08:00
Leonardo Zide d1064ad5c1 New undo system. 2025-10-19 10:57:50 -07:00
Leonardo Zide 2bcb350119 Updated version number. 2025-09-01 13:02:04 -07:00
Leonardo Zide c005c237b8 Support logical operators in the parts filter. 2025-07-24 16:48:04 -07:00
Leonardo Zide 2e507036d9 Refactored part picker popups. 2025-07-08 19:31:27 -07:00
Leonardo Zide f7609076d0 Added ladder widget to float properties. 2025-06-28 10:08:02 -07:00
Leonardo Zide ed24c15b20 Use spin boxes for float properties. 2025-06-26 17:12:15 -07:00
Leonardo Zide 1e5eb1811c Added new translation to qrc and pro files. 2025-03-25 11:52:12 -07:00
Leonardo Zide ed29dad76a Added train track gizmo. 2024-11-02 19:34:22 -07:00
Leonardo Zide f06a231816 Added thumbnail manager. 2024-07-11 15:04:07 -07:00
Leonardo Zide 3a62411f0b Removed lcArray. 2024-06-19 19:59:43 -07:00
Leonardo Zide 03d0ff5540 Switch to c++ 17. 2024-05-11 12:14:33 -07:00
Leonardo Zide 4785caac2a Added key frame widgets. 2024-01-14 17:41:01 -08:00
Leonardo Zide fbf174740f Moved object property to a separate file. 2024-01-07 11:39:34 -08:00
Leonardo Zide 4fec12c8df Removed old properties tree widget. 2024-01-06 10:38:25 -08:00
Leonardo Zide ef43c152ad Replaced piece properties widget. 2023-12-31 12:55:35 -08:00
Trevor SANDY aeb06f1380 Blender addon - settings dialog 2023-06-11 17:42:22 +02:00
Leonardo Zide 2f034c1763 Updated file names. 2023-05-15 21:12:08 -07:00
Leonardo Zide fb961d2cab Moved model list dialog. 2023-04-29 20:10:50 -07:00
Leonardo Zide 2c2cb46ddb Moved group dialog files. 2023-04-29 20:04:58 -07:00