Fix screenshots

This commit is contained in:
Eric Wasylishen 2017-05-17 20:13:03 -06:00
parent 84dbdeb06d
commit a2d26ebcac

View file

@ -784,17 +784,17 @@ void SCR_ScreenShot_f (void)
}
//get data
if (!(buffer = (byte *) malloc(glwidth*glheight*3)))
if (!(buffer = (byte *) malloc(vid.unscaled_width*vid.unscaled_height*3)))
{
Con_Printf ("SCR_ScreenShot_f: Couldn't allocate memory\n");
return;
}
glPixelStorei (GL_PACK_ALIGNMENT, 1);/* for widths that aren't a multiple of 4 */
glReadPixels (glx, gly, glwidth, glheight, GL_RGB, GL_UNSIGNED_BYTE, buffer);
glReadPixels (0, 0, vid.unscaled_width, vid.unscaled_height, GL_RGB, GL_UNSIGNED_BYTE, buffer);
// now write the file
if (Image_WriteTGA (tganame, buffer, glwidth, glheight, 24, false))
if (Image_WriteTGA (tganame, buffer, vid.unscaled_width, vid.unscaled_height, 24, false))
Con_Printf ("Wrote %s\n", tganame);
else
Con_Printf ("SCR_ScreenShot_f: Couldn't create a TGA file\n");