mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-29 07:59:11 +00:00
The joystick instance ID is already set in the open call
This commit is contained in:
parent
07c49d1a67
commit
b391e6477e
12 changed files with 0 additions and 12 deletions
|
@ -572,7 +572,6 @@ static int ANDROID_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||
return SDL_SetError("Joystick already opened");
|
||||
}
|
||||
|
||||
joystick->instance_id = item->device_instance;
|
||||
joystick->hwdata = (struct joystick_hwdata *)item;
|
||||
item->joystick = joystick;
|
||||
joystick->nhats = item->nhats;
|
||||
|
|
|
@ -948,7 +948,6 @@ static int IOS_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||
}
|
||||
|
||||
joystick->hwdata = device;
|
||||
joystick->instance_id = device->instance_id;
|
||||
|
||||
joystick->naxes = device->naxes;
|
||||
joystick->nhats = device->nhats;
|
||||
|
|
|
@ -595,7 +595,6 @@ static int BSD_JoystickOpen(SDL_Joystick *joy, int device_index)
|
|||
return -1;
|
||||
}
|
||||
|
||||
joy->instance_id = item->device_instance;
|
||||
joy->hwdata = hw;
|
||||
joy->naxes = hw->naxes;
|
||||
joy->nbuttons = hw->nbuttons;
|
||||
|
|
|
@ -765,7 +765,6 @@ static int DARWIN_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||
{
|
||||
recDevice *device = GetDeviceForIndex(device_index);
|
||||
|
||||
joystick->instance_id = device->instance_id;
|
||||
joystick->hwdata = device;
|
||||
device->joystick = joystick;
|
||||
joystick->name = device->product;
|
||||
|
|
|
@ -311,7 +311,6 @@ static int EMSCRIPTEN_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||
return SDL_SetError("Joystick already opened");
|
||||
}
|
||||
|
||||
joystick->instance_id = item->device_instance;
|
||||
joystick->hwdata = (struct joystick_hwdata *)item;
|
||||
item->joystick = joystick;
|
||||
|
||||
|
|
|
@ -139,7 +139,6 @@ extern "C"
|
|||
BJoystick *stick;
|
||||
|
||||
/* Create the joystick data structure */
|
||||
joystick->instance_id = device_index;
|
||||
joystick->hwdata = (struct joystick_hwdata *) SDL_calloc(1, sizeof(*joystick->hwdata));
|
||||
if (joystick->hwdata == NULL) {
|
||||
return -1;
|
||||
|
|
|
@ -1593,7 +1593,6 @@ static int LINUX_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||
return SDL_SetError("No such device");
|
||||
}
|
||||
|
||||
joystick->instance_id = item->device_instance;
|
||||
joystick->hwdata = (struct joystick_hwdata *)
|
||||
SDL_calloc(1, sizeof(*joystick->hwdata));
|
||||
if (!joystick->hwdata) {
|
||||
|
|
|
@ -91,7 +91,6 @@ static int N3DS_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||
joystick->nbuttons = NB_BUTTONS;
|
||||
joystick->naxes = 4;
|
||||
joystick->nhats = 0;
|
||||
joystick->instance_id = device_index;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -214,7 +214,6 @@ static int PS2_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||
joystick->nbuttons = PS2_BUTTONS;
|
||||
joystick->naxes = PS2_TOTAL_AXIS;
|
||||
joystick->nhats = 0;
|
||||
joystick->instance_id = device_index;
|
||||
|
||||
SDL_SetBooleanProperty(SDL_GetJoystickProperties(joystick), SDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN, SDL_TRUE);
|
||||
|
||||
|
|
|
@ -164,7 +164,6 @@ static int PSP_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||
joystick->nbuttons = SDL_arraysize(button_map);
|
||||
joystick->naxes = 2;
|
||||
joystick->nhats = 0;
|
||||
joystick->instance_id = device_index;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -422,7 +422,6 @@ static int VIRTUAL_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||
if (!hwdata) {
|
||||
return SDL_SetError("No such device");
|
||||
}
|
||||
joystick->instance_id = hwdata->instance_id;
|
||||
joystick->hwdata = hwdata;
|
||||
joystick->naxes = hwdata->desc.naxes;
|
||||
joystick->nbuttons = hwdata->desc.nbuttons;
|
||||
|
|
|
@ -211,7 +211,6 @@ static int VITA_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||
joystick->nbuttons = SDL_arraysize(ext_button_map);
|
||||
joystick->naxes = 6;
|
||||
joystick->nhats = 0;
|
||||
joystick->instance_id = device_index;
|
||||
|
||||
SDL_SetBooleanProperty(SDL_GetJoystickProperties(joystick), SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN, SDL_TRUE);
|
||||
SDL_SetBooleanProperty(SDL_GetJoystickProperties(joystick), SDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN, SDL_TRUE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue