From 7c22b83f668c9f5f8eebf4bab85359f10271b6c4 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Thu, 22 Apr 2010 07:11:49 +0000 Subject: 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 --- Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Source/Core/InputCommon/Src/ControllerInterface/XInput/XInput.cpp') 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 -- cgit v1.2.3