summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp
diff options
context:
space:
mode:
authorDolphin Bot <dolphin-emu-bot@users.noreply.github.com>2016-04-23 21:59:06 +0200
committerDolphin Bot <dolphin-emu-bot@users.noreply.github.com>2016-04-23 21:59:06 +0200
commit21e56b5ce1c3628e4d9fe1f93d19674e819c40ad (patch)
treed9bac97a7c78ccf5e990f3c116e35d50fc2684e6 /Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp
parentbdb9da21041fdcefa4504c28259647eea910e36c (diff)
parentfcd5170cff5614f6585c11fa22e2a8d986de4055 (diff)
Merge pull request #3790 from mimimi085181/fix-xbox-one-rumble-test1
XInput: Apply Rumble/Motor output only on changes (again)
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp
index 1ee374d483..c8438b488f 100644
--- a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp
@@ -124,8 +124,6 @@ void DeInit()
Device::Device(const XINPUT_CAPABILITIES& caps, u8 index)
: m_subtype(caps.SubType), m_index(index)
{
- ZeroMemory(&m_state_out, sizeof(m_state_out));
-
// XInputGetCaps seems to always claim all capabilities are supported
// but I will leave all this stuff in, incase m$ fixes xinput up a bit
@@ -213,7 +211,13 @@ void Device::UpdateInput()
void Device::UpdateMotors()
{
- PXInputSetState(m_index, &m_state_out);
+ // this if statement is to make rumble work better when multiple ControllerInterfaces are using the device
+ // only calls XInputSetState if the state changed
+ if (memcmp(&m_state_out, &m_current_state_out, sizeof(m_state_out)))
+ {
+ m_current_state_out = m_state_out;
+ PXInputSetState(m_index, &m_state_out);
+ }
}
// GET name/source/id