ref: 901ee2fe7588fd9dbe62f40b187bcaf364c0fce1
parent: d534cb633ed25d555e406221ed487892c807b34a
author: Fabian Greffrath <fabian@greffrath.com>
date: Thu May 5 10:53:03 EDT 2016
consider aspect_ratio_correct when saving PNG screenshot
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1222,17 +1222,24 @@
void I_SavePNGScreenshot (char *filename)
{
- const int width = 1600, height = 1200;
- SDL_Surface *shotbuffer;
+ if (aspect_ratio_correct)
+ {
+ const int width = 1600, height = 1200;
+ SDL_Surface *shotbuffer;
- shotbuffer = SDL_CreateRGBSurface(0, width, height, 32,
- 0x00ff0000,
- 0x0000ff00,
- 0x000000ff,
- 0xff000000);
+ shotbuffer = SDL_CreateRGBSurface(0, width, height, 32,
+ 0x00ff0000,
+ 0x0000ff00,
+ 0x000000ff,
+ 0xff000000);
- SDL_BlitScaled(rgbabuffer, NULL, shotbuffer, NULL);
- IMG_SavePNG(shotbuffer, filename);
+ SDL_BlitScaled(rgbabuffer, NULL, shotbuffer, NULL);
+ IMG_SavePNG(shotbuffer, filename);
- SDL_FreeSurface(shotbuffer);
+ SDL_FreeSurface(shotbuffer);
+ }
+ else
+ {
+ IMG_SavePNG(rgbabuffer, filename);
+ }
}