From f6f2b1fc60067b19068f2d0edbbfbfe5e73a0806 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sun, 24 Nov 2013 15:04:53 -0600 Subject: [Android-overlay] Support multiple gamepads with touch screen controls. --- .../Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java | 10 ++++++---- .../dolphinemu/dolphinemu/emulation/overlay/InputOverlay.java | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'Source/Android/src') diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java b/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java index 7745deadba..ac6275301d 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java @@ -56,19 +56,21 @@ public final class NativeLibrary /** * Handles touch events. * - * @param Button Key code identifying which button was pressed. + * @param padID Identifier for which GCpad 0-3, + * @param Button Key code identifying which button was pressed, * @param Action Mask for the action being performed. */ - public static native void onTouchEvent(int Button, int Action); + public static native void onTouchEvent(int padID, int Button, int Action); /** * Handles axis-related touch events. * - * @param Axis Axis ID for the type of axis being altered. (Example: Main stick up, down, left, right, etc). + * @param padID Identifier for which GCpad 0-3, + * @param Axis Axis ID for the type of axis being altered. (Example: Main stick up, down, left, right, etc), * @param force How 'far down' the joystick is pushed down. 0.0f indicates center (or no force), * 1.0f indicates max force (or joystick pushed all the way down in any arbitrary direction). */ - public static native void onTouchAxisEvent(int Axis, float force); + public static native void onTouchAxisEvent(int padID, int Axis, float force); /** * Handles button press events for a gamepad. diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/emulation/overlay/InputOverlay.java b/Source/Android/src/org/dolphinemu/dolphinemu/emulation/overlay/InputOverlay.java index 26f628ed46..4f34df7dc6 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/emulation/overlay/InputOverlay.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/emulation/overlay/InputOverlay.java @@ -96,15 +96,15 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener switch (button.getId()) { case ButtonType.BUTTON_A: - NativeLibrary.onTouchEvent(ButtonType.BUTTON_A, buttonState); + NativeLibrary.onTouchEvent(0, ButtonType.BUTTON_A, buttonState); break; case ButtonType.BUTTON_B: - NativeLibrary.onTouchEvent(ButtonType.BUTTON_B, buttonState); + NativeLibrary.onTouchEvent(0, ButtonType.BUTTON_B, buttonState); break; case ButtonType.BUTTON_START: - NativeLibrary.onTouchEvent(ButtonType.BUTTON_START, buttonState); + NativeLibrary.onTouchEvent(0, ButtonType.BUTTON_START, buttonState); break; default: @@ -121,7 +121,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener for (int a = 0; a < 4; ++a) { - NativeLibrary.onTouchAxisEvent(axisIDs[a], axises[a]); + NativeLibrary.onTouchAxisEvent(0, axisIDs[a], axises[a]); } } -- cgit v1.2.3