diff options
author | Ameer <aj662@drexel.edu> | 2020-06-24 17:39:30 +0200 |
---|---|---|
committer | Ameer <aj662@drexel.edu> | 2020-06-24 17:39:30 +0200 |
commit | c18dc9c707235d7ba6fe230cb3045f2c13d04e62 (patch) | |
tree | 1d59dca6a2bb959572d7c12cdff1d3fdcd4abab5 /src/input_common/gcadapter/gc_poller.cpp | |
parent | cleanup check access, read, and factory GetNextInput funcs. Use size rather than magic number (diff) | |
download | yuzu-c18dc9c707235d7ba6fe230cb3045f2c13d04e62.tar yuzu-c18dc9c707235d7ba6fe230cb3045f2c13d04e62.tar.gz yuzu-c18dc9c707235d7ba6fe230cb3045f2c13d04e62.tar.bz2 yuzu-c18dc9c707235d7ba6fe230cb3045f2c13d04e62.tar.lz yuzu-c18dc9c707235d7ba6fe230cb3045f2c13d04e62.tar.xz yuzu-c18dc9c707235d7ba6fe230cb3045f2c13d04e62.tar.zst yuzu-c18dc9c707235d7ba6fe230cb3045f2c13d04e62.zip |
Diffstat (limited to '')
-rw-r--r-- | src/input_common/gcadapter/gc_poller.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/input_common/gcadapter/gc_poller.cpp b/src/input_common/gcadapter/gc_poller.cpp index 977261884..06e16880f 100644 --- a/src/input_common/gcadapter/gc_poller.cpp +++ b/src/input_common/gcadapter/gc_poller.cpp @@ -96,8 +96,9 @@ Common::ParamPackage GCButtonFactory::GetNextInput() { // or to use a while loop shifting the bits to test and set the value. for (auto button : GCAdapter::PadButtonArray) { - if (pad.button & button) { - params.Set("button", button); + u16 button_value = static_cast<u16>(button); + if (pad.button & button_value) { + params.Set("button", button_value); break; } } @@ -105,7 +106,7 @@ Common::ParamPackage GCButtonFactory::GetNextInput() { // For Axis button implementation if (pad.axis != GCAdapter::PadAxes::Undefined) { params.Set("axis", static_cast<u8>(pad.axis)); - params.Set("button", GCAdapter::PAD_STICK); + params.Set("button", static_cast<u16>(GCAdapter::PadButton::PAD_STICK)); if (pad.axis_value > 128) { params.Set("direction", "+"); params.Set("threshold", "0.5"); |