mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-11 15:59:08 +01:00
Preserve minor optimizations before next test
This commit is contained in:
parent
c0403fa7ab
commit
c5dd97ebe5
@ -37,7 +37,7 @@ namespace DS4Windows
|
|||||||
public virtual void sixaxisMoved(SixAxisEventArgs arg)
|
public virtual void sixaxisMoved(SixAxisEventArgs arg)
|
||||||
{
|
{
|
||||||
int deltaX = 0, deltaY = 0;
|
int deltaX = 0, deltaY = 0;
|
||||||
deltaX = -arg.sixAxis.gyroYawFull;
|
deltaX = arg.sixAxis.gyroYawFull;
|
||||||
deltaY = -arg.sixAxis.gyroPitchFull;
|
deltaY = -arg.sixAxis.gyroPitchFull;
|
||||||
//Console.WriteLine(arg.sixAxis.deltaX);
|
//Console.WriteLine(arg.sixAxis.deltaX);
|
||||||
|
|
||||||
@ -61,12 +61,12 @@ namespace DS4Windows
|
|||||||
int signX = System.Math.Sign(deltaX);
|
int signX = System.Math.Sign(deltaX);
|
||||||
int signY = System.Math.Sign(deltaY);
|
int signY = System.Math.Sign(deltaY);
|
||||||
|
|
||||||
if ((hRemainder > 0) != (deltaX > 0))
|
if (deltaX == 0 || (hRemainder > 0 != deltaX > 0))
|
||||||
{
|
{
|
||||||
hRemainder = 0.0;
|
hRemainder = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((vRemainder > 0) != (deltaY > 0))
|
if (deltaY == 0 || (vRemainder > 0 != deltaY > 0))
|
||||||
{
|
{
|
||||||
vRemainder = 0.0;
|
vRemainder = 0.0;
|
||||||
}
|
}
|
||||||
@ -170,10 +170,10 @@ namespace DS4Windows
|
|||||||
//vRemainder -= (int)vRemainder;
|
//vRemainder -= (int)vRemainder;
|
||||||
|
|
||||||
int gyroInvert = Global.getGyroInvert(deviceNumber);
|
int gyroInvert = Global.getGyroInvert(deviceNumber);
|
||||||
if (gyroInvert == 2 || gyroInvert == 3)
|
if ((gyroInvert & 0x02) == 2)
|
||||||
xAction *= -1;
|
xAction *= -1;
|
||||||
|
|
||||||
if (gyroInvert == 1 || gyroInvert == 3)
|
if ((gyroInvert & 0x01) == 1)
|
||||||
yAction *= -1;
|
yAction *= -1;
|
||||||
|
|
||||||
if (yAction != 0 || xAction != 0)
|
if (yAction != 0 || xAction != 0)
|
||||||
|
@ -25,9 +25,9 @@ namespace DS4Windows
|
|||||||
gyroX = X / 256;
|
gyroX = X / 256;
|
||||||
gyroY = Y / 256;
|
gyroY = Y / 256;
|
||||||
gyroZ = Z / 256;
|
gyroZ = Z / 256;
|
||||||
gyroYawFull = X;
|
gyroYawFull = -X;
|
||||||
gyroPitchFull = Y;
|
gyroPitchFull = Y;
|
||||||
gyroRollFull = Z;
|
gyroRollFull = -Z;
|
||||||
|
|
||||||
accelX = aX / 64;
|
accelX = aX / 64;
|
||||||
accelY = aY / 64;
|
accelY = aY / 64;
|
||||||
|
@ -8,7 +8,8 @@ namespace DS4Windows
|
|||||||
public bool Square, Triangle, Circle, Cross;
|
public bool Square, Triangle, Circle, Cross;
|
||||||
public bool DpadUp, DpadDown, DpadLeft, DpadRight;
|
public bool DpadUp, DpadDown, DpadLeft, DpadRight;
|
||||||
public bool L1, L3, R1, R3;
|
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 Touch1Identifier, Touch2Identifier;
|
||||||
public byte LX, RX, LY, RY, L2, R2;
|
public byte LX, RX, LY, RY, L2, R2;
|
||||||
public byte FrameCounter; // 0, 1, 2...62, 63, 0....
|
public byte FrameCounter; // 0, 1, 2...62, 63, 0....
|
||||||
|
Loading…
x
Reference in New Issue
Block a user