From c4dfa1e12a9154ccdb7a9e412da06407f593a742 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 10 Mar 2020 19:52:05 +0100 Subject: [PATCH] (Gfx drivers) Cleanups --- gfx/drivers/ctr_gfx.c | 25 +++++++++++++++++++------ gfx/drivers/fpga_gfx.c | 1 - gfx/drivers/gl1.c | 8 ++++---- gfx/drivers/xshm_gfx.c | 1 - 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/gfx/drivers/ctr_gfx.c b/gfx/drivers/ctr_gfx.c index 44f1eaa179..f223fc8ba4 100644 --- a/gfx/drivers/ctr_gfx.c +++ b/gfx/drivers/ctr_gfx.c @@ -144,7 +144,11 @@ static INLINE void ctr_set_screen_coords(ctr_video_t * ctr) static void ctr_update_viewport( ctr_video_t* ctr, settings_t *settings, - video_frame_info_t *video_info) + int custom_vp_x, + int custom_vp_y, + unsigned custom_vp_width, + unsigned custom_vp_height + ) { int x = 0; int y = 0; @@ -167,10 +171,10 @@ static void ctr_update_viewport( #if defined(HAVE_MENU) if (aspect_ratio_idx == ASPECT_RATIO_CUSTOM) { - x = video_info->custom_vp_x; - y = video_info->custom_vp_y; - width = video_info->custom_vp_width; - height = video_info->custom_vp_height; + x = custom_vp_x; + y = custom_vp_y; + width = custom_vp_width; + height = custom_vp_height; } else #endif @@ -538,6 +542,10 @@ static bool ctr_frame(void* data, const void* frame, float video_refresh_rate = video_info->refresh_rate; struct font_params *osd_params = (struct font_params*) &video_info->osd_stat_params; + int custom_vp_x = video_info->custom_vp_x; + int custom_vp_y = video_info->custom_vp_y; + unsigned custom_vp_width = video_info->custom_vp_width; + unsigned custom_vp_height = video_info->custom_vp_height; if (!width || !height || !settings) @@ -702,7 +710,12 @@ static bool ctr_frame(void* data, const void* frame, } if (ctr->should_resize) - ctr_update_viewport(ctr, settings, video_info); + ctr_update_viewport(ctr, settings, + custom_vp_x, + custom_vp_y, + custom_vp_width, + custom_vp_height + ); 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/fpga_gfx.c b/gfx/drivers/fpga_gfx.c index 3d63f89117..25c5e8995e 100644 --- a/gfx/drivers/fpga_gfx.c +++ b/gfx/drivers/fpga_gfx.c @@ -442,7 +442,6 @@ static void fpga_set_texture_frame(void *data, } static void fpga_set_osd_msg(void *data, - video_frame_info_t *video_info, const char *msg, const void *params, void *font) { diff --git a/gfx/drivers/gl1.c b/gfx/drivers/gl1.c index 1b716e12e8..15efd6ad9d 100644 --- a/gfx/drivers/gl1.c +++ b/gfx/drivers/gl1.c @@ -92,11 +92,11 @@ static const GLfloat gl1_white_color[] = { gl1->ctx_driver->bind_hw_render(gl1->ctx_data, enable) #ifdef HAVE_OVERLAY -static void gl1_render_overlay(gl1_t *gl, video_frame_info_t *video_info) +static void gl1_render_overlay(gl1_t *gl, + unsigned width, + unsigned height) { unsigned i; - unsigned width = video_info->width; - unsigned height = video_info->height; glEnable(GL_BLEND); @@ -864,7 +864,7 @@ static bool gl1_gfx_frame(void *data, const void *frame, #ifdef HAVE_OVERLAY if (gl1->overlay_enable) - gl1_render_overlay(gl1, video_info); + gl1_render_overlay(gl1, video_width, video_height); #endif if (msg) diff --git a/gfx/drivers/xshm_gfx.c b/gfx/drivers/xshm_gfx.c index 39626d0db3..e70611fcfd 100644 --- a/gfx/drivers/xshm_gfx.c +++ b/gfx/drivers/xshm_gfx.c @@ -169,7 +169,6 @@ static void xshm_poke_texture_enable(void *data, } static void xshm_poke_set_osd_msg(void *data, - video_frame_info_t *video_info, const char *msg, const void *params, void *font) {