Moved two function calls so they are only called if needed.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sun, 10 Nov 2013 14:58:48 +0100
changeset 7932 00dae1905359
parent 7931 1989d1cf3cf3
child 7933 1515c5b47174
Moved two function calls so they are only called if needed. If the MotionEvent is not from joystick the return values are not needed.
android-project/src/org/libsdl/app/SDLActivity.java
--- a/android-project/src/org/libsdl/app/SDLActivity.java	Sun Nov 10 14:50:37 2013 +0100
+++ b/android-project/src/org/libsdl/app/SDLActivity.java	Sun Nov 10 14:58:48 2013 +0100
@@ -890,10 +890,9 @@
     // We only have joysticks yet
     @Override
     public boolean onGenericMotion(View v, MotionEvent event) {
-        int actionPointerIndex = event.getActionIndex();
-        int action = event.getActionMasked();
-        
         if ( (event.getSource() & InputDevice.SOURCE_JOYSTICK) != 0) {
+            int actionPointerIndex = event.getActionIndex();
+            int action = event.getActionMasked();
             switch(action) {
                 case MotionEvent.ACTION_MOVE:
                     int id = SDLActivity.getJoyId( event.getDeviceId() );
@@ -906,4 +905,4 @@
         }
         return true;
     }
-}
\ No newline at end of file
+}