- fixed blinking frame after saving a game

Viewport was not reseted after creation of saved game thumbnail, so one junk frame was rendered right after saving a game

https://forum.zdoom.org/viewtopic.php?t=60412
This commit is contained in:
alexey.lysiuk 2018-05-29 12:07:45 +03:00
parent 0187b0aa5b
commit a0695cbb48
1 changed files with 2 additions and 0 deletions

View File

@ -739,6 +739,8 @@ void GLSceneDrawer::WriteSavePic (player_t *player, FileWriter *file, int width,
GLRenderer->CopyToBackbuffer(&bounds, false);
glFlush();
screen->SetOutputViewport(nullptr);
uint8_t * scr = (uint8_t *)M_Malloc(width * height * 3);
glReadPixels(0,0,width, height,GL_RGB,GL_UNSIGNED_BYTE,scr);
M_CreatePNG (file, scr + ((height-1) * width * 3), NULL, SS_RGB, width, height, -width * 3, Gamma);