mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-13 05:10:42 +00:00
Pass video_is_threaded variable to menu driver init function
This commit is contained in:
parent
6bae9244e8
commit
a5d7bedb8a
@ -1469,7 +1469,7 @@ static void mui_layout(mui_handle_t *mui, bool video_is_threaded)
|
||||
}
|
||||
}
|
||||
|
||||
static void *mui_init(void **userdata)
|
||||
static void *mui_init(void **userdata, bool video_is_threaded)
|
||||
{
|
||||
mui_handle_t *mui = NULL;
|
||||
menu_handle_t *menu = (menu_handle_t*)
|
||||
@ -1478,7 +1478,7 @@ static void *mui_init(void **userdata)
|
||||
if (!menu)
|
||||
goto error;
|
||||
|
||||
if (!menu_display_init_first_driver())
|
||||
if (!menu_display_init_first_driver(video_is_threaded))
|
||||
goto error;
|
||||
|
||||
mui = (mui_handle_t*)calloc(1, sizeof(mui_handle_t));
|
||||
|
@ -143,7 +143,7 @@ static void xmb_init_ribbon(nk_menu_handle_t * xmb)
|
||||
free(ribbon_verts);
|
||||
}
|
||||
|
||||
static void *nk_menu_init(void **userdata)
|
||||
static void *nk_menu_init(void **userdata, bool video_is_threaded)
|
||||
{
|
||||
#if 1
|
||||
unsigned i;
|
||||
@ -159,7 +159,7 @@ static void *nk_menu_init(void **userdata)
|
||||
if (!menu)
|
||||
goto error;
|
||||
|
||||
if (!menu_display_init_first_driver())
|
||||
if (!menu_display_init_first_driver(video_is_threaded))
|
||||
goto error;
|
||||
|
||||
nk = (nk_menu_handle_t*)calloc(1, sizeof(nk_menu_handle_t));
|
||||
|
@ -653,7 +653,7 @@ static void rgui_framebuffer_free(void)
|
||||
rgui_framebuf_data = NULL;
|
||||
}
|
||||
|
||||
static void *rgui_init(void **userdata)
|
||||
static void *rgui_init(void **userdata, bool video_is_threaded)
|
||||
{
|
||||
size_t fb_pitch, start;
|
||||
unsigned fb_width, fb_height, new_font_height;
|
||||
|
@ -3168,7 +3168,7 @@ static void xmb_init_ribbon(xmb_handle_t * xmb)
|
||||
|
||||
|
||||
|
||||
static void *xmb_init(void **userdata)
|
||||
static void *xmb_init(void **userdata, bool video_is_threaded)
|
||||
{
|
||||
unsigned width, height;
|
||||
xmb_handle_t *xmb = NULL;
|
||||
@ -3178,7 +3178,7 @@ static void *xmb_init(void **userdata)
|
||||
if (!menu)
|
||||
goto error;
|
||||
|
||||
if (!menu_display_init_first_driver())
|
||||
if (!menu_display_init_first_driver(video_is_threaded))
|
||||
goto error;
|
||||
|
||||
video_driver_get_size(&width, &height);
|
||||
|
@ -990,7 +990,7 @@ static void zarch_frame(void *data, video_frame_info_t *video_info)
|
||||
menu_display_unset_viewport(video_info->width, video_info->height);
|
||||
}
|
||||
|
||||
static void *zarch_init(void **userdata)
|
||||
static void *zarch_init(void **userdata, bool video_is_threaded)
|
||||
{
|
||||
zui_t *zui = NULL;
|
||||
menu_handle_t *menu = (menu_handle_t*)
|
||||
@ -999,7 +999,7 @@ static void *zarch_init(void **userdata)
|
||||
if (!menu)
|
||||
goto error;
|
||||
|
||||
if (!menu_display_init_first_driver())
|
||||
if (!menu_display_init_first_driver(video_is_threaded))
|
||||
goto error;
|
||||
|
||||
zui = (zui_t*)calloc(1, sizeof(zui_t));
|
||||
|
@ -103,10 +103,10 @@ void menu_display_toggle_set_reason(enum menu_toggle_reason reason)
|
||||
menu_display_toggle_reason = reason;
|
||||
}
|
||||
|
||||
static const char *menu_video_get_ident(void)
|
||||
static const char *menu_video_get_ident(bool video_is_threaded)
|
||||
{
|
||||
#ifdef HAVE_THREADS
|
||||
if (video_driver_is_threaded())
|
||||
if (video_is_threaded)
|
||||
return video_thread_get_ident();
|
||||
#endif
|
||||
|
||||
@ -114,9 +114,10 @@ static const char *menu_video_get_ident(void)
|
||||
}
|
||||
|
||||
static bool menu_display_check_compatibility(
|
||||
enum menu_display_driver_type type)
|
||||
enum menu_display_driver_type type,
|
||||
bool video_is_threaded)
|
||||
{
|
||||
const char *video_driver = menu_video_get_ident();
|
||||
const char *video_driver = menu_video_get_ident(video_is_threaded);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@ -450,14 +451,15 @@ float menu_display_get_dpi(void)
|
||||
return dpi;
|
||||
}
|
||||
|
||||
bool menu_display_init_first_driver(void)
|
||||
bool menu_display_init_first_driver(bool video_is_threaded)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; menu_display_ctx_drivers[i]; i++)
|
||||
{
|
||||
if (!menu_display_check_compatibility(
|
||||
menu_display_ctx_drivers[i]->type))
|
||||
menu_display_ctx_drivers[i]->type,
|
||||
video_is_threaded))
|
||||
continue;
|
||||
|
||||
RARCH_LOG("[Menu]: Found menu display driver: \"%s\".\n",
|
||||
|
@ -238,7 +238,7 @@ bool menu_display_get_framebuffer_dirty_flag(void);
|
||||
void menu_display_set_framebuffer_dirty_flag(void);
|
||||
void menu_display_unset_framebuffer_dirty_flag(void);
|
||||
float menu_display_get_dpi(void);
|
||||
bool menu_display_init_first_driver(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);
|
||||
|
@ -474,7 +474,7 @@ static bool menu_driver_init_internal(bool video_is_threaded)
|
||||
return true;
|
||||
|
||||
menu_driver_data = (menu_handle_t*)
|
||||
menu_driver_ctx->init(&menu_userdata);
|
||||
menu_driver_ctx->init(&menu_userdata, video_is_threaded);
|
||||
|
||||
if (!menu_driver_data || !menu_init(menu_driver_data))
|
||||
{
|
||||
|
@ -228,7 +228,7 @@ typedef struct menu_ctx_driver
|
||||
int (*iterate)(void *data, void *userdata, enum menu_action action);
|
||||
void (*render)(void *data);
|
||||
void (*frame)(void *data, video_frame_info_t *video_info);
|
||||
void* (*init)(void**);
|
||||
void* (*init)(void**, bool);
|
||||
void (*free)(void*);
|
||||
void (*context_reset)(void *data, bool video_is_threaded);
|
||||
void (*context_destroy)(void *data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user