diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-04-29 12:32:50 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-04-29 12:32:50 -0700 |
commit | 7628cbbe645079989d2e25fb2e47c8a41f8bcb7c (patch) | |
tree | f363d60c106c0f6d0438874b5cc480872379d067 | |
parent | 4eafbde6d2134edfbe1b23bb96b3a76c1f34a7a3 (diff) |
Make internal screenshot functionality completely ignore overscan settings rather than only doing it for the height
-rwxr-xr-x | render_sdl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/render_sdl.c b/render_sdl.c index f00c3f5..e50030b 100755 --- a/render_sdl.c +++ b/render_sdl.c @@ -564,9 +564,8 @@ void render_framebuffer_updated(uint8_t which, int width) 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 @@ void render_framebuffer_updated(uint8_t which, int width) 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 @@ void render_framebuffer_updated(uint8_t which, int width) 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 @@ void render_framebuffer_updated(uint8_t which, int width) } 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 = { |