diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2010-04-22 07:11:49 +0000 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2010-04-22 07:11:49 +0000 |
| commit | 7c22b83f668c9f5f8eebf4bab85359f10271b6c4 (patch) | |
| tree | 37b8971d2b16eebe4b0e9a9fae7e1d211073f49f /Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp | |
| parent | 140332c02ea905de29de1870c384174dda41303b (diff) | |
Improvements to new emulated wiimote plugin: IR cursor works with mouse or analog stick control. Wiimote mii data is saved/loaded to "User/Wii/mii.bin". Background input checkbox works properly. All reporting modes except the interleaved one should work. Fixed a rumble prob with multiple XInput devices.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5396 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp')
| -rw-r--r-- | Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp b/Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp index 16d39289c0..a2b6c638c9 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp @@ -64,6 +64,7 @@ Device::Device( const XINPUT_CAPABILITIES* const caps, const unsigned int index : m_index(index), m_subtype(caps->SubType) { ZeroMemory( &m_state_out, sizeof(m_state_out) ); + ZeroMemory( &m_current_state_out, sizeof(m_current_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 @@ -149,10 +150,10 @@ bool Device::UpdateInput() bool Device::UpdateOutput() { // this if statement is to make rumble work better when multiple ControllerInterfaces are using the device - static XINPUT_VIBRATION current_state_out = {0,0}; - if ( memcmp( &m_state_out, ¤t_state_out, sizeof(m_state_out) ) ) + // only calls XInputSetState if the state changed + if ( memcmp( &m_state_out, &m_current_state_out, sizeof(m_state_out) ) ) { - current_state_out = m_state_out; + m_current_state_out = m_state_out; return ( ERROR_SUCCESS == XInputSetState( m_index, &m_state_out ) ); } else |
