mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
Create RARCH_MENU_CTL_TOGGLE
This commit is contained in:
parent
74015188a9
commit
733d71ebd3
@ -288,10 +288,8 @@ static void menu_driver_toggle(bool latch)
|
||||
rarch_system_info_t *system = NULL;
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
||||
menu_driver_ctl(RARCH_MENU_CTL_TOGGLE, &latch);
|
||||
|
||||
if (driver->toggle)
|
||||
driver->toggle(
|
||||
menu_userdata ? menu_userdata : NULL, latch);
|
||||
|
||||
if (latch)
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_ALIVE, NULL);
|
||||
@ -843,6 +841,16 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
||||
driver->list_clear(list);
|
||||
}
|
||||
return true;
|
||||
case RARCH_MENU_CTL_TOGGLE:
|
||||
{
|
||||
bool *latch = (bool*)data;
|
||||
if (!latch)
|
||||
return false;
|
||||
|
||||
if (driver->toggle)
|
||||
driver->toggle(menu_userdata, *latch);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case RARCH_MENU_CTL_NONE:
|
||||
break;
|
||||
|
@ -127,6 +127,7 @@ enum rarch_menu_ctl_state
|
||||
RARCH_MENU_CTL_PLAYLIST_INIT,
|
||||
RARCH_MENU_CTL_PLAYLIST_GET,
|
||||
RARCH_MENU_CTL_LIST_CLEAR,
|
||||
RARCH_MENU_CTL_TOGGLE,
|
||||
RARCH_MENU_CTL_POPULATE_ENTRIES
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user