mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
(Menu) Simplify code
This commit is contained in:
parent
ab230f5169
commit
7b35620859
@ -658,25 +658,19 @@ void menu_display_texture_unload(uintptr_t *id)
|
||||
|
||||
bool menu_display_check_compatibility(enum menu_display_driver_type type)
|
||||
{
|
||||
const video_driver_t *video_driver = NULL;
|
||||
const char *video_driver = menu_video_get_ident();
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case MENU_VIDEO_DRIVER_GENERIC:
|
||||
return true;
|
||||
case MENU_VIDEO_DRIVER_OPENGL:
|
||||
#ifdef HAVE_OPENGL
|
||||
{
|
||||
gl_t *gl = (gl_t*)video_driver_get_ptr(&video_driver);
|
||||
if (video_driver == &video_gl || gl)
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
if (!strcmp(video_driver, "gl"))
|
||||
return true;
|
||||
break;
|
||||
case MENU_VIDEO_DRIVER_DIRECT3D:
|
||||
#ifdef HAVE_D3D
|
||||
/* TODO/FIXME */
|
||||
#endif
|
||||
if (!strcmp(video_driver, "d3d"))
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,6 @@ const menu_ctx_driver_t *menu_ctx_driver_get_ptr(void)
|
||||
|
||||
void init_menu(void)
|
||||
{
|
||||
const char *video_driver;
|
||||
driver_t *driver = driver_get_ptr();
|
||||
|
||||
if (driver->menu)
|
||||
@ -157,21 +156,8 @@ void init_menu(void)
|
||||
|
||||
find_menu_driver();
|
||||
|
||||
video_driver = menu_video_get_ident();
|
||||
|
||||
switch (driver->menu_ctx->type)
|
||||
{
|
||||
case MENU_VIDEO_DRIVER_GENERIC:
|
||||
break;
|
||||
case MENU_VIDEO_DRIVER_DIRECT3D:
|
||||
if (video_driver && (strcmp(video_driver, "d3d") != 0))
|
||||
init_menu_fallback();
|
||||
break;
|
||||
case MENU_VIDEO_DRIVER_OPENGL:
|
||||
if (video_driver && (strcmp(video_driver, "gl") != 0))
|
||||
init_menu_fallback();
|
||||
break;
|
||||
}
|
||||
if (!menu_display_check_compatibility(driver->menu_ctx->type))
|
||||
init_menu_fallback();
|
||||
|
||||
if (!(driver->menu = (menu_handle_t*)menu_init(driver->menu_ctx)))
|
||||
retro_fail(1, "init_menu()");
|
||||
|
Loading…
x
Reference in New Issue
Block a user