From dc51b95313d0903bc82d941d66450a95c2b0f85e Mon Sep 17 00:00:00 2001 From: zackhow Date: Sat, 23 Mar 2019 08:07:56 -0400 Subject: [PATCH] Android: fix touch ir from pr7829 changes --- .../dolphinemu/dolphinemu/overlay/InputOverlay.java | 12 +++++++----- .../dolphinemu/overlay/InputOverlayPointer.java | 10 ++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java index c2f0ca473e..40e4a3d6ed 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java @@ -298,12 +298,14 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener if (!pressed && overlayPointer != null) { overlayPointer.onTouch(event); - float[] axises = overlayPointer.getAxisValues(); + float[] axes = overlayPointer.getAxisValues(); - NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR + 2, - axises[0]); - NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR + 4, - axises[1]); + for (int i = 0; i < 4; i++) + { + NativeLibrary + .onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR_UP + i, + axes[i]); + } } invalidate(); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayPointer.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayPointer.java index 8280e73913..18ce190f15 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayPointer.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayPointer.java @@ -127,9 +127,11 @@ public class InputOverlayPointer public float[] getAxisValues() { - float[] ir = {0f, 0f}; - ir[0] = axes[0]; - ir[1] = axes[1]; - return axes; + float[] iraxes = {0f, 0f, 0f, 0f}; + iraxes[1] = axes[0]; + iraxes[0] = axes[0]; + iraxes[3] = axes[1]; + iraxes[2] = axes[1]; + return iraxes; } }