(menu display) Get rid of more pointer grabbing

This commit is contained in:
twinaphex 2018-02-16 19:25:19 +01:00
parent a05d3bc4f7
commit 407d7e2c4e
15 changed files with 50 additions and 26 deletions

View File

@ -1459,7 +1459,7 @@ static void mui_frame(void *data, video_frame_info_t *video_info)
}
else
{
menu_display_clear_color(&clearcolor);
menu_display_clear_color(&clearcolor, video_info);
if (mui->textures.bg)
{

View File

@ -57,7 +57,7 @@ static void menu_display_caca_restore_clear_color(void)
{
}
static void menu_display_caca_clear_color(menu_display_ctx_clearcolor_t *clearcolor)
static void menu_display_caca_clear_color(menu_display_ctx_clearcolor_t *clearcolor, video_frame_info_t *video_info)
{
(void)clearcolor;
}

View File

@ -168,7 +168,7 @@ static void menu_display_ctr_restore_clear_color(void)
#endif
}
static void menu_display_ctr_clear_color(menu_display_ctx_clearcolor_t *clearcolor)
static void menu_display_ctr_clear_color(menu_display_ctx_clearcolor_t *clearcolor, video_frame_info_t *video_info)
{
if (!clearcolor)
return;

View File

@ -277,11 +277,11 @@ static void menu_display_d3d_restore_clear_color(void)
}
static void menu_display_d3d_clear_color(
menu_display_ctx_clearcolor_t *clearcolor)
menu_display_ctx_clearcolor_t *clearcolor, video_frame_info_t *video_info)
{
DWORD clear_color = 0;
d3d_video_t *d3d = (d3d_video_t*)
video_driver_get_ptr(false);
d3d_video_t *d3d = video_info ?
(d3d_video_t*)video_info->userdata : NULL;
if (!d3d || !clearcolor)
return;

View File

@ -229,14 +229,18 @@ static void menu_display_d3d11_draw_pipeline(void* data,
static void menu_display_d3d11_restore_clear_color(void) {}
static void menu_display_d3d11_clear_color(menu_display_ctx_clearcolor_t* clearcolor)
static void menu_display_d3d11_clear_color(
menu_display_ctx_clearcolor_t* clearcolor,
video_frame_info_t *video_info)
{
d3d11_video_t* d3d11 = (d3d11_video_t*)video_driver_get_ptr(false);
d3d11_video_t *d3d11 = video_info ?
(d3d11_video_t*)video_info->userdata : NULL;
if (!d3d11 || !clearcolor)
return;
D3D11ClearRenderTargetView(d3d11->context, d3d11->renderTargetView, (float*)clearcolor);
D3D11ClearRenderTargetView(d3d11->context,
d3d11->renderTargetView, (float*)clearcolor);
}
static bool menu_display_d3d11_font_init_first(
@ -248,7 +252,8 @@ static bool menu_display_d3d11_font_init_first(
{
font_data_t** handle = (font_data_t**)font_handle;
font_data_t* new_handle = font_driver_init_first(
video_data, font_path, font_size, true, is_threaded, FONT_DRIVER_RENDER_D3D11_API);
video_data, font_path, font_size, true,
is_threaded, FONT_DRIVER_RENDER_D3D11_API);
if (!new_handle)
return false;
*handle = new_handle;

View File

@ -249,9 +249,10 @@ static void menu_display_d3d12_draw_pipeline(void* data,
static void menu_display_d3d12_restore_clear_color(void) {}
static void menu_display_d3d12_clear_color(menu_display_ctx_clearcolor_t* clearcolor)
static void menu_display_d3d12_clear_color(
menu_display_ctx_clearcolor_t* clearcolor, video_frame_info_t *video_info)
{
d3d12_video_t* d3d12 = (d3d12_video_t*)video_driver_get_ptr(false);
d3d12_video_t* d3d12 = video_info ? (d3d12_video_t*)video_info->userdata : NULL;
if (!d3d12 || !clearcolor)
return;

View File

@ -73,7 +73,9 @@ static void menu_display_gdi_restore_clear_color(void)
ReleaseDC(hwnd, hdc);*/
}
static void menu_display_gdi_clear_color(menu_display_ctx_clearcolor_t *clearcolor)
static void menu_display_gdi_clear_color(
menu_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
{
(void)clearcolor;

View File

@ -235,7 +235,9 @@ static void menu_display_gl_restore_clear_color(void)
glClearColor(0.0f, 0.0f, 0.0f, 0.00f);
}
static void menu_display_gl_clear_color(menu_display_ctx_clearcolor_t *clearcolor)
static void menu_display_gl_clear_color(
menu_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
{
if (!clearcolor)
return;

View File

@ -41,7 +41,8 @@ static void menu_display_null_draw(void *data, video_frame_info_t *video_info)
(void)data;
}
static void menu_display_null_draw_pipeline(void *data, video_frame_info_t *video_info)
static void menu_display_null_draw_pipeline(
void *data, video_frame_info_t *video_info)
{
(void)data;
}
@ -55,7 +56,9 @@ static void menu_display_null_restore_clear_color(void)
{
}
static void menu_display_null_clear_color(menu_display_ctx_clearcolor_t *clearcolor)
static void menu_display_null_clear_color(
menu_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
{
(void)clearcolor;
}

View File

@ -57,7 +57,9 @@ static void menu_display_vga_restore_clear_color(void)
{
}
static void menu_display_vga_clear_color(menu_display_ctx_clearcolor_t *clearcolor)
static void menu_display_vga_clear_color(
menu_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
{
(void)clearcolor;
}

View File

@ -210,7 +210,9 @@ static void menu_display_vita2d_restore_clear_color(void)
vita2d_set_clear_color(RGBA8(0x00, 0x00, 0x00, 0xFF));
}
static void menu_display_vita2d_clear_color(menu_display_ctx_clearcolor_t *clearcolor)
static void menu_display_vita2d_clear_color(
menu_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
{
if (!clearcolor)
return;

View File

@ -282,11 +282,12 @@ static void menu_display_vk_restore_clear_color(void)
}
static void menu_display_vk_clear_color(
menu_display_ctx_clearcolor_t *clearcolor)
menu_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
{
VkClearRect rect;
VkClearAttachment attachment;
vk_t *vk = (vk_t*)video_driver_get_ptr(false);
vk_t *vk = video_info ? (vk_t*)video_info->userdata : NULL;
if (!vk || !clearcolor)
return;

View File

@ -298,7 +298,9 @@ static void menu_display_wiiu_restore_clear_color(void)
#endif
}
static void menu_display_wiiu_clear_color(menu_display_ctx_clearcolor_t *clearcolor)
static void menu_display_wiiu_clear_color(
menu_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
{
if (!clearcolor)
return;

View File

@ -576,10 +576,11 @@ bool menu_display_restore_clear_color(void)
return true;
}
void menu_display_clear_color(menu_display_ctx_clearcolor_t *color)
void menu_display_clear_color(menu_display_ctx_clearcolor_t *color,
video_frame_info_t *video_info)
{
if (menu_disp && menu_disp->clear_color)
menu_disp->clear_color(color);
menu_disp->clear_color(color, video_info);
}
void menu_display_draw(menu_display_ctx_draw_t *draw,

View File

@ -331,7 +331,8 @@ typedef struct menu_display_ctx_driver
/* Set the clear color back to its default values. */
void (*restore_clear_color)(void);
/* Set the color to be used when clearing the screen */
void (*clear_color)(menu_display_ctx_clearcolor_t *clearcolor);
void (*clear_color)(menu_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info);
/* Get the default Model-View-Projection matrix */
void *(*get_default_mvp)(void);
/* Get the default vertices matrix */
@ -674,8 +675,10 @@ void menu_display_unset_framebuffer_dirty_flag(void);
float menu_display_get_dpi(void);
bool menu_display_init_first_driver(bool video_is_threaded);
bool menu_display_restore_clear_color(void);
void menu_display_clear_color(menu_display_ctx_clearcolor_t *color);
void menu_display_draw(menu_display_ctx_draw_t *draw, video_frame_info_t *video_info);
void menu_display_clear_color(menu_display_ctx_clearcolor_t *color,
video_frame_info_t *video_info);
void menu_display_draw(menu_display_ctx_draw_t *draw,
video_frame_info_t *video_info);
void menu_display_draw_pipeline(menu_display_ctx_draw_t *draw,
video_frame_info_t *video_info);