mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
move scaler object out of screenshot_task_state
This commit is contained in:
parent
efe34f52af
commit
0e9b2179af
@ -61,7 +61,6 @@ typedef struct screenshot_task_state screenshot_task_state_t;
|
||||
|
||||
struct screenshot_task_state
|
||||
{
|
||||
struct scaler_ctx scaler;
|
||||
uint8_t *out_buffer;
|
||||
const void *frame;
|
||||
void *userbuf;
|
||||
@ -84,26 +83,26 @@ struct screenshot_task_state
|
||||
|
||||
static bool screenshot_dump_direct(screenshot_task_state_t *state)
|
||||
{
|
||||
struct scaler_ctx *scaler = (struct scaler_ctx*)&state->scaler;
|
||||
struct scaler_ctx scaler;
|
||||
bool ret = false;
|
||||
|
||||
#if defined(HAVE_RPNG)
|
||||
if (state->bgr24)
|
||||
scaler->in_fmt = SCALER_FMT_BGR24;
|
||||
scaler.in_fmt = SCALER_FMT_BGR24;
|
||||
else if (state->pixel_format_type == RETRO_PIXEL_FORMAT_XRGB8888)
|
||||
scaler->in_fmt = SCALER_FMT_ARGB8888;
|
||||
scaler.in_fmt = SCALER_FMT_ARGB8888;
|
||||
else
|
||||
scaler->in_fmt = SCALER_FMT_RGB565;
|
||||
scaler.in_fmt = SCALER_FMT_RGB565;
|
||||
|
||||
video_frame_convert_to_bgr24(
|
||||
scaler,
|
||||
&scaler,
|
||||
state->out_buffer,
|
||||
(const uint8_t*)state->frame + ((int)state->height - 1)
|
||||
* state->pitch,
|
||||
state->width, state->height,
|
||||
-state->pitch);
|
||||
|
||||
scaler_ctx_gen_reset(&state->scaler);
|
||||
scaler_ctx_gen_reset(&scaler);
|
||||
|
||||
ret = rpng_save_image_bgr24(
|
||||
state->filename,
|
||||
|
Loading…
Reference in New Issue
Block a user