forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 221
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
44
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
44 commits
Select commit
Hold shift + click to select a range
e0db51d
build(screenshot): Add stb_image_write library via FetchContent
bobtista f1782d6
feat(screenshot): Add threaded JPEG/PNG screenshots without game stalls
bobtista 91bf304
tweak(screenshot): Name files by timestamp so JPG and PNG sort together
bobtista e52a56a
tweak(screenshot): Replicate to Generals
bobtista 85c444c
fix(stb): Create stb target on both vcpkg and FetchContent paths
bobtista 664423c
fix(screenshot): Use engine logging and match codebase style
bobtista 3758a6a
fix(screenshot): Replicate to Generals
bobtista 0795b4c
build(stb): use TheSuperHackers comment keyword format
bobtista 8c98e1a
style(screenshot): drop unused leafname from thread data
bobtista 71fa6bf
style(screenshot): Replicate to Generals
bobtista 523539a
chore(screenshot): Remove unused W3DScreenshot.h include from W3DDisplay
bobtista eb83054
unify(screenshot): Move W3DScreenshot to Core
bobtista e88e1c1
fix(screenshot): Convert 16 bit back buffers to 24 bit color
bobtista 33a56c2
refactor(screenshot): Pass JPEG quality from the message handler
bobtista 0e80a1e
feat(screenshot): Save screenshots into a Screenshots subfolder
bobtista 945f8eb
refactor(screenshot): Release image buffer in thread data destructor …
bobtista 65f76b8
tweak(screenshot): Look up file extension from format array with comp…
bobtista 4f5fbab
tweak(screenshot): Cap JPEG quality at 95 and make getter const
bobtista 9dd681d
style(screenshot): Remove key mappings from message comments and upda…
bobtista 5a1ec31
style(screenshot): Remove TheSuperHackers comment prefix from stb.cmake
bobtista 1ab8407
chore(screenshot): Remove unify script entry for the new stb_image_wr…
bobtista d87f330
refactor(screenshot): Move pixel conversion and file operations to th…
bobtista 1e2f18a
style(screenshot): Add TheSuperHackers comments to new GlobalData and…
bobtista 31d62c2
refactor(screenshot): Assemble the screenshot directory path on the s…
bobtista de34b0c
style(screenshot): Simplify TheSuperHackers comments on new GlobalDat…
bobtista 6003f09
style(screenshot): Fix comment keyword and wording per review
bobtista c6bf6d5
refactor(screenshot): Use endian-safe shifts for 32 bit pixel convers…
bobtista daad627
style(screenshot): Change quality cap comment keyword to @info
bobtista e18bb8e
style(screenshot): Remove redundant masks and add rgb comments to the…
bobtista e2a3a49
fix(screenshot): Show the screenshot success message after the file i…
bobtista 4254bb5
build(screenshot): Add InterlockedExchangePointer adapter for VC6
bobtista be3544e
tweak(screenshot): Clamp the JPEG quality to 80-95
bobtista 36ffab7
build(screenshot): Find Stb in module mode so the vcpkg provided pack…
bobtista 2800443
refactor(screenshot): Copy the locked surface with a single memcpy an…
bobtista afc6ede
tweak(screenshot): Lower the JPEG quality clamp to 50-95
bobtista 66f452b
refactor(screenshot): Rename quality key to JpegQuality, share the de…
bobtista e149419
fix(screenshot): Queue completion messages, write JpegQuality on opti…
bobtista d7837cb
refactor(screenshot): Extract the written-message list into a reusabl…
bobtista 24438fa
refactor(screenshot): Use CPP_11 delete, reinterpret_cast, const and …
bobtista 3351bc3
refactor(screenshot): Pass null thread id to CreateThread
bobtista ef58f33
fix(utility): Remove volatile with const_cast before reinterpret_cast…
bobtista 69fd22c
build(screenshot): Fetch stb from the TheSuperHackers mirror
bobtista 9644d5a
refactor(screenshot): Use constexpr const for screenshot constants
bobtista 8f5e3d7
refactor(screenshot): Move MPSCIntrusiveQueue into WWLib
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
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
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
28 changes: 28 additions & 0 deletions
28
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,28 @@ | ||
| /* | ||
| ** Command & Conquer Generals Zero Hour(tm) | ||
|
bobtista marked this conversation as resolved.
bobtista marked this conversation as 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 jpegQuality); | ||
|
|
||
| // Called once per frame on the main thread to show messages for screenshots | ||
| // that the screenshot thread has finished writing. | ||
| void W3D_UpdateScreenshotMessages(); | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.