(Gfx drivers) Cleanups

This commit is contained in:
twinaphex 2020-03-10 19:52:05 +01:00
parent ae18fc808d
commit c4dfa1e12a
4 changed files with 23 additions and 12 deletions

View File

@ -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,

View File

@ -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)
{

View File

@ -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)

View File

@ -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)
{