mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 10:10:57 +00:00
(Menu) Add get_default_menu function for default settings
This commit is contained in:
parent
a56d57c615
commit
f788249c59
13
config.def.h
13
config.def.h
@ -99,6 +99,11 @@ enum
|
||||
|
||||
OSK_PS3,
|
||||
OSK_NULL,
|
||||
|
||||
MENU_RGUI,
|
||||
MENU_RMENU,
|
||||
MENU_RMENU_XUI,
|
||||
MENU_LAKKA,
|
||||
};
|
||||
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) || defined(__CELLOS_LV2__)
|
||||
@ -233,6 +238,14 @@ enum
|
||||
#define OSK_DEFAULT_DRIVER OSK_NULL
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_RMENU)
|
||||
#define MENU_DEFAULT_DRIVER MENU_RMENU
|
||||
#elif defined(HAVE_RMENU_XUI)
|
||||
#define MENU_DEFAULT_DRIVER MENU_RMENU_XUI
|
||||
#else
|
||||
#define MENU_DEFAULT_DRIVER MENU_RGUI
|
||||
#endif
|
||||
|
||||
#if defined(XENON) || defined(_XBOX360) || defined(__CELLOS_LV2__)
|
||||
#define DEFAULT_ASPECT_RATIO 1.7778f
|
||||
#elif defined(_XBOX1) || defined(GEKKO) || defined(ANDROID) || defined(__QNX__)
|
||||
|
2
driver.c
2
driver.c
@ -511,10 +511,10 @@ void global_init_drivers(void)
|
||||
{
|
||||
find_audio_driver();
|
||||
find_input_driver();
|
||||
init_video_input();
|
||||
#ifdef HAVE_MENU
|
||||
find_menu_driver();
|
||||
#endif
|
||||
init_video_input();
|
||||
}
|
||||
|
||||
void global_uninit_drivers(void)
|
||||
|
@ -454,6 +454,9 @@ static void *rmenu_init(void)
|
||||
{
|
||||
rgui_handle_t *rgui = (rgui_handle_t*)calloc(1, sizeof(*rgui));
|
||||
|
||||
if (!rgui)
|
||||
return NULL;
|
||||
|
||||
rmenu_init_assets(rgui);
|
||||
|
||||
return rgui;
|
||||
|
@ -155,11 +155,9 @@ static void* rmenu_xui_init(void)
|
||||
HRESULT hr;
|
||||
|
||||
rgui_handle_t *rgui = (rgui_handle_t*)calloc(1, sizeof(*rgui));
|
||||
if (rgui == NULL)
|
||||
{
|
||||
RARCH_ERR("Could not allocate RGUI handle.\n");
|
||||
|
||||
if (!rgui)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
d3d_video_t *d3d= (d3d_video_t*)driver.video_data;
|
||||
|
||||
|
26
settings.c
26
settings.c
@ -151,6 +151,25 @@ const char *config_get_default_input(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
const char *config_get_default_menu(void)
|
||||
{
|
||||
switch (MENU_DEFAULT_DRIVER)
|
||||
{
|
||||
case MENU_RGUI:
|
||||
return "rgui";
|
||||
case MENU_RMENU:
|
||||
return "rmenu";
|
||||
case MENU_RMENU_XUI:
|
||||
return "rmenu_xui";
|
||||
case MENU_LAKKA:
|
||||
return "lakka";
|
||||
default:
|
||||
return "NULL";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OSK
|
||||
const char *config_get_default_osk(void)
|
||||
{
|
||||
@ -226,6 +245,9 @@ void config_set_defaults(void)
|
||||
const char *def_image = config_get_default_image();
|
||||
const char *def_audio = config_get_default_audio();
|
||||
const char *def_input = config_get_default_input();
|
||||
#ifdef HAVE_MENU
|
||||
const char *def_menu = config_get_default_menu();
|
||||
#endif
|
||||
#ifdef HAVE_CAMERA
|
||||
const char *def_camera = config_get_default_camera();
|
||||
|
||||
@ -254,6 +276,10 @@ void config_set_defaults(void)
|
||||
strlcpy(g_settings.input.driver, def_input, sizeof(g_settings.input.driver));
|
||||
if (def_image)
|
||||
strlcpy(g_settings.image.driver, def_image, sizeof(g_settings.image.driver));
|
||||
#ifdef HAVE_MENU
|
||||
if (def_menu)
|
||||
strlcpy(g_settings.menu.driver, def_menu, sizeof(g_settings.menu.driver));
|
||||
#endif
|
||||
|
||||
g_settings.load_dummy_on_core_shutdown = load_dummy_on_core_shutdown;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user