Corrected device instance value for Linux joysticks.
This commit is contained in:
parent
79bd6b2b7d
commit
d2b1601539
2 changed files with 1 additions and 3 deletions
|
@ -722,7 +722,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
joystick->instance_id = device_index;
|
joystick->instance_id = item->device_instance;
|
||||||
joystick->hwdata = (struct joystick_hwdata *)
|
joystick->hwdata = (struct joystick_hwdata *)
|
||||||
SDL_malloc(sizeof(*joystick->hwdata));
|
SDL_malloc(sizeof(*joystick->hwdata));
|
||||||
if (joystick->hwdata == NULL) {
|
if (joystick->hwdata == NULL) {
|
||||||
|
@ -732,7 +732,6 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
|
||||||
}
|
}
|
||||||
SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
|
SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
|
||||||
joystick->hwdata->removed = SDL_FALSE;
|
joystick->hwdata->removed = SDL_FALSE;
|
||||||
joystick->hwdata->device_instance = item->device_instance;
|
|
||||||
joystick->hwdata->guid = item->guid;
|
joystick->hwdata->guid = item->guid;
|
||||||
joystick->hwdata->fd = fd;
|
joystick->hwdata->fd = fd;
|
||||||
joystick->hwdata->fname = SDL_strdup(item->path);
|
joystick->hwdata->fname = SDL_strdup(item->path);
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
struct joystick_hwdata
|
struct joystick_hwdata
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
int device_instance;
|
|
||||||
SDL_bool removed;
|
SDL_bool removed;
|
||||||
|
|
||||||
SDL_JoystickGUID guid;
|
SDL_JoystickGUID guid;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue