diff options
| author | 2020-02-18 06:45:37 +0100 | |
|---|---|---|
| committer | 2020-02-18 06:45:37 +0100 | |
| commit | 23c4cc80e2ee13ce38b89e9a1388c239b37d5a49 (patch) | |
| tree | 8966c39b56a3b4d92ca80e4f18a5c01a4a02d3c2 /src/input_common/analog_from_button.cpp | |
| parent | Merge pull request #3412 from Morph1984/aspect-ratio (diff) | |
| download | yuzu-23c4cc80e2ee13ce38b89e9a1388c239b37d5a49.tar.gz yuzu-23c4cc80e2ee13ce38b89e9a1388c239b37d5a49.tar.xz yuzu-23c4cc80e2ee13ce38b89e9a1388c239b37d5a49.zip | |
analog_from_button get direction implementation
Diffstat (limited to 'src/input_common/analog_from_button.cpp')
| -rwxr-xr-x | src/input_common/analog_from_button.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/input_common/analog_from_button.cpp b/src/input_common/analog_from_button.cpp index e1a260762..6cabdaa3c 100755 --- a/src/input_common/analog_from_button.cpp +++ b/src/input_common/analog_from_button.cpp | |||
| @@ -34,6 +34,20 @@ public: | |||
| 34 | y * coef * (x == 0 ? 1.0f : SQRT_HALF)); | 34 | y * coef * (x == 0 ? 1.0f : SQRT_HALF)); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | bool GetAnalogDirectionStatus(Input::AnalogDirection direction) const override { | ||
| 38 | switch (direction) { | ||
| 39 | case Input::AnalogDirection::RIGHT: | ||
| 40 | return right->GetStatus(); | ||
| 41 | case Input::AnalogDirection::LEFT: | ||
| 42 | return left->GetStatus(); | ||
| 43 | case Input::AnalogDirection::UP: | ||
| 44 | return up->GetStatus(); | ||
| 45 | case Input::AnalogDirection::DOWN: | ||
| 46 | return down->GetStatus(); | ||
| 47 | } | ||
| 48 | return false; | ||
| 49 | } | ||
| 50 | |||
| 37 | private: | 51 | private: |
| 38 | Button up; | 52 | Button up; |
| 39 | Button down; | 53 | Button down; |