InputCommon: RoundStickGate's ideal sample count can be 1.

This commit is contained in:
Jordan Woyak 2020-02-24 16:55:44 -06:00
parent 459b47295d
commit f8cca9fe5d
2 changed files with 8 additions and 1 deletions

View File

@ -54,7 +54,7 @@ constexpr int ReshapableInput::CALIBRATION_SAMPLE_COUNT;
std::optional<u32> StickGate::GetIdealCalibrationSampleCount() const
{
return {};
return std::nullopt;
}
OctagonStickGate::OctagonStickGate(ControlState radius) : m_radius(radius)
@ -86,6 +86,12 @@ ControlState RoundStickGate::GetRadiusAtAngle(double) const
return m_radius;
}
std::optional<u32> RoundStickGate::GetIdealCalibrationSampleCount() const
{
// The "radius" is the same at every angle so a single sample is enough.
return 1;
}
SquareStickGate::SquareStickGate(ControlState half_width) : m_half_width(half_width)
{
}

View File

@ -48,6 +48,7 @@ class RoundStickGate : public StickGate
public:
explicit RoundStickGate(ControlState radius);
ControlState GetRadiusAtAngle(double ang) const override final;
std::optional<u32> GetIdealCalibrationSampleCount() const override final;
private:
const ControlState m_radius;