From fd9c56f13d2fd21c5f9e066774e0f153980c681f Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 13 Jan 2018 04:00:57 -0600 Subject: [PATCH] Fix output curves for sixaxis --- DS4Windows/DS4Control/Mapping.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index 729c4bb..bf75e1b 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -972,34 +972,34 @@ namespace DS4Windows int sxOutCurveMode = tempIntArray[device] = getSXOutCurveMode(device); if (sxOutCurveMode > 0) { - double temp = Math.Abs(dState.Motion.outputAccelX) / 128.0; + double temp = dState.Motion.outputAccelX / 128.0; double sign = Math.Sign(temp); if (sxOutCurveMode == 1) { double output = temp * temp; - dState.Motion.outputAccelX = (byte)(output * sign * 128.0); + dState.Motion.outputAccelX = (int)(output * sign * 128.0); } else if (sxOutCurveMode == 2) { double output = temp * temp * temp; - dState.Motion.outputAccelX = (byte)(output * 128.0); + dState.Motion.outputAccelX = (int)(output * 128.0); } } int szOutCurveMode = tempIntArray[device] = getSZOutCurveMode(device); if (szOutCurveMode > 0) { - double temp = Math.Abs(dState.Motion.outputAccelZ) / 128.0; + double temp = dState.Motion.outputAccelZ / 128.0; double sign = Math.Sign(temp); if (szOutCurveMode == 1) { double output = temp * temp; - dState.Motion.outputAccelZ = (byte)(output * sign * 128.0); + dState.Motion.outputAccelZ = (int)(output * sign * 128.0); } else if (szOutCurveMode == 2) { double output = temp * temp * temp; - dState.Motion.outputAccelZ = (byte)(output * 128.0); + dState.Motion.outputAccelZ = (int)(output * 128.0); } } }