Provided by mynick1 on IRC. Applies to 0.7, not checked for merge conflicts. Author comments follow.
Patch description for screen:
- Added (threaded) asynchronous screenshots.
- Fixed a module by 1 check
NOTE: You need to apply my threads patch to get this working.
The easiest way to test this code is this one: .Join a server (such as the Xonotic SMB Duel Paris server) .Go in front of a rotating weapon .Set the cvar scr_screenshot_async to 0 .Press F12 to create a screenshot .Now, set the cvar scr_screenshot_async to 1 .Press F12 to create a screenshot
You shall notice that the rotating weapon feezed for much less time in the second case, as the time to spawn a thread is likely less than the required time to encode the whole screenshot image. Everything is based on your screen resolution and your CPU. The higher is your resolution and the slower is your CPU, the biggest will be the advantage about keeping asynchronous screenshots enabled. All the more if your slow CPU is a piece of a multiprocessor or multicore system.