Correct reverse smoothing buffer traversal

This commit is contained in:
Travis Nickles 2017-09-20 21:39:55 -05:00
parent cdb17f43a7
commit f96731ea8a

View File

@ -139,7 +139,7 @@ namespace DS4Windows
int idx = 0; int idx = 0;
for (int i = 0; i < SMOOTH_BUFFER_LEN; i++) for (int i = 0; i < SMOOTH_BUFFER_LEN; i++)
{ {
idx = Math.Abs(smoothBufferTail - i - 1) % SMOOTH_BUFFER_LEN; idx = (smoothBufferTail - i - 1 + SMOOTH_BUFFER_LEN) % SMOOTH_BUFFER_LEN;
x_out += xSmoothBuffer[idx] * currentWeight; x_out += xSmoothBuffer[idx] * currentWeight;
y_out += ySmoothBuffer[idx] * currentWeight; y_out += ySmoothBuffer[idx] * currentWeight;
finalWeight += currentWeight; finalWeight += currentWeight;