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/ControllerInterface.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/ControllerInterface.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp | 53 |
1 files changed, 4 insertions, 49 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index e75df76a36..3eb1b95ff2 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -98,9 +98,6 @@ void ControllerInterface::Shutdown() for (ciface::Core::Device::Output* o : d->Outputs()) o->SetState(0); - // Update output - d->UpdateOutput(); - // Delete device delete d; } @@ -135,52 +132,15 @@ void ControllerInterface::Shutdown() // // Update input for all devices, return true if all devices returned successful // -bool ControllerInterface::UpdateInput(const bool force) -{ - std::unique_lock<std::recursive_mutex> lk(update_lock, std::defer_lock); - - if (force) - lk.lock(); - else if (!lk.try_lock()) - return false; - - size_t ok_count = 0; - - for (ciface::Core::Device* d : m_devices) - { - if (d->UpdateInput()) - ++ok_count; - //else - // disabled. it might be causing problems - //(*d)->ClearInputState(); - } - - return (m_devices.size() == ok_count); -} - -// -// UpdateOutput -// -// Update output for all devices, return true if all devices returned successful -// -bool ControllerInterface::UpdateOutput(const bool force) +void ControllerInterface::UpdateInput() { std::unique_lock<std::recursive_mutex> lk(update_lock, std::defer_lock); - if (force) - lk.lock(); - else if (!lk.try_lock()) - return false; - - size_t ok_count = 0; + if (!lk.try_lock()) + return; for (ciface::Core::Device* d : m_devices) - { - if (d->UpdateOutput()) - ++ok_count; - } - - return (m_devices.size() == ok_count); + d->UpdateInput(); } // @@ -299,14 +259,9 @@ ciface::Core::Device::Control* ControllerInterface::OutputReference::Detect(cons // this loop is to make stuff like flashing keyboard LEDs work while (ms > (slept += 10)) - { - // TODO: improve this to update more than just the default device's output - device->UpdateOutput(); Common::SleepCurrentThread(10); - } State(0); - device->UpdateOutput(); } return nullptr; } |
