Use higher version of jinput without reflection required

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2 3 years ago
parent bcd48205cc
commit 7f6aa67e1e
  1. BIN
      lib/bin/net/java/games/input/AWTEnvironmentPlugin.class
  2. BIN
      lib/bin/net/java/games/input/ControllerEnvironment.class
  3. BIN
      lib/bin/net/java/games/input/DefaultControllerEnvironment.class
  4. BIN
      lib/bin/net/java/games/input/DirectAndRawInputEnvironmentPlugin.class
  5. BIN
      lib/bin/net/java/games/input/DirectInputEnvironmentPlugin$ShutdownHook.class
  6. BIN
      lib/bin/net/java/games/input/DirectInputEnvironmentPlugin.class
  7. BIN
      lib/bin/net/java/games/input/LinuxEnvironmentPlugin$1.class
  8. BIN
      lib/bin/net/java/games/input/LinuxEnvironmentPlugin$ShutdownHook.class
  9. BIN
      lib/bin/net/java/games/input/LinuxEnvironmentPlugin.class
  10. BIN
      lib/bin/net/java/games/input/OSXEnvironmentPlugin.class
  11. BIN
      lib/bin/net/java/games/input/RawInputEnvironmentPlugin.class
  12. BIN
      lib/jinput.jar
  13. 26
      src/sig/RabiClone.java

Binary file not shown.

@ -51,19 +51,6 @@ public class RabiClone{
public static long lastControllerScan = System.currentTimeMillis();
private static ControllerEnvironment createDefaultEnvironment() throws ReflectiveOperationException {
// Find constructor (class is package private, so we can't access it directly)
Constructor<ControllerEnvironment> constructor = (Constructor<ControllerEnvironment>)
Class.forName("net.java.games.input.DefaultControllerEnvironment").getDeclaredConstructors()[0];
// Constructor is package private, so we have to deactivate access control checks
constructor.setAccessible(true);
// Create object with default constructor
return constructor.newInstance();
}
public static void main(String[] args) {
Key.InitializeKeyConversionMap();
@ -95,11 +82,7 @@ public class RabiClone{
long lastGameTime = System.nanoTime();
try {
CONTROLLERS = createDefaultEnvironment().getControllers();
} catch (ReflectiveOperationException e) {
e.printStackTrace();
}
CONTROLLERS = ControllerEnvironment.getDefaultEnvironment().getControllers();
while (true) {
long timePassed = System.nanoTime()-lastGameTime;
lastGameTime=System.nanoTime();
@ -150,11 +133,8 @@ public class RabiClone{
OBJ.add(new ConfigureControls(p));
}
if (Key.isKeyHeld(KeyEvent.VK_F5)&&System.currentTimeMillis()-lastControllerScan>5000) {
try {
CONTROLLERS=createDefaultEnvironment().getControllers();
} catch (ReflectiveOperationException e) {
e.printStackTrace();
}
CONTROLLERS=ControllerEnvironment.getDefaultEnvironment().rescanControllers();
lastControllerScan=System.currentTimeMillis();
}
for (int i=0;i<OBJ.size();i++) {

Loading…
Cancel
Save