feat(headless): Implement ViewDummy#2246
Merged
xezon merged 10 commits intoTheSuperHackers:mainfrom Mar 19, 2026
Merged
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Include/GameClient/View.h | Adds ViewDummy class to serve as a headless no-op view. Has outstanding compile errors: isDoingScriptedCamera() and stopDoingScriptedCamera() are marked override but neither method exists in the View base class. |
| Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp | Refactors tactical view creation to always allocate TheTacticalView (via createView), then conditionally init/attach only when TheDisplay exists. setDefaultView moved inside the display guard. TheGlobalData is already assumed non-null throughout this function. |
| GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp | Mirror of Generals InGameUI.cpp changes — same refactoring for tactical view creation in Zero Hour. No distinct issues beyond those in the Generals copy. |
| Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.h | createView() factory refactored to accept a bool dummy parameter and dispatch to ViewDummy or W3DView accordingly. TheGlobalData access correctly moved to the caller (InGameUI::init). |
| GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.h | Identical change to the Generals W3DInGameUI.h — same dummy-dispatch factory pattern, same assessment. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["InGameUI::init()"] --> B["createView(TheGlobalData->m_headless)"]
B --> C{dummy == true?}
C -- Yes --> D["new ViewDummy\n(no-op headless view)"]
C -- No --> E["new W3DView\n(full rendering view)"]
D --> F["TheTacticalView = view"]
E --> F
F --> G{TheTacticalView &&\nTheDisplay?}
G -- No --> H["Skip display init\n(headless path)"]
G -- Yes --> I["TheTacticalView->init()"]
I --> J["TheDisplay->attachView(TheTacticalView)"]
J --> K["setWidth / setHeight"]
K --> L["setDefaultView(0,0,1)"]
Last reviewed commit: "refactor(headless): ..."
Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.h
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.h
Show resolved
Hide resolved
e30fa7a to
e241df5
Compare
e241df5 to
e439eee
Compare
Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.h
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.h
Outdated
Show resolved
Hide resolved
xezon
reviewed
Mar 10, 2026
Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DInGameUI.h
Outdated
Show resolved
Hide resolved
|
has left over comments |
…ol arg in GeneralsMD ViewDummy
… GlobalData include
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.
Summary
Related
Split from #2139 per @xezon's suggestion to review each dummy class separately.