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)
{
overlayPointer.onTouch(event);
float[] axises = overlayPointer.getAxisValues();
float[] axes = overlayPointer.getAxisValues();
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR + 2,
axises[0]);
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR + 4,
axises[1]);
for (int i = 0; i < 4; i++)
{
NativeLibrary
.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR_UP + i,
axes[i]);
}
}
invalidate();

View File

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