Skip to content

Conversation

@xezon
Copy link

@xezon xezon commented Aug 3, 2025

This change implements the fullviewport support for 'Control Bar Pro' Addons like GenTool did.

New command line argument is "-forcefullviewport"

GameData.ini setting is ViewportHeightScale=0..1

And file at "GenTool/fullviewport.dat" is read too for the Addon to control the behaviour.

TODO

  • Replicate in Generals

@xezon xezon added Enhancement Is new feature or request GUI For graphical user interface Major Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Aug 3, 2025
Copy link

@Mauller Mauller left a comment

Choose a reason for hiding this comment

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

Looks good overall, tweaks things in the places i expected them to get changed from my own experience adding support for the pro bar in my test builds.

@xezon
Copy link
Author

xezon commented Aug 3, 2025

Replicated in Generals with mini conflict

D:\Projects\TheSuperHackers\GeneralsGameCode>FOR /F "delims=" %b IN ('git merge-base --fork-point main') DO git diff %b  1>changes.patch

D:\Projects\TheSuperHackers\GeneralsGameCode>git diff 9c276512f491cccb9c07eb13ee76c14ff091b4b0  1>changes.patch

D:\Projects\TheSuperHackers\GeneralsGameCode>git apply -p2 --directory=Generals --reject --whitespace=fix changes.patch
changes.patch:136: trailing whitespace.

changes.patch:138: trailing whitespace.
        repopulateBuildTooltipLayout();
changes.patch:155: trailing whitespace.

Checking patch Generals/Code/GameEngine/Include/Common/GlobalData.h...
Hunk #1 succeeded at 91 (offset -2 lines).
Hunk #2 succeeded at 179 (offset -6 lines).
Checking patch Generals/Code/GameEngine/Include/GameClient/ControlBar.h...
Hunk #1 succeeded at 690 (offset -14 lines).
Checking patch Generals/Code/GameEngine/Source/Common/CommandLine.cpp...
Checking patch Generals/Code/GameEngine/Source/Common/GameEngine.cpp...
error: while searching for:

                DEBUG_ASSERTCRASH(TheWritableGlobalData,("TheWritableGlobalData expected to be created"));
                initSubsystem(TheWritableGlobalData, "TheWritableGlobalData", TheWritableGlobalData, &xferCRC, "Data\\INI\\Default\\GameData.ini", "Data\\INI\\GameData.ini");


        #ifdef DUMP_PERF_STATS///////////////////////////////////////////////////////////////////////////

error: patch failed: Generals/Code/GameEngine/Source/Common/GameEngine.cpp:428
Checking patch Generals/Code/GameEngine/Source/Common/GlobalData.cpp...
Hunk #2 succeeded at 825 (offset -6 lines).
Hunk #3 succeeded at 1196 (offset -28 lines).
Checking patch Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp...
Hunk #1 succeeded at 3008 (offset -23 lines).
Hunk #2 succeeded at 3025 (offset -23 lines).
Hunk #3 succeeded at 3041 (offset -23 lines).
Hunk #4 succeeded at 3506 (offset -264 lines).
Checking patch Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp...
Hunk #1 succeeded at 501 (offset 1 line).
Hunk #2 succeeded at 514 (offset 1 line).
Hunk #3 succeeded at 536 (offset 1 line).
Hunk #4 succeeded at 549 (offset 1 line).
Hunk #5 succeeded at 574 (offset 1 line).
Hunk #6 succeeded at 589 (offset 1 line).
Hunk #7 succeeded at 604 (offset 1 line).
Checking patch Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp...
Hunk #1 succeeded at 1166 (offset -30 lines).
Applied patch Generals/Code/GameEngine/Include/Common/GlobalData.h cleanly.
Applied patch Generals/Code/GameEngine/Include/GameClient/ControlBar.h cleanly.
Applied patch Generals/Code/GameEngine/Source/Common/CommandLine.cpp cleanly.
Applying patch Generals/Code/GameEngine/Source/Common/GameEngine.cpp with 1 reject...
Rejected hunk #1.
Applied patch Generals/Code/GameEngine/Source/Common/GlobalData.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp cleanly.

{
{
// TheSuperHackers @feature xezon 03/08/2025 Force full viewport for 'Control Bar Pro' Addons like GenTool did it.
File* file = TheFileSystem->openFile("GenTool/fullviewport.dat", File::READ | File::BINARY);
Copy link

Choose a reason for hiding this comment

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

Does control bar pro put this file into a gentool folder?

Copy link
Author

Choose a reason for hiding this comment

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

Yes. It is inside one of the .big archives.

@xezon xezon merged commit 9f0a55e into TheSuperHackers:main Aug 3, 2025
15 checks passed
@xezon xezon deleted the xezon/implement-fullviewport branch August 3, 2025 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request Gen Relates to Generals GUI For graphical user interface Major Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement full viewport for Control Bar Pro support

2 participants