requesting xinput will always fail on non-windows

This commit is contained in:
Minjae Song
2019-03-04 04:55:12 +09:00
parent efa5d21717
commit 3f213cfbe0
3 changed files with 7 additions and 2 deletions

0
gradlew vendored Normal file → Executable file
View File

View File

@@ -335,7 +335,12 @@ public class AppLoader implements ApplicationListener {
}
// nullify if not actually connected
if (!((XinputControllerAdapter) gamepad).getC().isConnected()) {
try {
if (!((XinputControllerAdapter) gamepad).getC().isConnected()) {
gamepad = null;
}
}
catch (NullPointerException notQuiteWindows) {
gamepad = null;
}
}

View File

@@ -220,7 +220,7 @@ class TitleScreen(val batch: SpriteBatch) : Screen {
// render? just do it anyway
AppLoader.measureDebugTime("Ingame.render") { renderScreen() }
AppLoader.setDebugTime("Ingame.render-Light",
(AppLoader.debugTimers["Ingame.render"] as Long) - ((AppLoader.debugTimers["Renderer.LightTotal"] as? Long) ?: 0)
((AppLoader.debugTimers["Ingame.render"] as? Long) ?: 0) - ((AppLoader.debugTimers["Renderer.LightTotal"] as? Long) ?: 0)
)
}