Refactor Lakka action code

This commit is contained in:
twinaphex 2014-10-15 05:57:15 +02:00
parent bb3caf7005
commit 5636414e31
3 changed files with 5 additions and 22 deletions

View File

@ -359,27 +359,7 @@ static int menu_lakka_iterate(unsigned action)
rarch_setting_t *setting = (rarch_setting_t*)
active_subitem->setting;
switch (action)
{
case MENU_ACTION_OK:
if (setting->cmd_trigger.idx != RARCH_CMD_NONE)
setting->cmd_trigger.triggered = true;
/* fall-through */
case MENU_ACTION_LEFT:
case MENU_ACTION_RIGHT:
case MENU_ACTION_START:
if (setting->type == ST_BOOL)
menu_action_setting_boolean(setting, action);
else if (setting->type == ST_UINT)
menu_action_setting_unsigned_integer(setting, action);
else if (setting->type == ST_FLOAT)
menu_action_setting_fraction(setting, action);
else if (setting->type == ST_STRING)
menu_action_setting_driver(setting, action);
break;
default:
break;
}
menu_action_handle_setting(setting, 0, action);
}
switch (action)

View File

@ -188,7 +188,7 @@ static int menu_entries_set_current_path_selection(
return 0;
}
static int menu_action_handle_setting(rarch_setting_t *setting,
int menu_action_handle_setting(rarch_setting_t *setting,
unsigned type, unsigned action)
{
if (!setting)

View File

@ -47,6 +47,9 @@ int menu_action_setting_set_current_string_path(
int menu_action_setting_set(unsigned type, const char *label,
unsigned action);
int menu_action_handle_setting(rarch_setting_t *setting,
unsigned type, unsigned action);
#ifdef __cplusplus
}
#endif