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
|
|
|
|
|
2018-12-29 16:06:03 -06:00
|
|
|
#include <chrono>
|
2017-02-08 22:15:43 -05:00
|
|
|
#include <string>
|
2018-12-29 16:06:03 -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 Tilt : public ReshapableInput
|
2017-02-08 22:15:43 -05:00
|
|
|
{
|
|
|
|
public:
|
2018-12-29 16:06:03 -06:00
|
|
|
enum
|
2018-07-13 11:04:40 -04:00
|
|
|
{
|
2018-12-29 16:06:03 -06:00
|
|
|
SETTING_MAX_ANGLE = ReshapableInput::SETTING_COUNT,
|
2018-07-13 11:04:40 -04:00
|
|
|
};
|
|
|
|
|
2017-02-08 22:15:43 -05:00
|
|
|
explicit Tilt(const std::string& name);
|
|
|
|
|
2018-12-29 16:06:03 -06:00
|
|
|
StateData GetState(bool adjusted = true);
|
|
|
|
|
|
|
|
ControlState GetGateRadiusAtAngle(double ang) const override;
|
2017-02-08 22:15:43 -05:00
|
|
|
|
|
|
|
private:
|
2018-12-29 16:06:03 -06:00
|
|
|
typedef std::chrono::steady_clock Clock;
|
|
|
|
|
2018-07-13 11:04:40 -04:00
|
|
|
StateData m_tilt;
|
2018-12-29 16:06:03 -06:00
|
|
|
Clock::time_point m_last_update;
|
2017-02-08 22:15:43 -05:00
|
|
|
};
|
|
|
|
} // namespace ControllerEmu
|