Change: Lock the video buffer when drawing inside the game loop to properly account for threaded drawing.

This commit is contained in:
Michael Lutz
2021-01-16 16:43:11 +01:00
parent 73ed748deb
commit d6b6775888
4 changed files with 75 additions and 50 deletions

View File

@@ -25,6 +25,7 @@
#include "window_func.h"
#include "tile_map.h"
#include "landscape.h"
#include "video/video_driver.hpp"
#include "table/strings.h"
@@ -881,6 +882,8 @@ void MakeScreenshotWithConfirm(ScreenshotType t)
*/
bool MakeScreenshot(ScreenshotType t, const char *name)
{
VideoDriver::VideoBufferLocker lock;
if (t == SC_VIEWPORT) {
/* First draw the dirty parts of the screen and only then change the name
* of the screenshot. This way the screenshot will always show the name