forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 67
[ZH] Implement Headless Mode #651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
helmutbuhler
wants to merge
51
commits into
TheSuperHackers:main
Choose a base branch
from
helmutbuhler:headless_sh
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
e4b6f18
Make CRC-related commandline arguments work when compiling Release wi…
helmutbuhler fb4881f
Add comments to Xfer.h
helmutbuhler 10991d6
Add some comments to crc command line arguments
helmutbuhler 320cd7c
Resest Frame Counter earlier in GameLogic::prepareNewGame instead of …
helmutbuhler 2e0a25c
Improved CRC Debugging: Optionally save crc data into a file per fram…
helmutbuhler adfd721
Improved logging for mismatch debugging.
helmutbuhler ba13902
Make condition for checking TheCRCFirstFrameToLog consistent.
helmutbuhler 1b2f5a8
Add comment regarding g_keepCRCSaves
helmutbuhler fb5d977
Remove transform crclogging in Object::crc. This was likely copypaste…
helmutbuhler 46a4ab4
Delete CRC Frame files properly
helmutbuhler 9f7287e
Improve comments
helmutbuhler 4a22c73
Reset framecounter and call CRCDebugStartNewGame in GameLogic::startN…
helmutbuhler e536826
Fix TEAM_ID_INVALID
helmutbuhler 21b4851
Some code cleanup in CRCDebug
helmutbuhler 88a5b8e
Merge branch 'hb_sh' into improve_crc_logging_ea
helmutbuhler 2be0870
Add define NORMAL_LOG_IN_CRC_LOG to control normal logging in crc logs.
helmutbuhler 3813f09
Add cmake options to control logging
helmutbuhler 83e7ec1
Add m_headless global flag to optionally run the game in headless mode.
helmutbuhler 16aa073
Add some comments where logic-client-separation is broken.
helmutbuhler 4229f1d
Add some more checks for headless
helmutbuhler c7c8b1d
Add comment about logic-client architecture and headless mode
helmutbuhler f69e41f
Add -headless commandline option
helmutbuhler 7498de0
Fix headless when shutting down the engine.
helmutbuhler bf0a2e5
Rename RadarHeadless to RadarDummy
helmutbuhler 7df3c68
Simplify RadarDummy
helmutbuhler 8d325d9
Change TheWindowManager Check in ControlBar::getStarImage
helmutbuhler 741a9a3
Merge branch 'main' into improve_crc_logging_ea
helmutbuhler bb744e7
Readd logging configuration to cmake files
helmutbuhler bf19c8c
Merge branch 'improve_crc_logging_ea' into headless_sh
helmutbuhler dd16528
Merge branch 'main' of https://github.com/TheSuperHackers/GeneralsGam…
helmutbuhler adfbe8b
Remove config-logging.cmake
helmutbuhler 6fdf9ed
Fix wrong cmake feature names
helmutbuhler c26a4fa
Add RTS_DEBUG_INCLUDE_DEBUG_LOG_IN_CRC_LOG option (again)
helmutbuhler 4917362
Fix comments
helmutbuhler 40a9407
Merge branch 'improve_crc_logging_ea' into headless_sh
helmutbuhler 5fba809
Merge branch 'main' of https://github.com/TheSuperHackers/GeneralsGam…
helmutbuhler 73adde5
Merge branch 'main' of https://github.com/TheSuperHackers/GeneralsGam…
helmutbuhler e50eec4
Add null checks for W3DDisplay::m_3DScene
helmutbuhler 232da78
Merge branch 'main' into headless_sh
helmutbuhler 016187a
Merge branch 'main' into headless_sh
helmutbuhler d6c8339
Move m_headless check for W3DView to GameClient
helmutbuhler c26971e
Some minor code moving around
helmutbuhler 8eb9730
Add missing headless check for Sizzle Video
helmutbuhler 5951bc8
Add missing headless checks for m_bibBuffer in BaseHeightMapRenderObj…
helmutbuhler 39ae00c
Add DummyGameWindowManager to avoid null checks
helmutbuhler 8759b91
Remove TheWindowManager NULL checks
helmutbuhler cf8963d
Remove more TheWindowManager NULL checks
helmutbuhler d371c76
Fix stupid dates in comments
helmutbuhler 9513645
Remove one more TheWindowManager NULL check
helmutbuhler 1cf0c69
Fix some white space stuff
helmutbuhler d8bcd57
Add comments for DummyGameWindowManager
helmutbuhler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -380,6 +380,49 @@ extern WindowMsgHandledType PassMessagesToParentSystem( GameWindow *window, | |
WindowMsgData mData2 ); | ||
|
||
|
||
// TheSuperHackers @feature helmutbuhler 24/04/2025 | ||
// GameWindow that does nothing. Used for Headless Mode. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest to move these dummies into new header + source files because they are a bit on the larger side. |
||
class DummyGameWindow : public GameWindow | ||
{ | ||
MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE(DummyGameWindow, "DummyGameWindow") | ||
public: | ||
//virtual ~DummyGameWindow(); | ||
virtual void winDrawBorder() { } | ||
}; | ||
|
||
// TheSuperHackers @feature helmutbuhler 24/04/2025 | ||
// GameWindowManager that does nothing. Used for Headless Mode. | ||
class DummyGameWindowManager : public GameWindowManager | ||
{ | ||
public: | ||
virtual GameWindow *winGetWindowFromId(GameWindow *window, Int id); | ||
virtual GameWindow *winCreateFromScript(AsciiString filenameString, WindowLayoutInfo *info); | ||
|
||
virtual GameWindow *allocateNewWindow() { return newInstance(DummyGameWindow); } | ||
|
||
virtual GameWinDrawFunc getPushButtonImageDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getPushButtonDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getCheckBoxImageDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getCheckBoxDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getRadioButtonImageDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getRadioButtonDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getTabControlImageDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getTabControlDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getListBoxImageDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getListBoxDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getComboBoxImageDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getComboBoxDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getHorizontalSliderImageDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getHorizontalSliderDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getVerticalSliderImageDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getVerticalSliderDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getProgressBarImageDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getProgressBarDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getStaticTextImageDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getStaticTextDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getTextEntryImageDrawFunc() { return NULL; } | ||
virtual GameWinDrawFunc getTextEntryDrawFunc() { return NULL; } | ||
}; | ||
|
||
#endif // __GAMEWINDOWMANAGER_H_ | ||
|
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RadarDummy
,DummyGameWindow
,DummyGameWindowManager
are not consistently named.I suggest to put "Dummy" at the end so that it groups properly with the normal class.
Alternatively can also use "Null" instead of "Dummy". Either name is fine.