Skip to content

Commit

Permalink
Merge pull request #32 from orangepascal/master
Browse files Browse the repository at this point in the history
fixed issue with iOS15 controller support
  • Loading branch information
MrStahlfelge committed Apr 27, 2023
2 parents 88092dd + fb185a1 commit fc0af91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* @author Nathan Sweet */
public class Controllers {
private static final String TAG = "Controllers";
private static final String TAG = "ControllersOP";
static final ObjectMap<Application, ControllerManager> managers = new ObjectMap<Application, ControllerManager>();
/**
* The class name of a preferred {@link ControllerManager}. If this is null then an appropriate ControllerManager will
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ public void invoke(GCGamepad gcGamepad, GCControllerElement gcControllerElement)
});

if (Foundation.getMajorSystemVersion() >= 14) try {
hapticEngine = controller.getHaptics().createEngine(GCHapticsLocality.Default);
hapticEngine.retain();
if (controller.getHaptics()!=null) {
hapticEngine = controller.getHaptics().createEngine(GCHapticsLocality.Default);
hapticEngine.retain();
}
} catch (Throwable t) {
Gdx.app.error("Controllers", "Failed to create haptics engine", t);
}
Expand Down

0 comments on commit fc0af91

Please sign in to comment.