From 70909bdaa91823c815dc9f7690fbc18095e11ab9 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 29 Jan 2019 21:50:29 -0600 Subject: [PATCH] Added easeout quad curve option for other axes --- DS4Windows/DS4Control/Mapping.cs | 22 ++++++++++++++++++++++ DS4Windows/DS4Control/ScpUtil.cs | 2 ++ DS4Windows/DS4Forms/Options.Designer.cs | 12 ++++++++---- DS4Windows/DS4Forms/Options.resx | 12 ++++++++++++ 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index 5664715..e0847fe 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -918,6 +918,11 @@ namespace DS4Windows double output = temp * temp * temp; dState.L2 = (byte)(output * 255.0); } + else if (l2OutCurveMode == 3) + { + double output = temp * (temp - 2.0); + dState.L2 = (byte)(-1.0 * output * 255.0); + } } int r2OutCurveMode = tempIntArray[device] = getR2OutCurveMode(device); @@ -934,6 +939,11 @@ namespace DS4Windows double output = temp * temp * temp; dState.R2 = (byte)(output * 255.0); } + else if (r2OutCurveMode == 3) + { + double output = temp * (temp - 2.0); + dState.R2 = (byte)(-1.0 * output * 255.0); + } } bool sOff = tempBool = isUsingSAforMouse(device); @@ -1009,6 +1019,12 @@ namespace DS4Windows result = (int)(output * 128.0); dState.Motion.outputAccelX = result; } + else if (sxOutCurveMode == 3) + { + double output = temp * (temp - 2.0); + result = (int)(-1.0 * output * 128.0); + dState.Motion.outputAccelX = result; + } } int szOutCurveMode = tempIntArray[device] = getSZOutCurveMode(device); @@ -1028,6 +1044,12 @@ namespace DS4Windows result = (int)(output * 128.0); dState.Motion.outputAccelZ = result; } + else if (szOutCurveMode == 3) + { + double output = temp * (temp - 2.0); + result = (int)(-1.0 * output * 128.0); + dState.Motion.outputAccelZ = result; + } } } diff --git a/DS4Windows/DS4Control/ScpUtil.cs b/DS4Windows/DS4Control/ScpUtil.cs index 49a2906..e8d9f07 100644 --- a/DS4Windows/DS4Control/ScpUtil.cs +++ b/DS4Windows/DS4Control/ScpUtil.cs @@ -1610,6 +1610,7 @@ namespace DS4Windows case 0: break; case 1: result = "quadratic"; break; case 2: result = "cubic"; break; + case 3: result = "easeout-quad"; break; default: break; } @@ -1624,6 +1625,7 @@ namespace DS4Windows case "linear": id = 0; break; case "quadratic": id = 1; break; case "cubic": id = 2; break; + case "easeout-quad": id = 3; break; default: break; } diff --git a/DS4Windows/DS4Forms/Options.Designer.cs b/DS4Windows/DS4Forms/Options.Designer.cs index 184e813..bbd76ae 100644 --- a/DS4Windows/DS4Forms/Options.Designer.cs +++ b/DS4Windows/DS4Forms/Options.Designer.cs @@ -3137,7 +3137,8 @@ this.cBSixaxisZOutputCurve.Items.AddRange(new object[] { resources.GetString("cBSixaxisZOutputCurve.Items"), resources.GetString("cBSixaxisZOutputCurve.Items1"), - resources.GetString("cBSixaxisZOutputCurve.Items2")}); + resources.GetString("cBSixaxisZOutputCurve.Items2"), + resources.GetString("cBSixaxisZOutputCurve.Items3")}); resources.ApplyResources(this.cBSixaxisZOutputCurve, "cBSixaxisZOutputCurve"); this.cBSixaxisZOutputCurve.Name = "cBSixaxisZOutputCurve"; this.cBSixaxisZOutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBSixaxisZOutputCurve_SelectedIndexChanged); @@ -3150,7 +3151,8 @@ this.cBSixaxisXOutputCurve.Items.AddRange(new object[] { resources.GetString("cBSixaxisXOutputCurve.Items"), resources.GetString("cBSixaxisXOutputCurve.Items1"), - resources.GetString("cBSixaxisXOutputCurve.Items2")}); + resources.GetString("cBSixaxisXOutputCurve.Items2"), + resources.GetString("cBSixaxisXOutputCurve.Items3")}); resources.ApplyResources(this.cBSixaxisXOutputCurve, "cBSixaxisXOutputCurve"); this.cBSixaxisXOutputCurve.Name = "cBSixaxisXOutputCurve"; this.cBSixaxisXOutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBSixaxisXOutputCurve_SelectedIndexChanged); @@ -3173,7 +3175,8 @@ this.cBR2OutputCurve.Items.AddRange(new object[] { resources.GetString("cBR2OutputCurve.Items"), resources.GetString("cBR2OutputCurve.Items1"), - resources.GetString("cBR2OutputCurve.Items2")}); + resources.GetString("cBR2OutputCurve.Items2"), + resources.GetString("cBR2OutputCurve.Items3")}); resources.ApplyResources(this.cBR2OutputCurve, "cBR2OutputCurve"); this.cBR2OutputCurve.Name = "cBR2OutputCurve"; this.cBR2OutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBR2OutputCurve_SelectedIndexChanged); @@ -3186,7 +3189,8 @@ this.cBL2OutputCurve.Items.AddRange(new object[] { resources.GetString("cBL2OutputCurve.Items"), resources.GetString("cBL2OutputCurve.Items1"), - resources.GetString("cBL2OutputCurve.Items2")}); + resources.GetString("cBL2OutputCurve.Items2"), + resources.GetString("cBL2OutputCurve.Items3")}); resources.ApplyResources(this.cBL2OutputCurve, "cBL2OutputCurve"); this.cBL2OutputCurve.Name = "cBL2OutputCurve"; this.cBL2OutputCurve.SelectedIndexChanged += new System.EventHandler(this.cBL2OutputCurve_SelectedIndexChanged); diff --git a/DS4Windows/DS4Forms/Options.resx b/DS4Windows/DS4Forms/Options.resx index f32fa8c..4e941eb 100644 --- a/DS4Windows/DS4Forms/Options.resx +++ b/DS4Windows/DS4Forms/Options.resx @@ -6922,6 +6922,9 @@ with profile Cubic + + Easeout Quad + 221, 28 @@ -6952,6 +6955,9 @@ with profile Cubic + + Easeout Quad + 221, 1 @@ -7042,6 +7048,9 @@ with profile Cubic + + Easeout Quad + 111, 28 @@ -7072,6 +7081,9 @@ with profile Cubic + + Easeout Quad + 31, 28