mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-30 04:54:20 +01:00
Make sure sixaxis value ratios do not go above 1.0
This commit is contained in:
parent
ec130f6156
commit
0e8daf05b0
@ -889,7 +889,7 @@ namespace DS4Windows
|
||||
int maxValue = (int)(SXMax * 128d);
|
||||
if (absx > SXD)
|
||||
{
|
||||
double ratioX = (absx - SXD) / (double)(maxValue - SXD);
|
||||
double ratioX = absx < maxValue ? (absx - SXD) / (double)(maxValue - SXD) : 1.0;
|
||||
dState.Motion.accelX = Math.Sign(gyroX) *
|
||||
(int)Math.Min(128d, sxsens * 128d * ((1.0 - sxAntiDead) * ratioX + sxAntiDead));
|
||||
}
|
||||
@ -909,7 +909,7 @@ namespace DS4Windows
|
||||
int maxValue = (int)(SZMax * 128d);
|
||||
if (absz > SZD)
|
||||
{
|
||||
double ratioZ = (absz - SZD) / (double)(maxValue - SZD);
|
||||
double ratioZ = absz < maxValue ? (absz - SZD) / (double)(maxValue - SZD) : 1.0;
|
||||
dState.Motion.accelZ = Math.Sign(gyroZ) *
|
||||
(int)Math.Min(128d, szsens * 128d * ((1.0 - szAntiDead) * ratioZ + szAntiDead));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user