mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-25 15:15:36 +00:00
Moved two function calls so they are only called if needed.
If the MotionEvent is not from joystick the return values are not needed.
This commit is contained in:
parent
aa3379802b
commit
fda8d93440
|
@ -890,10 +890,9 @@ class SDLGenericMotionHandler_API12 extends Activity implements View.OnGenericMo
|
||||||
// We only have joysticks yet
|
// We only have joysticks yet
|
||||||
@Override
|
@Override
|
||||||
public boolean onGenericMotion(View v, MotionEvent event) {
|
public boolean onGenericMotion(View v, MotionEvent event) {
|
||||||
|
if ( (event.getSource() & InputDevice.SOURCE_JOYSTICK) != 0) {
|
||||||
int actionPointerIndex = event.getActionIndex();
|
int actionPointerIndex = event.getActionIndex();
|
||||||
int action = event.getActionMasked();
|
int action = event.getActionMasked();
|
||||||
|
|
||||||
if ( (event.getSource() & InputDevice.SOURCE_JOYSTICK) != 0) {
|
|
||||||
switch(action) {
|
switch(action) {
|
||||||
case MotionEvent.ACTION_MOVE:
|
case MotionEvent.ACTION_MOVE:
|
||||||
int id = SDLActivity.getJoyId( event.getDeviceId() );
|
int id = SDLActivity.getJoyId( event.getDeviceId() );
|
||||||
|
|
Loading…
Reference in a new issue