mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-22 17:29:18 +01:00
Minor property optimization
This commit is contained in:
parent
b41a669223
commit
2b42e327cc
@ -497,20 +497,28 @@ namespace DS4Windows
|
||||
}
|
||||
}
|
||||
|
||||
if (LSSens[device] != 1)
|
||||
double lsSens = LSSens[device];
|
||||
if (lsSens != 1.0)
|
||||
{
|
||||
dState.LX = (byte)Clamp(0, LSSens[device] * (dState.LX - 127) + 127, 255);
|
||||
dState.LY = (byte)Clamp(0, LSSens[device] * (dState.LY - 127) + 127, 255);
|
||||
dState.LX = (byte)Clamp(0, lsSens * (dState.LX - 127) + 127, 255);
|
||||
dState.LY = (byte)Clamp(0, lsSens * (dState.LY - 127) + 127, 255);
|
||||
}
|
||||
if (RSSens[device] != 1)
|
||||
|
||||
double rsSens = RSSens[device];
|
||||
if (rsSens != 1.0)
|
||||
{
|
||||
dState.RX = (byte)Clamp(0, RSSens[device] * (dState.RX - 127) + 127, 255);
|
||||
dState.RY = (byte)Clamp(0, RSSens[device] * (dState.RY - 127) + 127, 255);
|
||||
dState.RX = (byte)Clamp(0, rsSens * (dState.RX - 127) + 127, 255);
|
||||
dState.RY = (byte)Clamp(0, rsSens * (dState.RY - 127) + 127, 255);
|
||||
}
|
||||
if (L2Sens[device] != 1)
|
||||
dState.L2 = (byte)Clamp(0, L2Sens[device] * dState.L2, 255);
|
||||
if (R2Sens[device] != 1)
|
||||
dState.R2 = (byte)Clamp(0, R2Sens[device] * dState.R2, 255);
|
||||
|
||||
double l2Sens = L2Sens[device];
|
||||
if (l2Sens != 1.0)
|
||||
dState.L2 = (byte)Clamp(0, l2Sens * dState.L2, 255);
|
||||
|
||||
double r2Sens = R2Sens[device];
|
||||
if (r2Sens != 1.0)
|
||||
dState.R2 = (byte)Clamp(0, r2Sens * dState.R2, 255);
|
||||
|
||||
return dState;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user