mirror of
https://github.com/libretro/RetroArch.git
synced 2025-01-22 01:07:37 +00:00
Refactor find_prev/find_next menu driver functions
This commit is contained in:
parent
d05d909373
commit
31e7f1009d
23
driver.c
23
driver.c
@ -568,29 +568,6 @@ void uninit_location(void)
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
void find_prev_menu_driver(void)
|
||||
{
|
||||
int i = find_driver_index(RARCH_DRIVER_MENU, g_settings.menu.driver);
|
||||
if (i > 0)
|
||||
{
|
||||
strlcpy(g_settings.menu.driver, menu_ctx_drivers[i - 1]->ident, sizeof(g_settings.menu.driver));
|
||||
driver.menu_ctx = (menu_ctx_driver_t*)menu_ctx_drivers[i - 1];
|
||||
}
|
||||
else
|
||||
RARCH_WARN("Couldn't find any previous menu driver (current one: \"%s\").\n", g_settings.menu.driver);
|
||||
}
|
||||
|
||||
void find_next_menu_driver(void)
|
||||
{
|
||||
int i = find_driver_index(RARCH_DRIVER_MENU, g_settings.menu.driver);
|
||||
if (i >= 0 && menu_ctx_drivers[i + 1])
|
||||
{
|
||||
strlcpy(g_settings.menu.driver, menu_ctx_drivers[i + 1]->ident, sizeof(g_settings.menu.driver));
|
||||
driver.menu_ctx = (menu_ctx_driver_t*)menu_ctx_drivers[i + 1];
|
||||
}
|
||||
else
|
||||
RARCH_WARN("Couldn't find any next menu driver (current one: \"%s\").\n", g_settings.menu.driver);
|
||||
}
|
||||
|
||||
void find_menu_driver(void)
|
||||
{
|
||||
|
2
driver.h
2
driver.h
@ -527,8 +527,6 @@ bool driver_location_get_position(double *lat, double *lon, double *horiz_accura
|
||||
void driver_location_set_interval(unsigned interval_msecs, unsigned interval_distance);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
void find_prev_menu_driver(void);
|
||||
void find_next_menu_driver(void);
|
||||
void find_menu_driver(void);
|
||||
#endif
|
||||
|
||||
|
@ -3416,9 +3416,9 @@ static int menu_common_setting_set(unsigned id, unsigned action, rarch_setting_t
|
||||
#ifdef HAVE_MENU
|
||||
case MENU_SETTINGS_DRIVER_MENU:
|
||||
if (action == MENU_ACTION_LEFT)
|
||||
find_prev_menu_driver();
|
||||
find_prev_driver(RARCH_DRIVER_MENU, g_settings.menu.driver, sizeof(g_settings.menu.driver));
|
||||
else if (action == MENU_ACTION_RIGHT)
|
||||
find_next_menu_driver();
|
||||
find_next_driver(RARCH_DRIVER_MENU, g_settings.menu.driver, sizeof(g_settings.menu.driver));
|
||||
break;
|
||||
#endif
|
||||
#if defined(GEKKO)
|
||||
|
Loading…
x
Reference in New Issue
Block a user