diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2019-02-04 18:50:07 -0600 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2019-02-10 07:55:47 -0600 |
| commit | 0064f70c8a17cd40c15486ac385508ce0ee20cf1 (patch) | |
| tree | a7e5dce2d6b8a6882362be3a696b5457bfb64e16 /Source/Core/InputCommon/ControllerEmu/ControlGroup | |
| parent | 46918f420d443c3a32bd27170e3fa0e4f7bc5255 (diff) | |
DolphinQt/ControllerEmu: Replace Input Radius/Shape settings with an input calibration "wizard".
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup')
4 files changed, 10 insertions, 16 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp index 0cd5da6ba0..45d178ed17 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp @@ -30,11 +30,6 @@ AnalogStick::AnalogStick(const char* const name_, const char* const ui_name_, controls.emplace_back(std::make_unique<Input>(Translate, named_direction)); controls.emplace_back(std::make_unique<Input>(Translate, _trans("Modifier"))); - - // Default input radius to that of the gate radius (no resizing) - // Default input shape to an octagon (no reshaping) - // Max deadzone to 50% - AddReshapingSettings(GetGateRadiusAtAngle(0.0), 0.0, 50); } AnalogStick::ReshapeData AnalogStick::GetReshapableState(bool adjusted) diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp index 0af6efc734..fda476aac6 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp @@ -32,9 +32,6 @@ Cursor::Cursor(const std::string& name_) controls.emplace_back(std::make_unique<Input>(Translate, _trans("Hide"))); controls.emplace_back(std::make_unique<Input>(Translate, _trans("Recenter"))); - // Default shape is a 1.0 square (no resizing/reshaping): - AddReshapingSettings(1.0, 0.5, 50); - numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Center"), 0.5)); numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Width"), 0.5)); numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Height"), 0.5)); @@ -57,8 +54,6 @@ Cursor::ReshapeData Cursor::GetReshapableState(bool adjusted) ControlState Cursor::GetGateRadiusAtAngle(double ang) const { - // TODO: Change this to 0.5 and adjust the math, - // so pointer doesn't have to be clamped to the configured width/height? return SquareStickGate(1.0).GetRadiusAtAngle(ang); } diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp index 2fec9c7bd0..bacf158be0 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp @@ -29,11 +29,6 @@ Tilt::Tilt(const std::string& name_) controls.emplace_back(std::make_unique<Input>(Translate, _trans("Modifier"))); - // Set default input radius to the full 1.0 (no resizing) - // Set default input shape to a square (no reshaping) - // Max deadzone to 50% - AddReshapingSettings(1.0, 0.5, 50); - numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Angle"), 0.9, 0, 180)); } @@ -88,4 +83,9 @@ ControlState Tilt::GetGateRadiusAtAngle(double ang) const return SquareStickGate(max_tilt_angle).GetRadiusAtAngle(ang); } +ControlState Tilt::GetDefaultInputRadiusAtAngle(double ang) const +{ + return SquareStickGate(1.0).GetRadiusAtAngle(ang); +} + } // namespace ControllerEmu diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.h b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.h index 55afd43ba3..c18f6dc46d 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.h +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.h @@ -20,7 +20,11 @@ public: explicit Tilt(const std::string& name); ReshapeData GetReshapableState(bool adjusted) final override; - ControlState GetGateRadiusAtAngle(double ang) const override; + ControlState GetGateRadiusAtAngle(double angle) const final override; + + // Tilt is using the gate radius to adjust the tilt angle so we must provide an unadjusted value + // for the default input radius. + ControlState GetDefaultInputRadiusAtAngle(double angle) const final override; StateData GetState(); |
