mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-10 21:10:15 +00:00
Input driver - Get rid of 'own driver' mechanism
This commit is contained in:
parent
829aedc6e2
commit
ebae7ebc79
@ -843,10 +843,7 @@ static void video_driver_free_internal(void)
|
||||
if (!video_driver_is_video_cache_context())
|
||||
video_driver_free_hw_context();
|
||||
|
||||
if (
|
||||
!input_driver_owns_driver() &&
|
||||
!input_driver_is_data_ptr_same(video_driver_data)
|
||||
)
|
||||
if (!input_driver_is_data_ptr_same(video_driver_data))
|
||||
input_driver_deinit();
|
||||
|
||||
if (video_driver_data
|
||||
|
@ -419,7 +419,6 @@ static bool input_driver_block_hotkey = false;
|
||||
static bool input_driver_block_libretro_input = false;
|
||||
static bool input_driver_nonblock_state = false;
|
||||
bool input_driver_flushing_input = false;
|
||||
static bool input_driver_data_own = false;
|
||||
static float input_driver_axis_threshold = 0.0f;
|
||||
static unsigned input_driver_max_users = 0;
|
||||
|
||||
@ -545,17 +544,6 @@ uint64_t input_driver_get_capabilities(void)
|
||||
return current_input->get_capabilities(current_input_data);
|
||||
}
|
||||
|
||||
void input_driver_set(const input_driver_t **input, void **input_data)
|
||||
{
|
||||
if (input && input_data)
|
||||
{
|
||||
*input = current_input;
|
||||
*input_data = current_input_data;
|
||||
}
|
||||
|
||||
input_driver_set_own_driver();
|
||||
}
|
||||
|
||||
void input_driver_keyboard_mapping_set_block(bool value)
|
||||
{
|
||||
if (current_input->keyboard_mapping_set_block)
|
||||
@ -1271,7 +1259,6 @@ void input_driver_destroy(void)
|
||||
input_driver_block_libretro_input = false;
|
||||
input_driver_nonblock_state = false;
|
||||
input_driver_flushing_input = false;
|
||||
input_driver_data_own = false;
|
||||
memset(&input_driver_turbo_btns, 0, sizeof(turbo_buttons_t));
|
||||
current_input = NULL;
|
||||
}
|
||||
@ -1373,21 +1360,6 @@ bool input_driver_is_nonblock_state(void)
|
||||
return input_driver_nonblock_state;
|
||||
}
|
||||
|
||||
void input_driver_set_own_driver(void)
|
||||
{
|
||||
input_driver_data_own = true;
|
||||
}
|
||||
|
||||
void input_driver_unset_own_driver(void)
|
||||
{
|
||||
input_driver_data_own = false;
|
||||
}
|
||||
|
||||
bool input_driver_owns_driver(void)
|
||||
{
|
||||
return input_driver_data_own;
|
||||
}
|
||||
|
||||
bool input_driver_init_command(void)
|
||||
{
|
||||
#ifdef HAVE_COMMAND
|
||||
|
@ -230,8 +230,6 @@ const input_device_driver_t * input_driver_get_sec_joypad_driver(void);
|
||||
|
||||
void input_driver_keyboard_mapping_set_block(bool value);
|
||||
|
||||
void input_driver_set(const input_driver_t **input, void **input_data);
|
||||
|
||||
/**
|
||||
* input_sensor_set_state:
|
||||
* @port : User number.
|
||||
@ -374,8 +372,6 @@ void input_driver_set_own_driver(void);
|
||||
|
||||
void input_driver_unset_own_driver(void);
|
||||
|
||||
bool input_driver_owns_driver(void);
|
||||
|
||||
void input_driver_deinit_command(void);
|
||||
|
||||
bool input_driver_init_command(void);
|
||||
|
@ -569,9 +569,6 @@ void drivers_init(int flags)
|
||||
{
|
||||
bool video_is_threaded = false;
|
||||
|
||||
if (flags & DRIVER_INPUT_MASK)
|
||||
input_driver_unset_own_driver();
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
/* By default, we want the menu to persist through driver reinits. */
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_OWN_DRIVER, NULL);
|
||||
@ -715,7 +712,7 @@ void driver_uninit(int flags)
|
||||
if ((flags & DRIVER_VIDEO_MASK))
|
||||
video_driver_destroy_data();
|
||||
|
||||
if ((flags & DRIVER_INPUT_MASK) && !input_driver_owns_driver())
|
||||
if ((flags & DRIVER_INPUT_MASK))
|
||||
input_driver_destroy_data();
|
||||
|
||||
if ((flags & DRIVER_AUDIO_MASK))
|
||||
|
Loading…
x
Reference in New Issue
Block a user