feat(system): Load Uniscribe at runtime - #3241
Conversation
PR Summary by QodoLoad required Uniscribe APIs dynamically on Windows
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR |
|
| Filename | Overview |
|---|---|
| Core/Libraries/Source/WWVegas/WWLib/Usp10Loader.cpp | Implements synchronized, process-lifetime loading and fail-closed dispatch for five Uniscribe exports. |
| Core/Libraries/Source/WWVegas/WWLib/Usp10Loader.h | Defines the loader interface, opaque Uniscribe types, constants, and function-pointer signatures. |
| Core/Libraries/Source/WWVegas/WWLib/CMakeLists.txt | Adds the loader files to the Windows-only WWLib source set. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
Caller[Complex-text renderer] --> Wrapper[Usp10Loader wrapper]
Wrapper --> Cached{Load already attempted?}
Cached -->|No| SystemPath[Build system-directory DLL path]
SystemPath --> Load[Load usp10.dll]
Load --> Resolve[Resolve five Uniscribe exports]
Resolve -->|All available| Invoke[Invoke requested function]
Resolve -->|Missing export| Failure[Return E_FAIL or nullptr]
Load -->|Load fails| Failure
Cached -->|Yes and loaded| Invoke
Cached -->|Yes and unavailable| Failure
Reviews (2): Last reviewed commit: "feat(system): Load Uniscribe at runtime" | Re-trigger Greptile
|
|
||
| private: | ||
|
|
||
| static bool load(); |
There was a problem hiding this comment.
The current model does not allow to unload it. Is this acceptable?
There was a problem hiding this comment.
well its intentional be desigin, usp10.dll is loaded on first use and retained until process exit.
adding unload or reference counting would introduce lifecycle and synchronization risks without a practical benefit for the game, i only added comment to clerify!
There was a problem hiding this comment.
In principle the permanent lifetime is ok, but technically it is a handle leak. HMODULE Module is never freed so Windows will log this as a leaked handle at program termination. It would be cleaner to free it on shutdown.
It will not race because there is a CriticalSection to use.
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
68a4beb to
370c8ed
Compare
Adds a small Windows-only loader for the five Uniscribe functions required by the complex-text renderer.
The loader resolves the functions from the system
usp10.dllat runtime and reports failure to callers when Uniscribe is unavailable. This allows #3231 to retain the existing per-character renderer as its fallback while removing the compile-time dependency onusp10.handusp10.lib, which are missing from the VC6 SDK.Cross-platform text shaping remains outside this focused compatibility change.
The stacked result was validated with:
usp10.dllgit diff --checkThe change was developed with AI assistance, then manually reviewed against the nearby runtime-loader pattern and the official Windows SDK function declarations.