mirror of https://github.com/encounter/SDL.git
Android: fix joystick allocation that can be never used
This commit is contained in:
parent
2e38c94950
commit
a70bb58d4b
|
@ -180,9 +180,9 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
|
||||||
for(int i=0; i < deviceIds.length; ++i) {
|
for(int i=0; i < deviceIds.length; ++i) {
|
||||||
SDLJoystick joystick = getJoystick(deviceIds[i]);
|
SDLJoystick joystick = getJoystick(deviceIds[i]);
|
||||||
if (joystick == null) {
|
if (joystick == null) {
|
||||||
joystick = new SDLJoystick();
|
|
||||||
InputDevice joystickDevice = InputDevice.getDevice(deviceIds[i]);
|
InputDevice joystickDevice = InputDevice.getDevice(deviceIds[i]);
|
||||||
if (SDLControllerManager.isDeviceSDLJoystick(deviceIds[i])) {
|
if (SDLControllerManager.isDeviceSDLJoystick(deviceIds[i])) {
|
||||||
|
joystick = new SDLJoystick();
|
||||||
joystick.device_id = deviceIds[i];
|
joystick.device_id = deviceIds[i];
|
||||||
joystick.name = joystickDevice.getName();
|
joystick.name = joystickDevice.getName();
|
||||||
joystick.desc = getJoystickDescriptor(joystickDevice);
|
joystick.desc = getJoystickDescriptor(joystickDevice);
|
||||||
|
|
Loading…
Reference in New Issue