From f773a8ecf8a2b02c444b9326972047124b07e892 Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Fri, 28 Aug 2015 11:07:03 -0500 Subject: [PATCH] Remove jinput dependency since controllers aren't used. jinput natives are no longer loaded or packaged in the jar. Excluded the lwjgl dependency within the slick2d package since it depends on an older version (2.9.1) of lwjgl. Signed-off-by: Jeffrey Han --- build.gradle | 8 ++++++-- pom.xml | 12 ++++++++++++ src/itdelatrisu/opsu/Opsu.java | 9 +++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 544eee25..33328c42 100644 --- a/build.gradle +++ b/build.gradle @@ -30,8 +30,12 @@ repositories { } dependencies { - compile 'org.lwjgl.lwjgl:lwjgl:2.9.3' - compile 'org.slick2d:slick2d-core:1.0.1' + compile('org.lwjgl.lwjgl:lwjgl:2.9.3') { + exclude group: 'net.java.jinput', module: 'jinput' + } + compile('org.slick2d:slick2d-core:1.0.1') { + exclude group: 'org.lwjgl.lwjgl', module: 'lwjgl' + } compile 'org.jcraft:jorbis:0.0.17' compile 'net.lingala.zip4j:zip4j:1.3.2' compile 'com.googlecode.soundlibs:jlayer:1.0.1-1' diff --git a/pom.xml b/pom.xml index 72e1f62e..ee62a0e3 100644 --- a/pom.xml +++ b/pom.xml @@ -126,11 +126,23 @@ org.lwjgl.lwjgl lwjgl 2.9.3 + + + net.java.jinput + jinput + + org.slick2d slick2d-core 1.0.1 + + + org.lwjgl.lwjgl + lwjgl + + org.jcraft diff --git a/src/itdelatrisu/opsu/Opsu.java b/src/itdelatrisu/opsu/Opsu.java index fc67d143..ec76eccc 100644 --- a/src/itdelatrisu/opsu/Opsu.java +++ b/src/itdelatrisu/opsu/Opsu.java @@ -30,6 +30,7 @@ import java.net.UnknownHostException; import org.newdawn.slick.Color; import org.newdawn.slick.GameContainer; +import org.newdawn.slick.Input; import org.newdawn.slick.SlickException; import org.newdawn.slick.state.StateBasedGame; import org.newdawn.slick.state.transition.FadeInTransition; @@ -133,8 +134,9 @@ public class Opsu extends StateBasedGame { } File nativeDir; - if ((nativeDir = new File("./target/natives/")).isDirectory() || - (nativeDir = new File("./build/natives/")).isDirectory()) + if (!Utils.isJarRunning() && ( + (nativeDir = new File("./target/natives/")).isDirectory() || + (nativeDir = new File("./build/natives/")).isDirectory())) ; else { nativeDir = NativeLoader.NATIVE_DIR; @@ -184,6 +186,9 @@ public class Opsu extends StateBasedGame { }.start(); } + // disable jinput + Input.disableControllers(); + // start the game try { // loop until force exit