# HG changeset patch # User Michael Pavone # Date 1493494370 25200 # Node ID baaf05fd64c4330105ec4bf69cea4c710a38d788 # Parent 26e72126f9d18b42d1533959346c7b86399201ff Make internal screenshot functionality completely ignore overscan settings rather than only doing it for the height diff -r 26e72126f9d1 -r baaf05fd64c4 render_sdl.c --- a/render_sdl.c Thu Apr 27 23:08:49 2017 -0700 +++ b/render_sdl.c Sat Apr 29 12:32:50 2017 -0700 @@ -564,9 +564,8 @@ uint32_t height = which <= FRAMEBUFFER_EVEN ? (video_standard == VID_NTSC ? 243 : 294) - (overscan_top[video_standard] + overscan_bot[video_standard]) : 240; - width -= overscan_left[video_standard] + overscan_right[video_standard]; FILE *screenshot_file = NULL; - uint32_t shot_height; + uint32_t shot_height, shot_width; if (screenshot_path && which == FRAMEBUFFER_ODD) { screenshot_file = fopen(screenshot_path, "wb"); if (screenshot_file) { @@ -577,7 +576,9 @@ free(screenshot_path); screenshot_path = NULL; shot_height = video_standard == VID_NTSC ? 243 : 294; + shot_width = width; } + width -= overscan_left[video_standard] + overscan_right[video_standard]; #ifndef DISABLE_OPENGL if (render_gl && which <= FRAMEBUFFER_EVEN) { glBindTexture(GL_TEXTURE_2D, textures[which]); @@ -611,7 +612,7 @@ if (screenshot_file) { //properly supporting interlaced modes here is non-trivial, so only save the odd field for now - save_ppm(screenshot_file, texture_buf, width, shot_height, LINEBUF_SIZE*sizeof(uint32_t)); + save_ppm(screenshot_file, texture_buf, shot_width, shot_height, LINEBUF_SIZE*sizeof(uint32_t)); } } else { #endif @@ -638,7 +639,7 @@ } else { shot_pitch *= 2; } - save_ppm(screenshot_file, locked_pixels, width, shot_height, shot_pitch); + save_ppm(screenshot_file, locked_pixels, shot_width, shot_height, shot_pitch); } SDL_UnlockTexture(sdl_textures[which]); SDL_Rect src_clip = {