diff options
Diffstat (limited to 'Source/Android/src')
4 files changed, 11 insertions, 22 deletions
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java index b49763b862..62f64f0ea2 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java @@ -84,7 +84,6 @@ public final class DolphinEmulator extends Activity if(!file.exists()) { NativeLibrary.CreateUserFolders(); - CopyAsset("GCPadNew.ini", ConfigDir + File.separator + "GCPadNew.ini"); CopyAsset("Dolphin.ini", ConfigDir + File.separator + "Dolphin.ini"); CopyAsset("dsp_coef.bin", GCDir + File.separator + "dsp_coef.bin"); CopyAsset("dsp_rom.bin", GCDir + File.separator + "dsp_rom.bin"); @@ -93,6 +92,10 @@ public final class DolphinEmulator extends Activity CopyAssetFolder("Shaders", BaseDir + File.separator + "Shaders"); } + // Always copy over the GCPad config in case of change or corruption. + // Not a user configurable file. + CopyAsset("GCPadNew.ini", ConfigDir + File.separator + "GCPadNew.ini"); + // Load the configuration keys set in the Dolphin ini and gfx ini files // into the application's shared preferences. UserPreferences.LoadIniToPrefs(this); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java b/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java index 6b5cca1448..b66aa0a84f 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/NativeLibrary.java @@ -54,23 +54,9 @@ public final class NativeLibrary } /** - * Handles touch events. - * - * @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 padID, int Button, int Action); - - /** - * Handles axis-related touch events. - * - * @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). + * Default touchscreen device */ - public static native void onTouchAxisEvent(int padID, int Axis, float force); + public static final String TouchScreenDevice = "Touchscreen"; /** * Handles button press events for a gamepad. diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java index cb13b9e2d6..b28653e03b 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java @@ -290,10 +290,10 @@ public final class EmulationActivity extends Activity } // Normal key events. - action = 0; + action = NativeLibrary.ButtonState.PRESSED; break; case KeyEvent.ACTION_UP: - action = 1; + action = NativeLibrary.ButtonState.RELEASED; break; default: return false; 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 5df8841814..0d5a8580da 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/emulation/overlay/InputOverlay.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/emulation/overlay/InputOverlay.java @@ -123,14 +123,14 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener { if (button.getBounds().contains((int)event.getX(), (int)event.getY())) { - NativeLibrary.onTouchEvent(0, button.getId(), buttonState); + NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, button.getId(), buttonState); } else { // Because the above code only changes the state for the button that is being touched, sliding off the // button does not allow for it to be released. Release the button as soon as the touch coordinates leave // the button bounds. - NativeLibrary.onTouchEvent(0, button.getId(), ButtonState.RELEASED); + NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, button.getId(), ButtonState.RELEASED); } } @@ -142,7 +142,7 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener float[] axises = joystick.getAxisValues(); for (int i = 0; i < 4; i++) - NativeLibrary.onTouchAxisEvent(0, axisIDs[i], axises[i]); + NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, axisIDs[i], axises[i]); } return true; |
