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
31
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
31 commits
Select commit
Hold shift + click to select a range
7a3c3f7
build(screenshot): Add stb_image_write library via FetchContent
bobtista 50c3e27
feat(screenshot): Add threaded JPEG/PNG screenshots without game stalls
bobtista fc332dc
tweak(screenshot): Name files by timestamp so JPG and PNG sort together
bobtista 7a736c4
tweak(screenshot): Replicate to Generals
bobtista 31dbce9
fix(stb): Create stb target on both vcpkg and FetchContent paths
bobtista 1ae734e
fix(screenshot): Use engine logging and match codebase style
bobtista c9f43be
fix(screenshot): Replicate to Generals
bobtista 14cc69d
build(stb): use TheSuperHackers comment keyword format
bobtista 0144f86
style(screenshot): drop unused leafname from thread data
bobtista a6837a0
style(screenshot): Replicate to Generals
bobtista a1d44bb
chore(screenshot): Remove unused W3DScreenshot.h include from W3DDisplay
bobtista 1b1d930
unify(screenshot): Move W3DScreenshot to Core
bobtista 9ce4a5f
fix(screenshot): Convert 16 bit back buffers to 24 bit color
bobtista 24bf262
refactor(screenshot): Pass JPEG quality from the message handler
bobtista 9270f65
feat(screenshot): Save screenshots into a Screenshots subfolder
bobtista 120921d
refactor(screenshot): Release image buffer in thread data destructor …
bobtista 0e3dabe
tweak(screenshot): Look up file extension from format array with comp…
bobtista bbb154e
tweak(screenshot): Cap JPEG quality at 95 and make getter const
bobtista 7b46fad
style(screenshot): Remove key mappings from message comments and upda…
bobtista 30256c8
style(screenshot): Remove TheSuperHackers comment prefix from stb.cmake
bobtista dee0bbb
chore(screenshot): Remove unify script entry for the new stb_image_wr…
bobtista dd3aa65
refactor(screenshot): Move pixel conversion and file operations to th…
bobtista 47f029b
style(screenshot): Add TheSuperHackers comments to new GlobalData and…
bobtista f54185d
refactor(screenshot): Assemble the screenshot directory path on the s…
bobtista 6ffc6df
style(screenshot): Simplify TheSuperHackers comments on new GlobalDat…
bobtista d8e7629
style(screenshot): Fix comment keyword and wording per review
bobtista e37d216
refactor(screenshot): Use endian-safe shifts for 32 bit pixel convers…
bobtista 7ebe951
style(screenshot): Change quality cap comment keyword to @info
bobtista 453ca4c
style(screenshot): Remove redundant masks and add rgb comments to the…
bobtista 0503cc9
fix(screenshot): Show the screenshot success message after the file i…
bobtista 9a52419
build(screenshot): Add InterlockedExchangePointer adapter for VC6
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.
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.
It still offers quality 1. What is the use case for this low quality level?