Write each analog stick a short at a time. Fix analog stick value endianness.

This commit is contained in:
Cameron Gutman
2013-09-21 23:30:12 -04:00
parent 8c8e6c0008
commit fbbf572c9d
5 changed files with 54 additions and 39 deletions
@@ -19,9 +19,12 @@ public class NvController {
out = s.getOutputStream();
}
public void sendControllerInput(short buttonFlags, byte leftTrigger, byte rightTrigger, int leftStick, int rightStick) throws IOException
public void sendControllerInput(short buttonFlags, byte leftTrigger, byte rightTrigger,
short leftStickX, short leftStickY, short rightStickX, short rightStickY) throws IOException
{
out.write(new NvInputPacket(buttonFlags, leftTrigger, rightTrigger, leftStick, rightStick).toWire());
out.write(new NvInputPacket(buttonFlags, leftTrigger,
rightTrigger, leftStickX, leftStickY,
rightStickX, rightStickY).toWire());
out.flush();
}
}