mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-17 16:10:29 +00:00
Contain driver->input_data usage
This commit is contained in:
parent
dc69dc6392
commit
d2f771440b
@ -433,9 +433,7 @@ static void init_video_input(const input_driver_t *tmp)
|
||||
if (!driver->input)
|
||||
goto error;
|
||||
|
||||
driver->input_data = input_driver_init();
|
||||
|
||||
if (driver->input_data)
|
||||
if (input_driver_init())
|
||||
return;
|
||||
|
||||
error:
|
||||
|
@ -102,9 +102,6 @@ static PyObject *py_read_input(PyObject *self, PyObject *args)
|
||||
|
||||
(void)self;
|
||||
|
||||
if (!driver->input_data)
|
||||
return PyBool_FromLong(0);
|
||||
|
||||
if (!PyArg_ParseTuple(args, "II", &user, &key))
|
||||
return NULL;
|
||||
|
||||
@ -120,7 +117,6 @@ static PyObject *py_read_analog(PyObject *self, PyObject *args)
|
||||
{
|
||||
unsigned user, index, id, i;
|
||||
int16_t res = 0;
|
||||
driver_t *driver = driver_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
const struct retro_keybind *py_binds[MAX_USERS];
|
||||
|
||||
@ -129,9 +125,6 @@ static PyObject *py_read_analog(PyObject *self, PyObject *args)
|
||||
|
||||
(void)self;
|
||||
|
||||
if (!driver->input_data)
|
||||
return PyBool_FromLong(0);
|
||||
|
||||
if (!PyArg_ParseTuple(args, "III", &user, &index, &id))
|
||||
return NULL;
|
||||
|
||||
|
@ -229,13 +229,16 @@ bool input_driver_grab_stdin(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
void *input_driver_init(void)
|
||||
bool input_driver_init(void)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
|
||||
if (driver && driver->input)
|
||||
return driver->input->init();
|
||||
return NULL;
|
||||
driver->input_data = driver->input->init();
|
||||
|
||||
if (!driver->input_data)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void input_driver_free(void)
|
||||
|
@ -165,7 +165,7 @@ bool input_driver_grab_mouse(bool state);
|
||||
|
||||
bool input_driver_grab_stdin(void);
|
||||
|
||||
void *input_driver_init(void);
|
||||
bool input_driver_init(void);
|
||||
|
||||
void input_driver_free(void);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user