diff --git a/build.gradle b/build.gradle index 5eb6ec4e8..d416bc2e6 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,10 @@ allprojects { version = '2.0.1' ext { appName = 'DestinationSol' - gdxVersion = '1.9.8' + gdxVersion = '1.9.14' + // The LibGDX controllers library is versioned differently to the main LibGDX versions. + // See https://github.com/libgdx/gdx-controllers/wiki/Compatibility for compatible versions. + gdxControllersVersion = '2.1.0' roboVMVersion = '2.3.3' nuiVersion = '3.1.0-SNAPSHOT' } diff --git a/config/gradle/common.gradle b/config/gradle/common.gradle index acefdad28..579600fa8 100644 --- a/config/gradle/common.gradle +++ b/config/gradle/common.gradle @@ -13,13 +13,6 @@ dependencies { // the FindBugs version is set in the configuration } -version = '2.0.1' -ext { - appName = 'DestinationSol' - gdxVersion = '1.9.8' - roboVMVersion = '2.3.3' -} - sourceCompatibility = 1.8 targetCompatibility = 1.8 diff --git a/desktop/build.gradle b/desktop/build.gradle index 69cf34a5f..237bbccc8 100644 --- a/desktop/build.gradle +++ b/desktop/build.gradle @@ -28,7 +28,7 @@ dependencies { implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" implementation "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop" - implementation "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion" + implementation "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion" implementation group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25' implementation group: 'org.terasology.crashreporter', name: 'cr-destsol', version: '4.0.0' diff --git a/engine/build.gradle b/engine/build.gradle index f9fd95ad9..e060ef168 100644 --- a/engine/build.gradle +++ b/engine/build.gradle @@ -27,20 +27,19 @@ buildscript { classpath 'dom4j:dom4j:1.6.1' // HACK: Needed for NUI and gestalt entity-component reflections - classpath group: 'org.terasology.nui', name: 'nui', version: '3.1.0-SNAPSHOT' + classpath group: 'org.terasology.nui', name: 'nui', version: nuiVersion classpath group: 'javax.servlet', name: 'javax.servlet-api', version: '3.0.1' classpath group: 'org.terasology.gestalt', name: 'gestalt-entity-system', version: '7.2.0-SNAPSHOT' } } dependencies { - api group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' api group: 'com.google.code.gson', name: 'gson', version: '2.6.2' api "com.badlogicgames.gdx:gdx:$gdxVersion" api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" - api "com.badlogicgames.gdx:gdx-controllers:$gdxVersion" + api "com.badlogicgames.gdx-controllers:gdx-controllers-core:$gdxControllersVersion" api(group: 'org.terasology.gestalt', name: 'gestalt-asset-core', version: '7.2.0-SNAPSHOT') api(group: 'org.terasology.gestalt', name: 'gestalt-entity-system', version: '7.2.0-SNAPSHOT') @@ -62,8 +61,7 @@ dependencies { testImplementation "com.badlogicgames.gdx:gdx-backend-headless:$gdxVersion" testImplementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" testImplementation "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop" - testImplementation "com.badlogicgames.gdx:gdx-controllers-desktop:$gdxVersion" - testImplementation "com.badlogicgames.gdx:gdx-controllers-platform:$gdxVersion:natives-desktop" + testImplementation "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion" // Test lib dependencies testCompile("org.junit.jupiter:junit-jupiter-api:5.5.2") diff --git a/engine/src/main/java/org/destinationsol/game/screens/ShipControllerControl.java b/engine/src/main/java/org/destinationsol/game/screens/ShipControllerControl.java index b97018c3b..1dd791276 100644 --- a/engine/src/main/java/org/destinationsol/game/screens/ShipControllerControl.java +++ b/engine/src/main/java/org/destinationsol/game/screens/ShipControllerControl.java @@ -18,8 +18,6 @@ import com.badlogic.gdx.controllers.Controller; import com.badlogic.gdx.controllers.ControllerListener; import com.badlogic.gdx.controllers.Controllers; -import com.badlogic.gdx.controllers.PovDirection; -import com.badlogic.gdx.math.Vector3; import org.destinationsol.GameOptions; import org.destinationsol.SolApplication; import org.slf4j.Logger; @@ -161,30 +159,6 @@ public boolean axisMoved(Controller controller, int axisIndex, float value) { return true; } - - @Override - public boolean povMoved(Controller controller, int povIndex, PovDirection value) { - logger.debug("#{}, pov {}: {}", indexOf(controller), povIndex, value); - return false; - } - - @Override - public boolean xSliderMoved(Controller controller, int sliderIndex, boolean value) { - logger.debug("#{}, x slider {}: {}", indexOf(controller), sliderIndex, value); - return false; - } - - @Override - public boolean ySliderMoved(Controller controller, int sliderIndex, boolean value) { - logger.debug("#{}, y slider {}: {}", indexOf(controller), sliderIndex, value); - return false; - } - - @Override - public boolean accelerometerMoved(Controller controller, int accelerometerIndex, Vector3 value) { - // not printing this as we get too many values - return false; - } }); } diff --git a/engine/src/main/java/org/destinationsol/menu/InputMapControllerScreen.java b/engine/src/main/java/org/destinationsol/menu/InputMapControllerScreen.java index b633eeff3..d1a75087c 100644 --- a/engine/src/main/java/org/destinationsol/menu/InputMapControllerScreen.java +++ b/engine/src/main/java/org/destinationsol/menu/InputMapControllerScreen.java @@ -23,8 +23,6 @@ import com.badlogic.gdx.controllers.Controller; import com.badlogic.gdx.controllers.ControllerListener; import com.badlogic.gdx.controllers.Controllers; -import com.badlogic.gdx.controllers.PovDirection; -import com.badlogic.gdx.math.Vector3; import org.destinationsol.GameOptions; import org.destinationsol.SolApplication; import org.slf4j.Logger; @@ -331,26 +329,6 @@ public boolean axisMoved(Controller controller, int axisIndex, float value) { } return true; } - - @Override - public boolean povMoved(Controller controller, int povIndex, PovDirection value) { - return false; - } - - @Override - public boolean xSliderMoved(Controller controller, int sliderIndex, boolean value) { - return false; - } - - @Override - public boolean ySliderMoved(Controller controller, int sliderIndex, boolean value) { - return false; - } - - @Override - public boolean accelerometerMoved(Controller controller, int accelerometerIndex, Vector3 value) { - return false; - } }); } } diff --git a/engine/src/main/java/org/destinationsol/ui/SolInputProcessor.java b/engine/src/main/java/org/destinationsol/ui/SolInputProcessor.java index 986f9af9b..0d09036b4 100644 --- a/engine/src/main/java/org/destinationsol/ui/SolInputProcessor.java +++ b/engine/src/main/java/org/destinationsol/ui/SolInputProcessor.java @@ -71,8 +71,8 @@ public boolean mouseMoved(int screenX, int screenY) { } @Override - public boolean scrolled(int amount) { - inputManager.scrolled(amount > 0); + public boolean scrolled(float amountX, float amountY) { + inputManager.scrolled(amountY > 0); return false; } } diff --git a/engine/src/test/java/org/destinationsol/testingUtilities/MockGL.java b/engine/src/test/java/org/destinationsol/testingUtilities/MockGL.java index e7caf8e72..fb0f13e7d 100644 --- a/engine/src/test/java/org/destinationsol/testingUtilities/MockGL.java +++ b/engine/src/test/java/org/destinationsol/testingUtilities/MockGL.java @@ -424,12 +424,12 @@ public void glGenRenderbuffers(int n, IntBuffer renderbuffers) { } @Override - public String glGetActiveAttrib(int program, int index, IntBuffer size, Buffer type) { + public String glGetActiveAttrib(int program, int index, IntBuffer size, IntBuffer type) { return "NULL"; } @Override - public String glGetActiveUniform(int program, int index, IntBuffer size, Buffer type) { + public String glGetActiveUniform(int program, int index, IntBuffer size, IntBuffer type) { return "NULL"; }