-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
haptic support on iOS #26
Comments
Yes, check might be needed - I only have an Xbox controller to test with so did not notice the problem. |
Wanted to do it myself, but ran into a bunch of version mismatches trying to build things (gradle,maven,jdk,androidsdk,etc) - and currently in a big game-update flow where things work, so don't want to update or change ANY versions right now :D hopefully someone with contribution skills can do a quick fix for a nightly? wink wink, please,please (think it's a matter of checking if controller.getHaptics() returns null before calling createEngine) |
Tested the fix on a local version of the library, and it works and makes sure all non-haptic supporting controllers don't break the whole controller support.
If someone more familiar with git+libgdx could push a proper code update so I don't mess things up that would be great :) For now I'll use my modified lib so I can push updates to my games. |
It would have been enough when you had just opened a PR with the change. I just made the button click for you. |
Lost controller support in my games on iOS15 (and 14) and traced it back to this code:
Tried various controllers, and I'm guessing they just don't have haptic support (or don't provide it to iOS).
And from the Apple documents it says that getHaptics() might return nil if not available.
So should this get a check first? Because right now the controller isn't created because it throws the error for the haptics engine, even tho the controller will work just fine (it does on iOS<14 when this code is skipped)
(for completeness, error given on ios15:
Controllers: Failed to create haptics engine
java.lang.NullPointerException
at com.badlogic.gdx.controllers.IosController.(IosController.java:83)
at com.badlogic.gdx.controllers.IosControllerManager.onControllerConnect(IosControllerManager.java:116)
at com.badlogic.gdx.controllers.IosControllerManager$1.invoke(IosControllerManager.java:89)
at com.badlogic.gdx.controllers.IosControllerManager$1.invoke(IosControllerManager.java:86)
at org.robovm.apple.gamecontroller.GCController$Notifications$1.invoke(GCController.java:49)
at org.robovm.apple.gamecontroller.GCController$Notifications$1.invoke(GCController.java:46)
at org.robovm.apple.foundation.NSNotificationCenter$$BlockMarshaler0.invoked(Unknown Source)
at org.robovm.apple.uikit.UIApplication.main(Native Method)
at org.robovm.apple.uikit.UIApplication.main(UIApplication.java:433)
at com.orangepixel.residual.IOSLauncher.main(IOSLauncher.java:35)
)
tested with a MadCatz mfi controller but also a standard PS4 - both work fine if running on iOS13
The text was updated successfully, but these errors were encountered: