Android: fix touch ir from pr7829 changes

This commit is contained in:
zackhow 2019-03-23 08:07:56 -04:00
parent 672b582bec
commit dc51b95313
2 changed files with 13 additions and 9 deletions

View File

@ -298,12 +298,14 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
if (!pressed && overlayPointer != null) if (!pressed && overlayPointer != null)
{ {
overlayPointer.onTouch(event); overlayPointer.onTouch(event);
float[] axises = overlayPointer.getAxisValues(); float[] axes = overlayPointer.getAxisValues();
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR + 2, for (int i = 0; i < 4; i++)
axises[0]); {
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR + 4, NativeLibrary
axises[1]); .onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR_UP + i,
axes[i]);
}
} }
invalidate(); invalidate();

View File

@ -127,9 +127,11 @@ public class InputOverlayPointer
public float[] getAxisValues() public float[] getAxisValues()
{ {
float[] ir = {0f, 0f}; float[] iraxes = {0f, 0f, 0f, 0f};
ir[0] = axes[0]; iraxes[1] = axes[0];
ir[1] = axes[1]; iraxes[0] = axes[0];
return axes; iraxes[3] = axes[1];
iraxes[2] = axes[1];
return iraxes;
} }
} }