Skip to content

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

Merged
xezon merged 2 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/unify/ww3d-to-core
Aug 1, 2026
Merged

unify(ww3d2): Merge WW3D and move it to Core#3012
xezon merged 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

Moves the shared WW3D implementation into Core.

  • Enables ww3d.cpp and ww3d.h in the Core WW3D2 interface target.
  • Removes the per-game implementations and configures both game targets to consume the Core sources.
  • Updates affected headers to include the shared WW3D2/ww3d.h path.
  • Records the completed move in the unification script.

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 moved WW3D implementation and header to the shared interface source list consumed by both game libraries.
Core/Libraries/Source/WWVegas/WW3D2/ww3d.cpp Relocates the existing Zero Hour WW3D implementation into Core without content changes.
Core/Libraries/Source/WWVegas/WW3D2/ww3d.h Relocates the existing WW3D public interface into Core without content changes.
Generals/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt Stops compiling the deleted Generals-local implementation so the target consumes the shared Core source.
GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/CMakeLists.txt Stops compiling the moved Zero Hour implementation locally so the target consumes the shared Core source.
scripts/cpp/unify_move_files.py Documents the completed WW3D file unification through commented maintenance-script entries.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Core["corei_ww3d2<br/>shared ww3d.cpp / ww3d.h"]
  Generals["g_ww3d2<br/>RTS_GENERALS"]
  ZeroHour["z_ww3d2<br/>RTS_ZEROHOUR"]
  Core --> Generals
  Core --> ZeroHour
Loading

Reviews (5): 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
Comment thread Core/Libraries/Source/WWVegas/WW3D2/ww3d.cpp Outdated
#include "WWLib/always.h"
#include "WWLib/bittype.h"
#include "ww3d.h"
#include "WW3D2/ww3d.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.

Is this still needed?

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 think so. mapper.h and rinfo.h in both game trees still include ww3d.h bare. Those two headers are pulled in from outside the ww3d2 targets, and those get the WWVegas roots but not the WW3D2 subdirs. They're now WW3D2/ww3d.h, matching #3032's rule of qualifying header edges that cross the Core/product partition.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Right, the headers must have fully qualified paths because they can be included by other libs.

@xezon xezon added Gen Relates to Generals ZH Relates to Zero Hour labels Aug 1, 2026

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

pull id is missing in commit titles.

Can say ww3d instead of WW3D because of the file name. WW3D is class name.

@bobtista
bobtista force-pushed the bobtista/unify/ww3d-to-core branch from b285605 to b7d3181 Compare August 1, 2026 17:06
@xezon
xezon merged commit c830622 into TheSuperHackers:main Aug 1, 2026
16 checks passed
xezon pushed a commit that referenced this pull request Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gen Relates to Generals Unify Unifies code between Generals and Zero Hour ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants