Fixed midpoint for Swipe to Axis controls

Old value did not match newer standard. Related to issue #1069.
This commit is contained in:
Travis Nickles 2020-01-26 10:08:10 -06:00
parent b1872cee6a
commit 61265388ad

View File

@ -3747,11 +3747,11 @@ namespace DS4Windows
{ {
if (alt) if (alt)
{ {
result = (byte)(tp != null ? 127.5f + fieldMap.swipedirs[controlNum] / 2f : 0); result = (byte)(tp != null ? 128.0f + fieldMap.swipedirs[controlNum] / 2f : 0);
} }
else else
{ {
result = (byte)(tp != null ? 127.5f - fieldMap.swipedirs[controlNum] / 2f : 0); result = (byte)(tp != null ? 128.0f - fieldMap.swipedirs[controlNum] / 2f : 0);
} }
} }
else if (controlType == DS4StateFieldMapping.ControlType.GyroDir) else if (controlType == DS4StateFieldMapping.ControlType.GyroDir)
@ -3878,10 +3878,10 @@ namespace DS4Windows
{ {
switch (control) switch (control)
{ {
case DS4Controls.SwipeUp: if (alt) result = (byte)(tp != null ? 127.5f + tp.swipeUpB / 2f : 0); else result = (byte)(tp != null ? 127.5f - tp.swipeUpB / 2f : 0); break; case DS4Controls.SwipeUp: if (alt) result = (byte)(tp != null ? 128.0f + tp.swipeUpB / 2f : 0); else result = (byte)(tp != null ? 128.0f - tp.swipeUpB / 2f : 0); break;
case DS4Controls.SwipeDown: if (alt) result = (byte)(tp != null ? 127.5f + tp.swipeDownB / 2f : 0); else result = (byte)(tp != null ? 127.5f - tp.swipeDownB / 2f : 0); break; case DS4Controls.SwipeDown: if (alt) result = (byte)(tp != null ? 128.0f + tp.swipeDownB / 2f : 0); else result = (byte)(tp != null ? 128.0f - tp.swipeDownB / 2f : 0); break;
case DS4Controls.SwipeLeft: if (alt) result = (byte)(tp != null ? 127.5f + tp.swipeLeftB / 2f : 0); else result = (byte)(tp != null ? 127.5f - tp.swipeLeftB / 2f : 0); break; case DS4Controls.SwipeLeft: if (alt) result = (byte)(tp != null ? 128.0f + tp.swipeLeftB / 2f : 0); else result = (byte)(tp != null ? 128.0f - tp.swipeLeftB / 2f : 0); break;
case DS4Controls.SwipeRight: if (alt) result = (byte)(tp != null ? 127.5f + tp.swipeRightB / 2f : 0); else result = (byte)(tp != null ? 127.5f - tp.swipeRightB / 2f : 0); break; case DS4Controls.SwipeRight: if (alt) result = (byte)(tp != null ? 128.0f + tp.swipeRightB / 2f : 0); else result = (byte)(tp != null ? 128.0f - tp.swipeRightB / 2f : 0); break;
default: break; default: break;
} }
} }