feat(screenshot): Add threaded JPEG/PNG screenshots without game stalls#1785
feat(screenshot): Add threaded JPEG/PNG screenshots without game stalls#1785bobtista wants to merge 37 commits into
Conversation
20a3df1 to
37bd840
Compare
|
Some initial thoughts:
|
|
Agree with Stubbjax. JPG 90 is big file. Better make it default 80. Replace BMP screenshot with PNG screenshot. PNG is lossless compressed and always better than BMP. Make F12 take JPG 80 screenshot. Make CTRL+F12 take PNG screenshot. Make JPG Quality adjustable. Remove the old BMP code(s) and only use the new code for screenshot. |
|
Regarding Github formatting: When you write
Then it will not close this report when this is merged. Please read up on it here: |
RE moving logic to core, I moved what I could to core - but there are a lot more files that need to be moved to core before this can be moved there eg WWVegas/WW3D2/* |
3535e1e to
efc773f
Compare
977a6dc to
f8162f3
Compare
d7e8a8d to
d197bdd
Compare
d197bdd to
9669966
Compare
|
Needs rebase. |
9669966 to
4897b0b
Compare
Done |
9c99306 to
de35e57
Compare
… MessageStream members
…a and MessageStream members
|
There are still comments left. |
…d handle the row pitch on the screenshot thread
xezon
left a comment
There was a problem hiding this comment.
Quite a bit of effort to unslopify the AI generation 🥲
|
|
||
| Int OptionPreferences::getJPEGQuality() const | ||
| { | ||
| OptionPreferences::const_iterator it = find("JPEGQuality"); |
There was a problem hiding this comment.
I can't find it written in Options Menu.
There was a problem hiding this comment.
Essentially I think it needs writing in Options Menu like our other new options. Otherwise the user has no default value written.
…fault constant, and simplify pitch handling
xezon
left a comment
There was a problem hiding this comment.
Looking solid. The bot has a complaint.
| virtual void preloadTextureAssets( AsciiString texture ) = 0; ///< preload texture asset | ||
|
|
||
| virtual void takeScreenShot() = 0; ///< saves screenshot to a file | ||
| virtual void takeScreenShot(ScreenshotFormat format, Int jpegQuality = 80) = 0; ///< saves screenshot in specified format |
There was a problem hiding this comment.
Maybe also use DEFAULT_JPEG_QUALITY here
|
|
||
| Int OptionPreferences::getJPEGQuality() const | ||
| { | ||
| OptionPreferences::const_iterator it = find("JPEGQuality"); |
There was a problem hiding this comment.
Essentially I think it needs writing in Options Menu like our other new options. Otherwise the user has no default value written.
|
|
||
| surfaceCopy->Unlock(); | ||
| surfaceCopy->Release_Ref(); | ||
| surfaceCopy = nullptr; |
There was a problem hiding this comment.
Minor: Maybe move this block below strlcpy(threadData->leafname ... so that all writes to threadData sit tightly together.
…ons save, and reuse the default quality constant
Summary
Replaces the old BMP screenshot with compressed JPEG screenshots that don't stall the game, and adds PNG support.
Closes #1555
Closes #106 ... sort of
Adds a new screenshot function using the stb_image_write library with background threading:
Notes
Testing