diff --git a/gfx/drivers/ctr_gfx.c b/gfx/drivers/ctr_gfx.c index 4b06abac48..cef787325d 100644 --- a/gfx/drivers/ctr_gfx.c +++ b/gfx/drivers/ctr_gfx.c @@ -122,7 +122,7 @@ static INLINE void ctr_set_screen_coords(ctr_video_t * ctr) } -static void ctr_update_viewport(ctr_video_t* ctr) +static void ctr_update_viewport(ctr_video_t* ctr, video_frame_info_t *video_info) { int x = 0; int y = 0; @@ -144,15 +144,10 @@ static void ctr_update_viewport(ctr_video_t* ctr) #if defined(HAVE_MENU) if (settings->uints.video_aspect_ratio_idx == ASPECT_RATIO_CUSTOM) { - struct video_viewport *custom = video_viewport_get_custom(); - - if (custom) - { - x = custom->x; - y = custom->y; - width = custom->width; - height = custom->height; - } + x = video_info->custom_vp_x; + y = video_info->custom_vp_y; + width = video_info->custom_vp_width; + height = video_info->custom_vp_height; } else #endif @@ -611,7 +606,7 @@ static bool ctr_frame(void* data, const void* frame, fflush(stdout); if (ctr->should_resize) - ctr_update_viewport(ctr); + ctr_update_viewport(ctr, video_info); ctrGuSetMemoryFill(true, (u32*)ctr->drawbuffers.top.left, 0x00000000, (u32*)ctr->drawbuffers.top.left + 2 * CTR_TOP_FRAMEBUFFER_WIDTH * CTR_TOP_FRAMEBUFFER_HEIGHT, diff --git a/gfx/drivers/psp1_gfx.c b/gfx/drivers/psp1_gfx.c index 2731bcdcb4..148942dd5f 100644 --- a/gfx/drivers/psp1_gfx.c +++ b/gfx/drivers/psp1_gfx.c @@ -713,19 +713,13 @@ static void psp_update_viewport(psp1_video_t* psp, } else if (psp->keep_aspect) { - #if defined(HAVE_MENU) if (settings->uints.video_aspect_ratio_idx == ASPECT_RATIO_CUSTOM) { - struct video_viewport *custom = video_viewport_get_custom(); - - if (custom) - { - x = custom->x; - y = custom->y; - width = custom->width; - height = custom->height; - } + x = video_info->custom_vp_x; + y = video_info->custom_vp_y; + width = video_info->custom_vp_width; + height = video_info->custom_vp_height; } else #endif diff --git a/gfx/drivers/vita2d_gfx.c b/gfx/drivers/vita2d_gfx.c index b3ba9565c5..6379cc688a 100644 --- a/gfx/drivers/vita2d_gfx.c +++ b/gfx/drivers/vita2d_gfx.c @@ -41,7 +41,6 @@ extern void *memcpy_neon(void *dst, const void *src, size_t n); - static void vita2d_gfx_set_viewport(void *data, unsigned viewport_width, unsigned viewport_height, bool force_full, bool allow_rotate); @@ -186,7 +185,7 @@ static bool vita2d_gfx_frame(void *data, const void *frame, } if (vita->should_resize) - vita2d_gfx_update_viewport(vita); + vita2d_gfx_update_viewport(vita, video_info); vita2d_start_drawing(); @@ -345,7 +344,8 @@ static void vita2d_set_projection(vita_video_t *vita, matrix_4x4_multiply(vita->mvp, rot, vita->mvp_no_rot); } -static void vita2d_gfx_update_viewport(vita_video_t* vita) +static void vita2d_gfx_update_viewport(vita_video_t* vita, + video_frame_info_t *video_info) { int x = 0; int y = 0; @@ -374,15 +374,10 @@ static void vita2d_gfx_update_viewport(vita_video_t* vita) #if defined(HAVE_MENU) if (settings->uints.video_aspect_ratio_idx == ASPECT_RATIO_CUSTOM) { - struct video_viewport *custom = video_viewport_get_custom(); - - if (custom) - { - x = custom->x; - y = custom->y; - width = custom->width; - height = custom->height; - } + x = video_info->custom_vp_x; + y = video_info->custom_vp_y; + width = video_info->custom_vp_width; + height = video_info->custom_vp_height; } else #endif