summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2018-12-30 09:10:32 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2018-12-30 09:10:32 -0600
commit7a00f55cfa6e65e58ebf9f279bfff61f8b0f8c13 (patch)
treebbc75a8d0c7ce88f86cfc1d1f00cec15e68980ce /Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp
parent247fa8c628d9f780831140006e69ee3af2f42f2d (diff)
ControllerEmu::Cursor: Add input radius/shape settings to IR Cursor mappings to allow use of round inputs in absolute mode. Make relative input option obey the center/width/height settings. Make the mapping indicator pretty and actually show what the relative/center/w/h settings are doing.
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp
index e072f6b7bd..de9a75dd23 100644
--- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp
@@ -37,10 +37,10 @@ AnalogStick::AnalogStick(const char* const name_, const char* const ui_name_,
AddReshapingSettings(GetGateRadiusAtAngle(0.0), 0.0, 50);
}
-AnalogStick::StateData AnalogStick::GetState(bool adjusted)
+AnalogStick::StateData AnalogStick::GetReshapableState(bool adjusted)
{
- ControlState y = controls[0]->control_ref->State() - controls[1]->control_ref->State();
- ControlState x = controls[3]->control_ref->State() - controls[2]->control_ref->State();
+ const ControlState y = controls[0]->control_ref->State() - controls[1]->control_ref->State();
+ const ControlState x = controls[3]->control_ref->State() - controls[2]->control_ref->State();
// Return raw values. (used in UI)
if (!adjusted)
@@ -51,6 +51,11 @@ AnalogStick::StateData AnalogStick::GetState(bool adjusted)
return Reshape(x, y, modifier);
}
+AnalogStick::StateData AnalogStick::GetState()
+{
+ return GetReshapableState(true);
+}
+
ControlState AnalogStick::GetGateRadiusAtAngle(double ang) const
{
return m_stick_gate->GetRadiusAtAngle(ang);