mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 13:49:53 -06:00
ControllerEmu: Reorganize stick reshaping code and use it for emu wiimote tilt as well. Also make the tilt mapping indicator pretty.
This commit is contained in:
@ -10,35 +10,17 @@
|
||||
|
||||
namespace ControllerEmu
|
||||
{
|
||||
class AnalogStick : public ControlGroup
|
||||
class AnalogStick : public ReshapableInput
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
SETTING_INPUT_RADIUS,
|
||||
SETTING_INPUT_SHAPE,
|
||||
SETTING_DEADZONE,
|
||||
};
|
||||
|
||||
struct StateData
|
||||
{
|
||||
ControlState x{};
|
||||
ControlState y{};
|
||||
};
|
||||
|
||||
AnalogStick(const char* name, std::unique_ptr<StickGate>&& stick_gate);
|
||||
AnalogStick(const char* name, const char* ui_name, std::unique_ptr<StickGate>&& stick_gate);
|
||||
|
||||
StateData GetState(bool adjusted = true);
|
||||
StateData GetState(bool adjusted = true) override;
|
||||
|
||||
// Angle is in radians and should be non-negative
|
||||
ControlState GetGateRadiusAtAngle(double ang) const;
|
||||
ControlState GetDeadzoneRadiusAtAngle(double ang) const;
|
||||
ControlState GetInputRadiusAtAngle(double ang) const;
|
||||
ControlState GetGateRadiusAtAngle(double ang) const override;
|
||||
|
||||
private:
|
||||
ControlState CalculateInputShapeRadiusAtAngle(double ang) const;
|
||||
|
||||
std::unique_ptr<StickGate> m_stick_gate;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user