diff options
| author | Filoppi <filippotarpini@hotmail.it> | 2021-05-05 00:19:45 +0300 |
|---|---|---|
| committer | Filoppi <filippotarpini@hotmail.it> | 2021-05-12 18:27:24 +0300 |
| commit | 26f664842184a2fd5236de2621eff509b05d0c3d (patch) | |
| tree | 20fbcda9252fca45c9d0dd9e5a45dfc5e3d6931e /Source/Core/InputCommon/ControllerEmu/StickGate.cpp | |
| parent | 5f74d0e08f8ee4d083f16535ba1c5e95e871743b (diff) | |
StickGate: add custom clamp value
Works exactly as before by default.
It will be used by my upcoming input PRs.
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/StickGate.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerEmu/StickGate.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/StickGate.cpp b/Source/Core/InputCommon/ControllerEmu/StickGate.cpp index 60a3c062bd..d57a2402cf 100644 --- a/Source/Core/InputCommon/ControllerEmu/StickGate.cpp +++ b/Source/Core/InputCommon/ControllerEmu/StickGate.cpp @@ -281,7 +281,8 @@ void ReshapableInput::SaveConfig(IniFile::Section* section, const std::string& d } ReshapableInput::ReshapeData ReshapableInput::Reshape(ControlState x, ControlState y, - ControlState modifier) const + ControlState modifier, + ControlState clamp) const { x -= m_center.x; y -= m_center.y; @@ -326,8 +327,8 @@ ReshapableInput::ReshapeData ReshapableInput::Reshape(ControlState x, ControlSta // Scale to the gate shape/radius: dist *= gate_max_dist; - return {std::clamp(std::cos(angle) * dist, -1.0, 1.0), - std::clamp(std::sin(angle) * dist, -1.0, 1.0)}; + return {std::clamp(std::cos(angle) * dist, -clamp, clamp), + std::clamp(std::sin(angle) * dist, -clamp, clamp)}; } } // namespace ControllerEmu |
