ControllerEmu: Add support for setting the center of a ReshapableInput

This is useful in far out-of-calibration controllers, such as the
Switch Pro controller. This also adds support for configuring the center
in the Mapping widget.
This commit is contained in:
Artemis Tosini
2019-04-12 20:26:34 +00:00
parent d60b0c6b37
commit 49e46c8aff
4 changed files with 112 additions and 19 deletions

View File

@ -97,6 +97,9 @@ public:
const CalibrationData& GetCalibrationData() const;
void SetCalibrationData(CalibrationData data);
const ReshapeData& GetCenter() const;
void SetCenter(ReshapeData center);
protected:
ReshapeData Reshape(ControlState x, ControlState y, ControlState modifier = 0.0);
@ -106,6 +109,7 @@ private:
CalibrationData m_calibration;
SettingValue<double> m_deadzone_setting;
ReshapeData m_center;
};
} // namespace ControllerEmu