Get rid of unnecessary function

This commit is contained in:
libretroadmin 2023-05-06 22:29:44 +02:00
parent 099f33e0b3
commit 80b640f62e
3 changed files with 9 additions and 31 deletions

View File

@ -4809,19 +4809,6 @@ void menu_input_set_pointer_y_accel(float y_accel)
menu_input->pointer.y_accel = y_accel;
}
bool menu_input_key_bind_set_min_max(menu_input_ctx_bind_limits_t *lim)
{
struct menu_state *menu_st = &menu_driver_state;
struct menu_bind_state *binds = &menu_st->input_binds;
if (!lim)
return false;
binds->begin = lim->min;
binds->last = lim->max;
return true;
}
const char *menu_input_dialog_get_buffer(void)
{
struct menu_state *menu_st = &menu_driver_state;

View File

@ -41,17 +41,9 @@ typedef struct menu_input_ctx_bind
size_t len;
} menu_input_ctx_bind_t;
typedef struct menu_input_ctx_bind_limits
{
unsigned min;
unsigned max;
} menu_input_ctx_bind_limits_t;
bool menu_input_key_bind_set_mode(
enum menu_input_binds_ctl_state state, void *data);
bool menu_input_key_bind_set_min_max(menu_input_ctx_bind_limits_t *lim);
RETRO_END_DECLS
#endif

View File

@ -2507,23 +2507,22 @@ static int setting_action_ok_bind_defaults(
rarch_setting_t *setting, size_t idx, bool wraparound)
{
unsigned i;
menu_input_ctx_bind_limits_t lim;
struct menu_state *menu_st = menu_state_get_ptr();
struct menu_bind_state *binds = &menu_st->input_binds;
struct retro_keybind *target = NULL;
const struct retro_keybind *def_binds = NULL;
if (!setting)
return -1;
target = &input_config_binds[setting->index_offset][0];
def_binds = (setting->index_offset) ?
retro_keybinds_rest : retro_keybinds_1;
target = &input_config_binds[setting->index_offset][0];
def_binds = (setting->index_offset)
? retro_keybinds_rest
: retro_keybinds_1;
binds->begin = MENU_SETTINGS_BIND_BEGIN;
binds->last = MENU_SETTINGS_BIND_LAST;
lim.min = MENU_SETTINGS_BIND_BEGIN;
lim.max = MENU_SETTINGS_BIND_LAST;
menu_input_key_bind_set_min_max(&lim);
for (i = MENU_SETTINGS_BIND_BEGIN;
for ( i = MENU_SETTINGS_BIND_BEGIN;
i <= MENU_SETTINGS_BIND_LAST; i++, target++)
{
target->key = def_binds[i - MENU_SETTINGS_BIND_BEGIN].key;