diff options
| author | Lioncash <mathew1800@gmail.com> | 2013-08-13 09:23:11 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2013-08-13 09:23:11 -0400 |
| commit | 2015484c24b817b9980d0f59e0cde1a4435cc789 (patch) | |
| tree | 26fea3b8e03617ad9c939f6fd14a502f46de000f /Source/Android/src | |
| parent | 0916d0797c0d6e2da6e9b59f2ac92cfc99b569c4 (diff) | |
[Android] Some tiny cleanups in DolphinEmulator.java
- Join variable declaration and assignments in function onTouchEvent()
- Change a for-loop into a foreach loop in dispatchGenericMotionEvent(). Makes the loop body a single statement.
Diffstat (limited to 'Source/Android/src')
| -rw-r--r-- | Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java index 40e5b6e98a..d4177de5a4 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java @@ -143,11 +143,9 @@ public class DolphinEmulator<MainActivity> extends Activity @Override public boolean onTouchEvent(MotionEvent event) { - float X, Y; - int Action; - X = event.getX(); - Y = event.getY(); - Action = event.getActionMasked(); + float X = event.getX(); + float Y = event.getY(); + int Action = event.getActionMasked(); // Converts button locations 0 - 1 to OGL screen coords -1.0 - 1.0 float ScreenX = ((X / screenWidth) * 2.0f) - 1.0f; @@ -207,14 +205,13 @@ public class DolphinEmulator<MainActivity> extends Activity InputDevice input = event.getDevice(); List<InputDevice.MotionRange> motions = input.getMotionRanges(); - for (int a = 0; a < motions.size(); ++a) + + for (InputDevice.MotionRange range : motions) { - InputDevice.MotionRange range; - range = motions.get(a); - NativeLibrary.onGamePadMoveEvent(InputConfigFragment.getInputDesc(input), range.getAxis(), event.getAxisValue(range.getAxis())); + NativeLibrary.onGamePadMoveEvent(InputConfigFragment.getInputDesc(input), range.getAxis(), event.getAxisValue(range.getAxis())); } return true; } -}
\ No newline at end of file +}
\ No newline at end of file |
