From 9e650a95403034c413775e3d020afa9aa268bed9 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 9 Jun 2012 10:29:50 +0200 Subject: [PATCH] Add some clarifying comments on screenshots. --- retroarch.c | 3 +++ screenshot.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/retroarch.c b/retroarch.c index 26a2432667..964c566a52 100644 --- a/retroarch.c +++ b/retroarch.c @@ -109,6 +109,7 @@ static bool take_screenshot_viewport(void) return false; } + // Data read from viewport is in bottom-up order, suitable for BMP. if (!screenshot_dump(g_settings.screenshot_directory, buffer, width, height, width * 3, true)) @@ -127,6 +128,8 @@ static bool take_screenshot_raw(void) unsigned height = g_extern.frame_cache.height; int pitch = g_extern.frame_cache.pitch; + // Negative pitch is needed as screenshot takes bottom-up, + // but we use top-down. return screenshot_dump(g_settings.screenshot_directory, data + (height - 1) * (pitch >> 1), width, height, -pitch, false); diff --git a/screenshot.c b/screenshot.c index f7add52c6e..5be6b7d8df 100644 --- a/screenshot.c +++ b/screenshot.c @@ -85,7 +85,7 @@ static void dump_content(FILE *file, const void *frame, if (!line) return; - if (bgr24) + if (bgr24) // BGR24 byte order. Can directly copy. { for (int j = 0; j < height; j++, frame_bgr += pitch) {