From a1a54c84298cf72dd92c03773e8d1650ac1bac0d Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 13 Jan 2018 05:18:23 -0600 Subject: [PATCH] Minor tweak for speed --- DS4Windows/DS4Control/Mapping.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs index bf75e1b..dfa277c 100644 --- a/DS4Windows/DS4Control/Mapping.cs +++ b/DS4Windows/DS4Control/Mapping.cs @@ -154,6 +154,7 @@ namespace DS4Windows static bool tempBool = false; private static double[] tempDoubleArray = new double[4] { 0.0, 0.0, 0.0, 0.0 }; private static int[] tempIntArray = new int[4] { 0, 0, 0, 0 }; + private static int tempInt = 0; // Special macros static bool altTabDone = true; @@ -977,12 +978,12 @@ namespace DS4Windows if (sxOutCurveMode == 1) { double output = temp * temp; - dState.Motion.outputAccelX = (int)(output * sign * 128.0); + dState.Motion.outputAccelX = tempInt = (int)(output * sign * 128.0); } else if (sxOutCurveMode == 2) { double output = temp * temp * temp; - dState.Motion.outputAccelX = (int)(output * 128.0); + dState.Motion.outputAccelX = tempInt = (int)(output * 128.0); } } @@ -994,12 +995,12 @@ namespace DS4Windows if (szOutCurveMode == 1) { double output = temp * temp; - dState.Motion.outputAccelZ = (int)(output * sign * 128.0); + dState.Motion.outputAccelZ = tempInt = (int)(output * sign * 128.0); } else if (szOutCurveMode == 2) { double output = temp * temp * temp; - dState.Motion.outputAccelZ = (int)(output * 128.0); + dState.Motion.outputAccelZ = tempInt = (int)(output * 128.0); } } }