diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-12-07 01:22:03 -0600 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-12-07 01:22:03 -0600 |
| commit | d9d0e285c94b205d3b59b55b4d0dfec9d78b2683 (patch) | |
| tree | 166e75747843fc652a39cc683b4aa399c30e2c17 /Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp | |
| parent | 4e98078dafe0075a02c371ae463a4b933ca04d6d (diff) | |
| parent | 854f6b8688063544310edbc0fc27a8c42f517d9b (diff) | |
Merge pull request #1560 from magcius/pad-cleanup-1
Pad cleanup 1
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp index ecd5db838c..bc8638293e 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp @@ -149,7 +149,9 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI InitForceFeedback(m_device, (int)objects.size()); } - ClearInputState(); + ZeroMemory(&m_state_in, sizeof(m_state_in)); + // set hats to center + memset(m_state_in.rgdwPOV, 0xFF, sizeof(m_state_in.rgdwPOV)); } Joystick::~Joystick() @@ -158,13 +160,6 @@ Joystick::~Joystick() m_device->Release(); } -void Joystick::ClearInputState() -{ - ZeroMemory(&m_state_in, sizeof(m_state_in)); - // set hats to center - memset(m_state_in.rgdwPOV, 0xFF, sizeof(m_state_in.rgdwPOV)); -} - std::string Joystick::GetName() const { return GetDeviceName(m_device); @@ -182,7 +177,7 @@ std::string Joystick::GetSource() const // update IO -bool Joystick::UpdateInput() +void Joystick::UpdateInput() { HRESULT hr = 0; @@ -220,9 +215,7 @@ bool Joystick::UpdateInput() // try reacquire if input lost if (DIERR_INPUTLOST == hr || DIERR_NOTACQUIRED == hr) - hr = m_device->Acquire(); - - return SUCCEEDED(hr); + m_device->Acquire(); } // get name |
