Preserve minor optimizations before next test

This commit is contained in:
Travis Nickles 2017-07-13 07:27:25 -05:00
parent c0403fa7ab
commit c5dd97ebe5
3 changed files with 9 additions and 8 deletions

View File

@ -37,7 +37,7 @@ namespace DS4Windows
public virtual void sixaxisMoved(SixAxisEventArgs arg)
{
int deltaX = 0, deltaY = 0;
deltaX = -arg.sixAxis.gyroYawFull;
deltaX = arg.sixAxis.gyroYawFull;
deltaY = -arg.sixAxis.gyroPitchFull;
//Console.WriteLine(arg.sixAxis.deltaX);
@ -61,12 +61,12 @@ namespace DS4Windows
int signX = System.Math.Sign(deltaX);
int signY = System.Math.Sign(deltaY);
if ((hRemainder > 0) != (deltaX > 0))
if (deltaX == 0 || (hRemainder > 0 != deltaX > 0))
{
hRemainder = 0.0;
}
if ((vRemainder > 0) != (deltaY > 0))
if (deltaY == 0 || (vRemainder > 0 != deltaY > 0))
{
vRemainder = 0.0;
}
@ -170,10 +170,10 @@ namespace DS4Windows
//vRemainder -= (int)vRemainder;
int gyroInvert = Global.getGyroInvert(deviceNumber);
if (gyroInvert == 2 || gyroInvert == 3)
if ((gyroInvert & 0x02) == 2)
xAction *= -1;
if (gyroInvert == 1 || gyroInvert == 3)
if ((gyroInvert & 0x01) == 1)
yAction *= -1;
if (yAction != 0 || xAction != 0)

View File

@ -25,9 +25,9 @@ namespace DS4Windows
gyroX = X / 256;
gyroY = Y / 256;
gyroZ = Z / 256;
gyroYawFull = X;
gyroYawFull = -X;
gyroPitchFull = Y;
gyroRollFull = Z;
gyroRollFull = -Z;
accelX = aX / 64;
accelY = aY / 64;

View File

@ -8,7 +8,8 @@ namespace DS4Windows
public bool Square, Triangle, Circle, Cross;
public bool DpadUp, DpadDown, DpadLeft, DpadRight;
public bool L1, L3, R1, R3;
public bool Share, Options, PS, Touch1, Touch2, TouchButton, TouchRight, TouchLeft, Touch1Finger, Touch2Fingers;
public bool Share, Options, PS, Touch1, Touch2, TouchButton, TouchRight,
TouchLeft, Touch1Finger, Touch2Fingers;
public byte Touch1Identifier, Touch2Identifier;
public byte LX, RX, LY, RY, L2, R2;
public byte FrameCounter; // 0, 1, 2...62, 63, 0....