Skip to content

Commit

Permalink
Lowered the vibration strength
Browse files Browse the repository at this point in the history
  • Loading branch information
araghon007 committed Mar 13, 2019
1 parent bf341b1 commit 2fac5e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions X1nput/XInput.vcxproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
5 changes: 4 additions & 1 deletion X1nput/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<DirectX::GamePad> m_gamePad;

bool initialized = false;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 2fac5e0

Please sign in to comment.