1
0
forked from Clones/Controlify

1.1 changelog, bump version, update comparison

This commit is contained in:
isXander
2023-04-14 11:55:30 +01:00
parent 95e1ce2385
commit 20e662f927
16 changed files with 511 additions and 126 deletions

View File

@ -5,6 +5,7 @@ import com.google.gson.JsonElement;
import dev.isxander.controlify.Controlify;
import dev.isxander.controlify.InputMode;
import dev.isxander.controlify.api.ControlifyApi;
import dev.isxander.controlify.bindings.ControllerBindings;
import dev.isxander.controlify.controller.AbstractController;
import dev.isxander.controlify.controller.hid.ControllerHIDService;
import dev.isxander.controlify.controller.joystick.mapping.RPJoystickMapping;
@ -31,6 +32,12 @@ public class SingleJoystickController extends AbstractController<JoystickState,
this.config = new JoystickConfig(this);
this.defaultConfig = new JoystickConfig(this);
this.ptrJoystick = SDL2NativesManager.isLoaded() ? SDL.SDL_JoystickOpen(joystickId) : 0;
this.rumbleSupported = SDL2NativesManager.isLoaded() && SDL.SDL_JoystickHasRumble(this.ptrJoystick);
this.rumbleManager = new RumbleManager(this);
this.bindings = new ControllerBindings<>(this);
}
@Override
@ -117,13 +124,6 @@ public class SingleJoystickController extends AbstractController<JoystickState,
return this.rumbleManager;
}
@Override
public void open() {
this.ptrJoystick = SDL2NativesManager.isLoaded() ? SDL.SDL_JoystickOpen(joystickId) : 0;
this.rumbleSupported = SDL2NativesManager.isLoaded() && SDL.SDL_JoystickHasRumble(this.ptrJoystick);
this.rumbleManager = new RumbleManager(this);
}
@Override
public void close() {
SDL.SDL_JoystickClose(ptrJoystick);