mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 09:32:52 +00:00
Wrap access to settings->input.binds completely
This commit is contained in:
parent
c68c8a8cfe
commit
53c9acacd6
@ -1242,10 +1242,11 @@ static void android_input_poll_memcpy(void *data)
|
||||
static bool android_input_key_pressed(void *data, int key)
|
||||
{
|
||||
rarch_joypad_info_t joypad_info;
|
||||
android_input_t *android = (android_input_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
android_input_t *android = (android_input_t*)data;
|
||||
settings_t *settings = config_get_ptr();
|
||||
const struct retro_keybind *keyptr = input_config_get_specific_bind(0, key);
|
||||
|
||||
if( settings->input.binds[0][key].valid
|
||||
if( keyptr->valid
|
||||
&& android_keyboard_port_input_pressed(input_config_get_binds(0),
|
||||
key))
|
||||
return true;
|
||||
@ -1254,9 +1255,9 @@ static bool android_input_key_pressed(void *data, int key)
|
||||
joypad_info.auto_binds = input_autoconfigure_get_binds(0);
|
||||
joypad_info.axis_threshold = settings->input.axis_threshold;
|
||||
|
||||
if (settings->input.binds[0][key].valid &&
|
||||
if (keyptr->valid &&
|
||||
input_joypad_pressed(android->joypad, joypad_info,
|
||||
0, settings->input.binds[0], key))
|
||||
0, input_config_get_binds(0), key))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -1026,7 +1026,7 @@ bool input_driver_init(void)
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
libretro_input_binds[i] = settings->input.binds[i];
|
||||
libretro_input_binds[i] = input_config_get_binds(i);
|
||||
if (current_input)
|
||||
current_input_data = current_input->init(settings->input.joypad_driver);
|
||||
|
||||
|
@ -39,6 +39,7 @@
|
||||
|
||||
#include "../../gfx/video_shader_driver.h"
|
||||
|
||||
#include "../../input/input_config.h"
|
||||
#include "../../input/input_remapping.h"
|
||||
|
||||
#ifndef BIND_ACTION_START
|
||||
@ -109,8 +110,11 @@ static int action_start_input_desc(unsigned type, const char *label)
|
||||
(void)label;
|
||||
|
||||
if (inp_desc_button_index_offset < RARCH_FIRST_CUSTOM_BIND)
|
||||
settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] =
|
||||
settings->input.binds[inp_desc_user][inp_desc_button_index_offset].id;
|
||||
{
|
||||
const struct retro_keybind *keyptr = input_config_get_specific_bind(inp_desc_user,
|
||||
inp_desc_button_index_offset);
|
||||
settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] = keyptr->id;
|
||||
}
|
||||
else
|
||||
settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] =
|
||||
inp_desc_button_index_offset - RARCH_FIRST_CUSTOM_BIND;
|
||||
|
Loading…
x
Reference in New Issue
Block a user