Migrated libgdx 1.9.13 -> 1.9.14

Migrated libgdx 1.9.13 -> 1.9.14
Removed gdx-jnigen dependency (waterfalled from within gdx-video correctly now)
Separated gdx-controllers version 1.9.14 -> 2.2.0
Changed HeadlessApplicationConfiguration#renderInterval to #updatedPerSecond
This commit is contained in:
Collin Smith 2021-05-28 15:30:15 -07:00
parent 894e94ea05
commit 0eea5e2793
18 changed files with 25 additions and 22 deletions

View File

@ -48,7 +48,7 @@ dependencies {
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
implementation "com.badlogicgames.gdx:gdx-controllers-android:$gdxVersion"
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-android:$gdxControllersVersion"
}
dependencies {

View File

@ -28,7 +28,7 @@
-dontwarn com.badlogic.gdx.jnigen.BuildTarget*
-dontwarn com.badlogic.gdx.graphics.g2d.freetype.FreetypeBuild
-keep class com.badlogic.gdx.controllers.android.AndroidControllers
-keep class com.badlogic.gdx.controllers.android.AndroidControllers { *; }
-keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* {
<init>(com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration);

View File

@ -31,7 +31,7 @@ dependencies {
api "com.badlogicgames.gdx:gdx:$gdxVersion"
api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
api "com.badlogicgames.gdx:gdx-ai:$gdxAiVersion"
api "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
api "com.badlogicgames.gdx-controllers:gdx-controllers-core:$gdxControllersVersion"
}
// Libraries

View File

@ -8,8 +8,6 @@ import com.badlogic.gdx.controllers.Controller;
import com.badlogic.gdx.controllers.ControllerAdapter;
import com.badlogic.gdx.controllers.ControllerListener;
import com.badlogic.gdx.controllers.Controllers;
import com.badlogic.gdx.controllers.PovDirection;
import com.badlogic.gdx.controllers.mappings.Xbox;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Actor;
@ -178,10 +176,10 @@ public class MenuScreen extends ScreenAdapter {
@Override
public boolean buttonDown(Controller controller, int buttonIndex) {
System.out.println(buttonIndex);
if (buttonIndex == Xbox.A) {
if (buttonIndex == controller.getMapping().buttonA) {
EventUtils.click((Button) focus);
return true;
} else if (buttonIndex == Xbox.B) {
} else if (buttonIndex == controller.getMapping().buttonB) {
EventUtils.click(btnExitDiablo);
return true;
}
@ -189,6 +187,11 @@ public class MenuScreen extends ScreenAdapter {
return false;
}
/*
* This API changed and no longer exists.
* Functionality need to migrate into #buttonDown I think
*/
/*
@Override
public boolean povMoved(Controller controller, int povIndex, PovDirection value) {
System.out.println(povIndex + " " + value);
@ -213,6 +216,7 @@ public class MenuScreen extends ScreenAdapter {
return false;
}
*/
@Override
public boolean axisMoved(Controller controller, int axisIndex, float value) {

View File

@ -11,8 +11,7 @@ dependencies {
implementation project(':core')
implementation "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
implementation "com.badlogicgames.gdx:gdx-controllers-desktop:$gdxVersion"
implementation "com.badlogicgames.gdx:gdx-controllers-platform:$gdxVersion:natives-desktop"
implementation "com.badlogicgames.gdx-controllers:gdx-controllers-desktop:$gdxControllersVersion"
implementation "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
implementation "commons-cli:commons-cli:$cliVersion"

View File

@ -4,7 +4,8 @@ org.gradle.configureondemand=false
androidBuildToolsPluginVersion=4.1.1
flatbuffersPluginVersion=1.0.7
gdxVersion=1.9.13
gdxVersion=1.9.14
gdxControllersVersion=2.2.0
artemisOdbVersion=2.3.0
artemisContribVersion=2.4.0
gdxAiVersion=1.8.2

View File

@ -160,7 +160,7 @@ public class D2GS extends ApplicationAdapter {
}
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
config.renderInterval = Animation.FRAME_DURATION;
config.updatesPerSecond = (int) Animation.FRAMES_PER_SECOND;
new HeadlessApplication(new D2GS(home, seed, diff), config);
}

View File

@ -35,7 +35,7 @@ public class TestClient extends ApplicationAdapter implements PacketProcessor {
public static void main(String[] args) throws Exception {
Thread.sleep(1000);
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
config.renderInterval = Animation.FRAME_DURATION;
config.updatesPerSecond = (int) Animation.FRAMES_PER_SECOND;
new HeadlessApplication(new TestClient(), config);
}

View File

@ -35,7 +35,7 @@ public class TestServer extends ApplicationAdapter implements PacketProcessor {
public static void main(String[] args) {
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
config.renderInterval = Animation.FRAME_DURATION;
config.updatesPerSecond = (int) Animation.FRAMES_PER_SECOND;
new HeadlessApplication(new TestServer(), config);
}

View File

@ -36,7 +36,7 @@ public class TestClient extends ApplicationAdapter implements PacketProcessor {
public static void main(String[] args) throws Exception {
Thread.sleep(1000);
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
config.renderInterval = Animation.FRAME_DURATION;
config.updatesPerSecond = (int) Animation.FRAMES_PER_SECOND;
new HeadlessApplication(new TestClient(), config);
}

View File

@ -31,7 +31,7 @@ public class TestServer extends ApplicationAdapter implements PacketProcessor {
public static void main(String[] args) throws Exception {
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
config.renderInterval = Animation.FRAME_DURATION;
config.updatesPerSecond = (int) Animation.FRAMES_PER_SECOND;
new HeadlessApplication(new TestServer(), config);
}

View File

@ -118,7 +118,7 @@ public class Main extends ApplicationAdapter {
}
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
config.renderInterval = Animation.FRAME_DURATION;
config.updatesPerSecond = (int) Animation.FRAMES_PER_SECOND;
new HeadlessApplication(new Main(home, seed, diff), config);
}

View File

@ -118,7 +118,7 @@ public class Main extends ApplicationAdapter {
}
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
config.renderInterval = Animation.FRAME_DURATION;
config.updatesPerSecond = (int) Animation.FRAMES_PER_SECOND;
new HeadlessApplication(new Main(home, seed, diff), config);
}

View File

@ -46,7 +46,7 @@ public class Main extends ApplicationAdapter implements PacketProcessor {
public static void main(String[] args) {
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
config.renderInterval = Animation.FRAME_DURATION;
config.updatesPerSecond = (int) Animation.FRAMES_PER_SECOND;
new HeadlessApplication(new Main(), config);
}

View File

@ -38,7 +38,7 @@ public class TestClient extends ApplicationAdapter implements PacketProcessor {
public static void main(String[] args) throws Exception {
Thread.sleep(1000);
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
config.renderInterval = Animation.FRAME_DURATION;
config.updatesPerSecond = (int) Animation.FRAMES_PER_SECOND;
new HeadlessApplication(new TestClient(), config);
}

View File

@ -32,7 +32,7 @@ public class Client extends ApplicationAdapter {
public static void main(String[] args) throws Exception {
Thread.sleep(1000);
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
config.renderInterval = Animation.FRAME_DURATION;
config.updatesPerSecond = (int) Animation.FRAMES_PER_SECOND;
new HeadlessApplication(new Client(), config);
}

View File

@ -53,7 +53,7 @@ public class Main extends ApplicationAdapter {
// TODO: process args and setup server
HeadlessApplicationConfiguration config = new HeadlessApplicationConfiguration();
config.renderInterval = Animation.FRAME_DURATION;
config.updatesPerSecond = (int) Animation.FRAMES_PER_SECOND;
new HeadlessApplication(new Main(), config);
}

View File

@ -2,7 +2,6 @@ description = 'Play videos from MPQ archives.'
application.mainClass = 'com.riiablo.video.VideoPlayerTool'
dependencies {
implementation "com.badlogicgames.gdx:gdx-jnigen:$gdxVersion"
implementation "com.badlogicgames.gdx-video:gdx-video:1.3.2-SNAPSHOT"
implementation "com.badlogicgames.gdx-video:gdx-video-lwjgl:1.3.2-SNAPSHOT"
}