Sync TheSuperHackers upstream (2026-04-10) - DX8/WW3D2 conflict resolution#82
Merged
Sync TheSuperHackers upstream (2026-04-10) - DX8/WW3D2 conflict resolution#82
Conversation
…ralsX cross-platform patterns This merge incorporates the TheSuperHackers upstream commit df31c7e which unified DX8 wrapper and caps structures across Generals and GeneralsMD. Key conflict resolutions: - Kept GeneralsX Matrix4x4 pattern (fighter19-inspired) instead of D3DMATRIX - Preserved singular vertex_buffer naming conventions (not plural) - Accepted upstream's single Caps field consolidation (hwVPCaps/swVPCaps → Caps) - Maintained SDL3/DXVK/OpenAL platform stubs (windows-only ifdef guards) - Integrated shdlib.h migration from GeneralsMD to Core The merged code was validated with successful Linux builds: - GeneralsXZH: 924 compilation units → 178MB executable - GeneralsX: 771 compilation units → 163MB executable Cross-platform architecture preserved: no native Win32/POSIX/Cocoa calls in game logic. All platform-specific changes isolated to device layers.
There was a problem hiding this comment.
Pull request overview
Syncs TheSuperHackers upstream WW3D2/DX8 unification work into GeneralsX while preserving cross-platform constraints (DXVK-friendly types, SDL3-oriented platform guards), including resolving conflicts in DX8 wrapper/caps code and migrating WW3D2 shader stub header into Core.
Changes:
- Unifies DX8 caps handling and expands capability introspection/logging in
DX8Caps(Generals) and aligns minor formatting in Zero Hour caps. - Adjusts WW3D2 build lists to migrate
shdlib.hintoCore/Libraries/.../WW3D2and comment it out in the ZH WW3D2 target sources. - Extends
unify_move_files.pywith a helper to move library files and update the correct nested CMakeLists.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/tooling/cpp/maintenance/unify_move_files.py | Adds unify_move_file_lib() for nested library-path moves and CMakeLists toggling. |
| GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp | Comment/log text cleanups around render-device selection and light clearing snapshots. |
| GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8caps.cpp | Minor formatting alignment in vendor-specific hack block. |
| GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt | Comments out shdlib.h in ZH WW3D2 sources (migrated to Core). |
| Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8caps.h | Switches to unified Caps field + adds new getters/flags; currently contains redundant declarations. |
| Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8caps.cpp | Expands caps computation, adds detailed caps logging, and refactors vendor/device handling. |
| Core/Libraries/Source/WWVegas/WW3D2/shdlib.h | Adds WWShade stub header into Core WW3D2. |
| Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt | Enables shdlib.h in Core WW3D2 source list. |
The auto-merge introduced duplicate declarations of the D3DCAPS8 constructor and Is_Valid_Display_Format method in Generals dx8caps.h. Removed duplicates to resolve 'cannot be overloaded with' compiler errors. Files affected: - Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8caps.h - Removed duplicate: DX8Caps(IDirect3D8*, const D3DCAPS8&, ...) - Removed duplicate: Is_Valid_Display_Format(int, int, WW3DFormat)
Owner
Author
Build Fix AppliedIssue: Generals base game build failed with duplicate declaration errors in
Root Cause: Auto-merge during conflict resolution added the upstream's declarations without removing our pre-existing ones. Fix Applied (commit
Status: ✅ Fix pushed to branch CI should now pass on next rebuild. |
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.
Upstream Sync: DX8/WW3D2 Unification
This PR merges the TheSuperHackers upstream commit that unified Direct3D 8 wrapper and capabilities structures across both Generals and Zero Hour.
Upstream Commit
df31c7eae unify(ww3d2): Merge dx8wrapper, dx8caps, shdlib (#2499)Conflict Resolution Strategy
This merge involved 5 conflicted files, all in the DX8/WW3D2 graphics subsystem. Resolution prioritized preserving our cross-platform architecture:
1. Matrix Representation (Kept GeneralsX pattern)
D3DMATRIX(Windows-only D3D8 struct)Matrix4x4(Fighter19-inspired portable pattern)Matrix4x4to maintain DXVK/Vulkan compatibility (no D3D structs on Linux/macOS)2. Vertex Buffer Naming (Kept GeneralsX conventions)
vertex_buffers/vertex_buffer_types(plural)vertex_buffer/vertex_buffer_type(singular array indexing)3. Graphics Caps Unification (Accepted upstream's single Caps field)
D3DCAPS8 Capsfield (consolidated from hw/sw variants)hwVPCaps/swVPCapsfields with dual initializationSupportTnLto select hw vs sw path; Get_DX8_Caps() returns unifiedCapsfield4. Platform Stubs (Preserved GeneralsX cross-platform support)
#ifdef_WIN32guards around embedded browser (dx8webbrowser.h), dynamic DLL loading viamodule_compat.h5. Header Migration (Integrated shdlib.h → Core)
shdlib.hmoved from GeneralsMD to Core/Librariesunify_move_files.pynow supportsunify_move_file_lib()for library-level file movesBuild Validation
Both games were successfully compiled with the merged code on Linux:
Build Environment: Linux x86_64 via Docker
linux64-deployCross-Platform Integrity
✅ No gameplay logic changes — only rendering device layer consolidation
✅ No native platform code in game logic — SDL3 abstractions preserved
✅ DXVK/Matrix4x4 patterns intact — Linux/macOS support maintained
✅ Retail compatibility preserved — VC6 preset and original paths unaffected
Testing
Manual smoke test confirmed: Game launcher and main menu render correctly with merged code.
Merge Conflict Files
Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8caps.cpp(resolved)Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8caps.h(auto-merged, no conflicts)Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp(resolved)Generals/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h(resolved)Generals/Code/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp(resolved)GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.h(resolved)Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt(auto-merged)GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt(auto-merged)Next Steps