mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-01-31 01:15:17 +01:00
Yellow squiggly lines begone! Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes. If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed. The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports. Not everything is removed, but the cleanup should be substantial enough. Because this done on Linux, code that isn't used on it is mostly untouched. (Hopefully no open PR is depending on these imports...)
66 lines
1.4 KiB
C++
66 lines
1.4 KiB
C++
// Copyright 2020 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <chrono>
|
|
#include <optional>
|
|
|
|
#include "InputCommon/ControllerEmu/ControllerEmu.h"
|
|
|
|
class CameraControllerInput;
|
|
class InputConfig;
|
|
|
|
namespace ControllerEmu
|
|
{
|
|
class ControlGroup;
|
|
class Buttons;
|
|
class IMUGyroscope;
|
|
} // namespace ControllerEmu
|
|
|
|
enum class FreeLookGroup
|
|
{
|
|
Move,
|
|
Speed,
|
|
FieldOfView,
|
|
Other,
|
|
Rotation,
|
|
};
|
|
|
|
namespace FreeLook
|
|
{
|
|
void Shutdown();
|
|
void Initialize();
|
|
void LoadInputConfig();
|
|
bool IsInitialized();
|
|
void UpdateInput();
|
|
|
|
InputConfig* GetInputConfig();
|
|
ControllerEmu::ControlGroup* GetInputGroup(int pad_num, FreeLookGroup group);
|
|
|
|
} // namespace FreeLook
|
|
|
|
class FreeLookController final : public ControllerEmu::EmulatedController
|
|
{
|
|
public:
|
|
explicit FreeLookController(unsigned int index);
|
|
|
|
std::string GetName() const override;
|
|
InputConfig* GetConfig() const override;
|
|
void LoadDefaults(const ControllerInterface& ciface) override;
|
|
|
|
ControllerEmu::ControlGroup* GetGroup(FreeLookGroup group) const;
|
|
void Update();
|
|
|
|
private:
|
|
void UpdateInput(CameraControllerInput* camera_controller);
|
|
ControllerEmu::Buttons* m_move_buttons;
|
|
ControllerEmu::Buttons* m_speed_buttons;
|
|
ControllerEmu::Buttons* m_fov_buttons;
|
|
ControllerEmu::Buttons* m_other_buttons;
|
|
ControllerEmu::IMUGyroscope* m_rotation_gyro;
|
|
|
|
const unsigned int m_index;
|
|
std::optional<std::chrono::steady_clock::time_point> m_last_free_look_rotate_time;
|
|
};
|