Skip to content

unify(client): Merge and move GameClient source and include files to Core#2578

Closed
DevGeniusCode wants to merge 3 commits intoTheSuperHackers:mainfrom
DevGeniusCode:unify-client
Closed

unify(client): Merge and move GameClient source and include files to Core#2578
DevGeniusCode wants to merge 3 commits intoTheSuperHackers:mainfrom
DevGeniusCode:unify-client

Conversation

@DevGeniusCode
Copy link
Copy Markdown

Summary

This PR unifies and moves various GameClient files from Generals and GeneralsMD into the Core directory.

The primary goal of this change is to reduce code duplication across the two game versions. I have ensured that the logic remains intact and identical.

Key Changes

  • File Relocation: Moved approximately 60+ files (Source and Include) from GameEngine/Source/GameClient and GameEngine/Include/GameClient to Core.
  • Code Consistency: No functional code was added or removed. The files were unified based on their identical content.
  • Minor Cleanups: In cases where there were slight differences in comments (e.g., fixing typos or formatting), I selected the most accurate version to maintain consistency.
  • Build System: Updated CMakeLists.txt in Generals, GeneralsMD, and Core to reflect the new file locations.

Files Moved:

The move includes (but is not limited to):

  • Systems: Display, Anim2D, DebugDisplay, Image, RayEffect.
  • GUI & Gadgets: AnimateWindowManager, GameWindowManager, GadgetCheckBox, GadgetListBox, etc.
  • Modules: AnimatedParticleSysBoneClientUpdate, BeaconClientUpdate, SwayClientUpdate.
  • Menus: Various GUI callback files for menus like CreditsMenu, DifficultySelect, and WOL screens.

@DevGeniusCode DevGeniusCode added Gen Relates to Generals Unify Unifies code between Generals and Zero Hour labels Apr 11, 2026
@DevGeniusCode DevGeniusCode changed the title unify(client): Merge and move GameClient source and include files to Core unify(client): Merge and move GameClient source and include files to Core Apr 11, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 11, 2026

Greptile Summary

This PR moves approximately 60+ GameClient source and header files from Generals/Code/GameEngine and GeneralsMD/Code/GameEngine into Core/GameEngine, updating all three CMakeLists.txt files accordingly. The purpose is to eliminate duplication of identical files between the two game targets. The moved files retain all existing logic and copyright headers. A helper Python script (scripts/cpp/unify_move_files.py) was used to automate the process, with the executed operations now commented out to record history.

Confidence Score: 5/5

Safe to merge — this is a pure file relocation with no functional changes, and all build system entries are correctly updated.

All 216 changed files are either: files moved verbatim to Core with GPL/EA headers preserved and #pragma once in place, CMakeLists.txt entries correctly commented-out in Generals/GeneralsMD and uncommented in Core, or game-specific files (Drawable.h, SelectionXlat.h) left in their respective directories. No double-commented CMake entries, no missing GPL headers, no broken file references. No P0/P1 findings.

No files require special attention.

Important Files Changed

Filename Overview
Core/GameEngine/CMakeLists.txt Uncomments 60+ GameClient include and source entries to include the newly unified files from Core.
Generals/Code/GameEngine/CMakeLists.txt Comments out all GameClient entries that were moved to Core; Generals-specific files (Drawable.h, SelectionXlat.h, etc.) remain uncommented.
GeneralsMD/Code/GameEngine/CMakeLists.txt Comments out all GameClient entries that were moved to Core; GeneralsMD-specific files (Drawable.h, SelectionXlat.h) remain in place and uncommented.
scripts/cpp/unify_move_files.py Adds the batch of unify_file() calls for this PR (lines 442–548), all commented out after execution; prior history calls remain commented out. Script logic is correct.
Core/GameEngine/Include/GameClient/Display.h Unified header moved from GeneralsMD; uses #pragma once, retains GPL + EA copyright headers, no functional changes.
Core/GameEngine/Source/GameClient/Display.cpp Unified source moved from GeneralsMD; retains GPL + EA copyright headers, no functional changes.
GeneralsMD/Code/GameEngine/Include/GameClient/Drawable.h GeneralsMD-specific file, not moved to Core; correctly uses "Command & Conquer Generals Zero Hour(tm)" header.
GeneralsMD/Code/GameEngine/Include/GameClient/SelectionXlat.h GeneralsMD-specific file, not moved to Core; correctly uses "Command & Conquer Generals Zero Hour(tm)" header.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph Before["Before This PR"]
        G_INC["Generals/Code/GameEngine/Include/GameClient/*.h\n~44 headers"]
        G_SRC["Generals/Code/GameEngine/Source/GameClient/**/*.cpp\n~20 sources"]
        MD_INC["GeneralsMD/Code/GameEngine/Include/GameClient/*.h\n~44 headers (identical)"]
        MD_SRC["GeneralsMD/Code/GameEngine/Source/GameClient/**/*.cpp\n~20 sources (identical)"]
    end

    subgraph After["After This PR"]
        CORE_INC["Core/GameEngine/Include/GameClient/*.h\n44 unified headers"]
        CORE_SRC["Core/GameEngine/Source/GameClient/**/*.cpp\n20 unified sources"]
        G_SPECIFIC["Generals/ (game-specific only)\nDrawable.h, SelectionXlat.h, etc."]
        MD_SPECIFIC["GeneralsMD/ (game-specific only)\nDrawable.h, SelectionXlat.h, etc."]
    end

    G_INC -->|"moved + deleted"| CORE_INC
    G_SRC -->|"moved + deleted"| CORE_SRC
    MD_INC -->|"deleted (duplicate)"| CORE_INC
    MD_SRC -->|"deleted (duplicate)"| CORE_SRC

    CORE_INC --> G_SPECIFIC
    CORE_INC --> MD_SPECIFIC
    CORE_SRC --> G_SPECIFIC
    CORE_SRC --> MD_SPECIFIC

    CMAKE["CMakeLists.txt updates\nGenerals + GeneralsMD: commented out\nCore: uncommented"]
    CMAKE --> CORE_INC
    CMAKE --> CORE_SRC
Loading

Reviews (1): Last reviewed commit: "unify(client): Move several GameClient f..." | Re-trigger Greptile

Copy link
Copy Markdown

@Skyaero42 Skyaero42 left a comment

Choose a reason for hiding this comment

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

This looks good

@xezon
Copy link
Copy Markdown

xezon commented Apr 11, 2026

This is way too much in one go and will cause massive merge conficts.

@xezon xezon closed this Apr 11, 2026
@DevGeniusCode
Copy link
Copy Markdown
Author

DevGeniusCode commented Apr 11, 2026

This is way too much in one go and will cause massive merge conficts.

I split GameEngine and GameEngineDevice
Are additional splits necessary?
How is this different from massive style PR?

@xezon
Copy link
Copy Markdown

xezon commented Apr 11, 2026

Usually we do targeted moves. For example move Network related files, or INI related files. Not move whole Game and Engine.

@DevGeniusCode DevGeniusCode deleted the unify-client branch April 11, 2026 18:31
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants