mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 16:20:27 +00:00
Cleanups
This commit is contained in:
parent
48347053cd
commit
6b3c3f326a
@ -29,15 +29,18 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{
|
||||
RBMP_SOURCE_TYPE_BGR24,
|
||||
RBMP_SOURCE_TYPE_XRGB888,
|
||||
RBMP_SOURCE_TYPE_RGB565,
|
||||
RBMP_SOURCE_TYPE_ARGB8888,
|
||||
typedef enum
|
||||
{
|
||||
RBMP_SOURCE_TYPE_DONT_CARE,
|
||||
RBMP_SOURCE_TYPE_BGR24,
|
||||
RBMP_SOURCE_TYPE_XRGB888,
|
||||
RBMP_SOURCE_TYPE_RGB565,
|
||||
RBMP_SOURCE_TYPE_ARGB8888
|
||||
} rbmp_source_type;
|
||||
|
||||
bool rbmp_save_image(const char *filename, const void *frame,
|
||||
bool rbmp_save_image(
|
||||
const char *filename,
|
||||
const void *frame,
|
||||
unsigned width, unsigned height,
|
||||
unsigned pitch, rbmp_source_type type);
|
||||
|
||||
|
24
screenshot.c
24
screenshot.c
@ -115,12 +115,28 @@ static bool screenshot_dump(const char *folder, const void *frame,
|
||||
scaler_ctx_gen_reset(&scaler);
|
||||
|
||||
RARCH_LOG("Using RPNG for PNG screenshots.\n");
|
||||
ret = rpng_save_image_bgr24(filename,
|
||||
out_buffer, width, height, width * 3);
|
||||
ret = rpng_save_image_bgr24(
|
||||
filename,
|
||||
out_buffer,
|
||||
width,
|
||||
height,
|
||||
width * 3
|
||||
);
|
||||
free(out_buffer);
|
||||
#else
|
||||
ret = rbmp_save_image(filename, frame, width, height, pitch, bgr24,
|
||||
(video_driver_get_pixel_format() == RETRO_PIXEL_FORMAT_XRGB8888) );
|
||||
enum rbmp_source_type bmp_type = RBMP_SOURCE_TYPE_DONT_CARE;
|
||||
|
||||
if (bgr24)
|
||||
bmp_type = RBMP_SOURCE_TYPE_BGR24;
|
||||
else if (video_driver_get_pixel_format() == RETRO_PIXEL_FORMAT_XRGB8888)
|
||||
bmp_type = RBMP_SOURCE_TYPE_XRGB8888;
|
||||
|
||||
ret = rbmp_save_image(filename,
|
||||
frame,
|
||||
width,
|
||||
height,
|
||||
pitch,
|
||||
bmp_type);
|
||||
#endif
|
||||
if (!ret)
|
||||
RARCH_ERR("Failed to take screenshot.\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user