diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2019-02-26 19:46:21 -0600 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2019-03-03 18:36:16 -0600 |
| commit | 48b69ca01841ba724049895a83d8d88ec95d66de (patch) | |
| tree | 43fda39dfdccc0999afdb0aaa4e2ab1fd5874c39 /Source/Core/InputCommon/ControllerInterface/Device.cpp | |
| parent | 13b2b93d3d12e4c8491ed82c63d52a24a4849476 (diff) | |
ControllerInterface: Input detection improvements.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Device.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/Device.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Device.cpp b/Source/Core/InputCommon/ControllerInterface/Device.cpp index b8d73d9ab8..efe1372711 100644 --- a/Source/Core/InputCommon/ControllerInterface/Device.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Device.cpp @@ -4,6 +4,7 @@ #include "InputCommon/ControllerInterface/Device.h" +#include <cmath> #include <memory> #include <sstream> #include <string> @@ -68,6 +69,11 @@ Device::Output* Device::FindOutput(const std::string& name) const return nullptr; } +ControlState Device::FullAnalogSurface::GetState() const +{ + return (1 + std::max(0.0, m_high.GetState()) - std::max(0.0, m_low.GetState())) / 2; +} + // // DeviceQualifier :: ToString // @@ -214,5 +220,5 @@ bool DeviceContainer::HasConnectedDevice(const DeviceQualifier& qualifier) const const auto device = FindDevice(qualifier); return device != nullptr && device->IsValid(); } -} -} +} // namespace Core +} // namespace ciface |
