Skip to content

unify(ww3d2): Merge WW3D and move it to Core - #3012

Open
bobtista wants to merge 2 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/unify/ww3d-to-core
Open

unify(ww3d2): Merge WW3D and move it to Core#3012
bobtista wants to merge 2 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/unify/ww3d-to-core

Conversation

@bobtista

Copy link
Copy Markdown

Generals and Zero Hour differ only by comments and the disabled WWShade SHD_FLUSH hook.

Now Generals uses the Zero Hour implementation, and ww3d.cpp and ww3d.h are moved to Core using unify_move_files.py

Todo:

  • Confirm both implementations are identical before moving
  • Configure both game targets
  • Replicate to Generals

@bobtista bobtista self-assigned this Jul 25, 2026
@bobtista bobtista added the Unify Unifies code between Generals and Zero Hour label Jul 25, 2026
@greptile-apps

greptile-apps Bot commented Jul 25, 2026

Copy link
Copy Markdown

Greptile Summary

This PR consolidates the WW3D implementation into the shared Core library.

  • Moves ww3d.cpp and ww3d.h from the Zero Hour tree into Core/Libraries/Source/WWVegas/WW3D2.
  • Configures both Generals and Zero Hour WW3D2 targets to compile the shared implementation.
  • Updates per-game source files to include the shared WW3D2/ww3d.h path.
  • Records the completed file migration in unify_move_files.py.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
Core/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt Adds the relocated WW3D implementation and header to the shared Core WW3D2 source set.
Core/Libraries/Source/WWVegas/WW3D2/ww3d.cpp Relocates the existing Zero Hour WW3D implementation into Core and qualifies local WW3D2 includes.
Core/Libraries/Source/WWVegas/WW3D2/ww3d.h Relocates the common WW3D interface into Core without content changes.
Generals/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt Removes the obsolete per-game WW3D implementation from the Generals source list.
GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt Removes the obsolete per-game WW3D implementation from the Zero Hour source list.
scripts/cpp/unify_move_files.py Records the completed WW3D source and header migration as disabled migration entries.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Core["Core WW3D2<br/>shared ww3d.cpp / ww3d.h"]
    G["Generals g_ww3d2"]
    Z["Zero Hour z_ww3d2"]
    GC["Generals WW3D consumers"]
    ZC["Zero Hour WW3D consumers"]
    Core --> G
    Core --> Z
    GC --> G
    ZC --> Z
Loading

Reviews (3): Last reviewed commit: "unify(ww3d2): Move WW3D to Core" | Re-trigger Greptile

@bobtista
bobtista force-pushed the bobtista/unify/ww3d-to-core branch from a0dd61d to 902892d Compare July 25, 2026 16:12
Comment thread Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp
Comment thread Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.h
#include "boxrobj.h"
#include "WW3D2/rinfo.h"
#include "WW3D2/assetmgr.h"
#include "WW3D2/boxrobj.h"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing this maybe we help CMake see this path from the Core ww3d2 INTERFACE?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into this. corei_ww3d2 can only expose the Core WW3D2 directory, while these headers (rinfo.h, assetmgr.h, etc.) still live in the game-specific directories. We could add those directories privately to each game target, but that would introduce a new include-path convention. Currently, cross-directory WWVegas includes are folder-qualified, so I think these qualifications are appropriate until the remaining files are unified into Core.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My expectation is that this was working before 3778f20

Given this change, it would mean that every move to Core would now need tweaking some header includes. It would be good to avoid this in this intermediate unification phase.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe this needs a pass and complete what 3778f20 has missed? Or revert parts of it where intra lib includes do not need to have the folder.

Include for WW3D2 file inside WW3D2 lib does not necessarily need to specifiy the WW3D2 folder. This is true for all the WWVegas libs.

It's something I have missed in this review.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, cross-directory WWVegas includes are folder-qualified

I think this is the problem. Shall we revert that aspect?

@bobtista
bobtista force-pushed the bobtista/unify/ww3d-to-core branch from 902892d to 701dc6b Compare July 26, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Unify Unifies code between Generals and Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants