2017-02-08 22:15:43 -05:00
|
|
|
// Copyright 2017 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
|
2018-12-21 16:11:00 -06:00
|
|
|
#include "InputCommon/ControllerEmu/StickGate.h"
|
2017-04-04 15:37:31 -04:00
|
|
|
#include "InputCommon/ControllerInterface/Device.h"
|
2017-02-08 22:15:43 -05:00
|
|
|
|
|
|
|
namespace ControllerEmu
|
|
|
|
{
|
2018-12-29 16:06:03 -06:00
|
|
|
class AnalogStick : public ReshapableInput
|
2017-02-08 22:15:43 -05:00
|
|
|
{
|
|
|
|
public:
|
2018-12-30 10:52:45 -06:00
|
|
|
using StateData = ReshapeData;
|
2018-12-30 09:10:32 -06:00
|
|
|
|
2018-12-18 20:06:16 -06:00
|
|
|
AnalogStick(const char* name, std::unique_ptr<StickGate>&& stick_gate);
|
|
|
|
AnalogStick(const char* name, const char* ui_name, std::unique_ptr<StickGate>&& stick_gate);
|
|
|
|
|
2018-12-30 10:52:45 -06:00
|
|
|
ReshapeData GetReshapableState(bool adjusted) final override;
|
2018-12-29 16:06:03 -06:00
|
|
|
ControlState GetGateRadiusAtAngle(double ang) const override;
|
2018-12-18 20:06:16 -06:00
|
|
|
|
2018-12-30 09:10:32 -06:00
|
|
|
StateData GetState();
|
|
|
|
|
2018-12-18 20:06:16 -06:00
|
|
|
private:
|
|
|
|
std::unique_ptr<StickGate> m_stick_gate;
|
2017-02-08 22:15:43 -05:00
|
|
|
};
|
2018-12-18 20:06:16 -06:00
|
|
|
|
|
|
|
// An AnalogStick with an OctagonStickGate
|
|
|
|
class OctagonAnalogStick : public AnalogStick
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
OctagonAnalogStick(const char* name, ControlState gate_radius);
|
|
|
|
OctagonAnalogStick(const char* name, const char* ui_name, ControlState gate_radius);
|
|
|
|
};
|
|
|
|
|
2017-02-08 22:15:43 -05:00
|
|
|
} // namespace ControllerEmu
|