diff options
| author | Lioncash <mathew1800@gmail.com> | 2017-02-08 22:15:43 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2017-02-09 18:18:52 -0500 |
| commit | 6a75ea5653ec596b1a08e985e98fca0b05ccd6f7 (patch) | |
| tree | d76f549ca6c7591fa2b11a86f63e0351b418f4c8 /Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.h | |
| parent | 1385a012d94bbec76bc8b2922467c715b63f0158 (diff) | |
ControllerEmu: Separate ControlGroup from ControllerEmu
ControllerEmu, the class, is essentially acting like a namespace for
ControlGroup. This makes it impossible to forward declare any of the
internals. It also globs a bunch of classes together which is kind of a
pain to manage.
This splits ControlGroup and the classes it contains into their own source
files and situates them all within a namespace, which gets them out of
global scope.
Since this allows forward declarations for the once-internal classes, it
now requires significantly less files to be rebuilt if anything is changed
in the ControllerEmu portion of code.
It does not split out the settings classes yet, however, as it
would be preferable to make a settings base class that all settings derive
from, but this would be a functional change -- this commit only intends to
move around existing code. Extracting the settings class will be done in
another commit.
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.h')
| -rw-r--r-- | Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.h b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.h new file mode 100644 index 0000000000..3520d95d13 --- /dev/null +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.h @@ -0,0 +1,29 @@ +// Copyright 2017 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#include <string> +#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h" + +namespace ControllerEmu +{ +class Cursor : public ControlGroup +{ +public: + explicit Cursor(const std::string& name); + + void GetState(ControlState* x, ControlState* y, ControlState* z, bool adjusted = false); + + ControlState m_z = 0.0; + +private: + // This is used to reduce the cursor speed for relative input + // to something that makes sense with the default range. + static constexpr double SPEED_MULTIPLIER = 0.04; + + ControlState m_x = 0.0; + ControlState m_y = 0.0; +}; +} // namespace ControllerEmu |
