From 2fac5e084f6aa4090b9aadeb6a249877f5e91ac2 Mon Sep 17 00:00:00 2001 From: araghon007 Date: Wed, 13 Mar 2019 10:23:03 +0100 Subject: [PATCH] Lowered the vibration strength --- X1nput/XInput.vcxproj.user | 9 +++++++++ X1nput/dllmain.cpp | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/X1nput/XInput.vcxproj.user b/X1nput/XInput.vcxproj.user index a894860..5985222 100644 --- a/X1nput/XInput.vcxproj.user +++ b/X1nput/XInput.vcxproj.user @@ -6,4 +6,13 @@ WindowsLocalDebugger + + WindowsLocalDebugger + + + WindowsLocalDebugger + + + WindowsLocalDebugger + \ No newline at end of file diff --git a/X1nput/dllmain.cpp b/X1nput/dllmain.cpp index c3ccdef..f2a3f22 100644 --- a/X1nput/dllmain.cpp +++ b/X1nput/dllmain.cpp @@ -52,6 +52,9 @@ #define ERROR_DEVICE_NOT_CONNECTED 1167 #define ERROR_SUCCESS 0 +#define LEFT_TRIGGER_STRENGTH 0.25f +#define RIGHT_TRIGGER_STRENGTH 0.25f + std::unique_ptr m_gamePad; bool initialized = false; @@ -188,7 +191,7 @@ DLLEXPORT DWORD WINAPI XInputSetState(_In_ DWORD dwUserIndex, _In_ XINPUT_VIBRAT if (state.connected) { - m_gamePad->SetVibration(dwUserIndex, pVibration->wLeftMotorSpeed / 65535.0f, pVibration->wRightMotorSpeed / 65535.0f, pVibration->wLeftMotorSpeed / 65535.0f, pVibration->wRightMotorSpeed / 65535.0f); + m_gamePad->SetVibration(dwUserIndex, pVibration->wLeftMotorSpeed / 65535.0f, pVibration->wRightMotorSpeed / 65535.0f, pVibration->wLeftMotorSpeed / 65535.0f * LEFT_TRIGGER_STRENGTH, pVibration->wRightMotorSpeed / 65535.0f * RIGHT_TRIGGER_STRENGTH); return ERROR_SUCCESS; }