bradharding / doomretro

The classic, refined DOOM source port. For Windows PC.
https://www.doomretro.com
GNU General Public License v3.0
698 stars 88 forks source link

[Discussion] Remove the White Screenshot Flash #750

Open RolandMarchand opened 2 years ago

RolandMarchand commented 2 years ago

Hello Brad,
I was working on hiding game messages during screenshots, but another issue is annoying me even more. When taking screenshots in quick succession (as one would in a heated game), a white flash residue would ruin it.

I tried to clear fadescreen and to redraw the screen at each screenshot and it kind of worked. Even if the white residue was less noticeable, the screenshots were still ruined, in my opinion.

Surprisingly, redrawing the screen multiple times before a screenshot does solve the issue, but it relies on the speed of the client's hardware and thus makes it unreliable, and it makes taking screenshots unacceptably slow (because redrawing the screen and running SDL_RenderReadPixels are resource intensive). This is not a good solution.

I also looked into how SDL captured the screen, and I couldn't find a way to only read the data from screens. It needs to be the entire screen.
I think it'd be a worthwhile sacrifice to remove the white flash in order to fix this issue. While keeping the sound effect, I don't think that the feedback would suffer. Gnome 40, the Linux desktop environment removed the white flash from their screenshot tool, and the community didn't mind.
What do you think? Should we remove the white flash, is there a way to solve this issue that I am not seeing?
Cheers, Roland

bradharding commented 2 years ago

Hi Roland,

Thanks for looking into this. As minor a feature as it is, I'd personally prefer to keep the flash (as it accompanies the shutter sfx). I'll have a look further into it myself over the coming days to see what can be done.

RolandMarchand commented 2 years ago

Here is an idea. When the player takes a screenshot, V_ScreenShot() is called, a is_taking_screenshot flag is set to ture and the game loop will be stuck in a loop until the screenshot file is found. Then is_taking_screenshot will become false, and the game will run as normal. That way, we can guarantee that SDL will have all the time needed to capture the screen's image.
The issue with this solution is that we would mess with an important part of the engine for a trivial reason, and it will freeze the game temporarily, which isn't pleasant for the user.