forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 167
feat(screenshot): Add threaded JPEG/PNG screenshots without game stalls #1785
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
bobtista
wants to merge
26
commits into
TheSuperHackers:main
Choose a base branch
from
bobtista:bobtista/compressed-screenshot-f11
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
26 commits
Select commit
Hold shift + click to select a range
1e7ee6a
Add stb library dependency via FetchContent
bobtista 3126d6f
Add MSG_META_TAKE_SCREENSHOT_COMPRESSED message and F11 keybinding
bobtista ab2d333
Implement threaded JPEG screenshot for GeneralsMD
bobtista 53fd0d5
Use Win32 CreateThread for VC6 compatibility and add GUIEditDisplay stub
bobtista 00ff872
Move screenshot logic to Core to eliminate code duplication
bobtista 734385f
Change F12 to JPEG and add CTRL+F12 for PNG screenshots
bobtista 285c3e4
Remove old BMP screenshot code
bobtista 8dac55f
Add JPEGQuality option to Options.ini (default 80)
bobtista 148b260
Remove trailing whitespace from empty lines
bobtista c509412
Fix copyright headers: Change Electronic Arts Inc. to TheSuperHackers
bobtista de4929c
Add file headers to W3DScreenshot.cpp files
bobtista 269af80
Rename MSG_META_TAKE_SCREENSHOT_JPEG to MSG_META_TAKE_SCREENSHOT_PNG
bobtista ef67a08
fix(screenshot): Fix W3DScreenshot.cpp references in CMakeLists after…
bobtista 82f858a
fix(screenshot): Add missing W3DScreenshot.h include for ScreenshotFo…
bobtista a888657
fix(screenshot): Use full include path for W3DScreenshot.h from Core
bobtista d1ed4f1
fix(screenshot): Remove W3DScreenshot.cpp from separate compilation s…
bobtista ea0abcc
refactor(screenshot): Consolidate stb_image_write_impl.cpp to Core
bobtista 7d700d7
docs(unify): Document stb_image_write_impl.cpp unification in script
bobtista a4de747
fix(screenshot): Restore DESTROY_MESSAGE, fix quality default, NULL t…
bobtista ce03627
fix(screenshot): Replicate screenshot fixes to Generals
bobtista e62f2c2
refactor(screenshot): Compile W3DScreenshot.cpp as separate translati…
bobtista 30b405d
refactor(screenshot): Replicate separate compilation fix to Generals
bobtista b50793c
fix(screenshot): Initialize m_jpegQuality in constructor and remove e…
bobtista c339280
fix(screenshot): Replicate m_jpegQuality init and CMake cleanup to Ge…
bobtista 20a9eb2
Only show screen capture message when screenshot thread is successful…
bobtista b709c32
Remove dead CreateBMPFile function replaced by compressed screenshot
bobtista 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
Some comments aren't visible on the classic Files Changed page.
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
24 changes: 24 additions & 0 deletions
24
Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DScreenshot.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* | ||
| ** Command & Conquer Generals Zero Hour(tm) | ||
bobtista marked this conversation as resolved.
Show resolved
Hide resolved
bobtista marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ** Copyright 2025 TheSuperHackers | ||
| ** | ||
| ** This program is free software: you can redistribute it and/or modify | ||
| ** it under the terms of the GNU General Public License as published by | ||
| ** the Free Software Foundation, either version 3 of the License, or | ||
| ** (at your option) any later version. | ||
| ** | ||
| ** This program is distributed in the hope that it will be useful, | ||
| ** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| ** GNU General Public License for more details. | ||
| ** | ||
| ** You should have received a copy of the GNU General Public License | ||
| ** along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "GameClient/Display.h" | ||
|
|
||
| void W3D_TakeCompressedScreenshot(ScreenshotFormat format, int quality = 0); | ||
|
|
||
21 changes: 21 additions & 0 deletions
21
Core/GameEngineDevice/Source/W3DDevice/GameClient/stb_image_write_impl.cpp
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 |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /* | ||
| ** Command & Conquer Generals(tm) | ||
| ** Copyright 2025 TheSuperHackers | ||
| ** | ||
| ** This program is free software: you can redistribute it and/or modify | ||
| ** it under the terms of the GNU General Public License as published by | ||
| ** the Free Software Foundation, either version 3 of the License, or | ||
| ** (at your option) any later version. | ||
| ** | ||
| ** This program is distributed in the hope that it will be useful, | ||
| ** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| ** GNU General Public License for more details. | ||
| ** | ||
| ** You should have received a copy of the GNU General Public License | ||
| ** along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| #define STB_IMAGE_WRITE_IMPLEMENTATION | ||
| #include <stb_image_write.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
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.
clamp