mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -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:
@ -4,26 +4,32 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include <string>
|
||||
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
|
||||
|
||||
#include "InputCommon/ControllerEmu/StickGate.h"
|
||||
#include "InputCommon/ControllerInterface/Device.h"
|
||||
|
||||
namespace ControllerEmu
|
||||
{
|
||||
class Tilt : public ControlGroup
|
||||
class Tilt : public ReshapableInput
|
||||
{
|
||||
public:
|
||||
struct StateData
|
||||
enum
|
||||
{
|
||||
ControlState x{};
|
||||
ControlState y{};
|
||||
SETTING_MAX_ANGLE = ReshapableInput::SETTING_COUNT,
|
||||
};
|
||||
|
||||
explicit Tilt(const std::string& name);
|
||||
|
||||
StateData GetState(bool step = true);
|
||||
StateData GetState(bool adjusted = true);
|
||||
|
||||
ControlState GetGateRadiusAtAngle(double ang) const override;
|
||||
|
||||
private:
|
||||
typedef std::chrono::steady_clock Clock;
|
||||
|
||||
StateData m_tilt;
|
||||
Clock::time_point m_last_update;
|
||||
};
|
||||
} // namespace ControllerEmu
|
||||
|
Reference in New Issue
Block a user