consider aspect_ratio_correct when saving PNG screenshot
This commit is contained in:
parent
d534cb633e
commit
901ee2fe75
1 changed files with 17 additions and 10 deletions
|
|
@ -1222,17 +1222,24 @@ void I_BindVideoVariables(void)
|
||||||
|
|
||||||
void I_SavePNGScreenshot (char *filename)
|
void I_SavePNGScreenshot (char *filename)
|
||||||
{
|
{
|
||||||
const int width = 1600, height = 1200;
|
if (aspect_ratio_correct)
|
||||||
SDL_Surface *shotbuffer;
|
{
|
||||||
|
const int width = 1600, height = 1200;
|
||||||
|
SDL_Surface *shotbuffer;
|
||||||
|
|
||||||
shotbuffer = SDL_CreateRGBSurface(0, width, height, 32,
|
shotbuffer = SDL_CreateRGBSurface(0, width, height, 32,
|
||||||
0x00ff0000,
|
0x00ff0000,
|
||||||
0x0000ff00,
|
0x0000ff00,
|
||||||
0x000000ff,
|
0x000000ff,
|
||||||
0xff000000);
|
0xff000000);
|
||||||
|
|
||||||
SDL_BlitScaled(rgbabuffer, NULL, shotbuffer, NULL);
|
SDL_BlitScaled(rgbabuffer, NULL, shotbuffer, NULL);
|
||||||
IMG_SavePNG(shotbuffer, filename);
|
IMG_SavePNG(shotbuffer, filename);
|
||||||
|
|
||||||
SDL_FreeSurface(shotbuffer);
|
SDL_FreeSurface(shotbuffer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IMG_SavePNG(rgbabuffer, filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue