diff options
author | Ameer <aj662@drexel.edu> | 2020-06-23 17:37:15 -0400 |
---|---|---|
committer | Ameer <aj662@drexel.edu> | 2020-06-23 17:37:15 -0400 |
commit | 743e1f02a06187164d55f4208b8e85742abd4498 (patch) | |
tree | 6eeeaddbc7cc3dac770c1d2efada1f4e68394939 /src/input_common/gcadapter/gc_adapter.h | |
parent | d4e07fd95e999e34562428c628985a6eb1fb532d (diff) |
cleanup check access, read, and factory GetNextInput funcs. Use size rather than magic number
Diffstat (limited to 'src/input_common/gcadapter/gc_adapter.h')
-rw-r--r-- | src/input_common/gcadapter/gc_adapter.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/input_common/gcadapter/gc_adapter.h b/src/input_common/gcadapter/gc_adapter.h index 7aed0b480..abfe0d7b3 100644 --- a/src/input_common/gcadapter/gc_adapter.h +++ b/src/input_common/gcadapter/gc_adapter.h @@ -37,6 +37,12 @@ enum PadButton { }; +/// Used to loop through the and assign button in poller +static constexpr std::array<PadButton, 12> PadButtonArray{ + PAD_BUTTON_LEFT, PAD_BUTTON_RIGHT, PAD_BUTTON_DOWN, PAD_BUTTON_UP, + PAD_TRIGGER_Z, PAD_TRIGGER_R, PAD_TRIGGER_L, PAD_BUTTON_A, + PAD_BUTTON_B, PAD_BUTTON_X, PAD_BUTTON_Y, PAD_BUTTON_START}; + enum class PadAxes : u8 { StickX, StickY, @@ -100,7 +106,7 @@ public: const std::array<GCState, 4>& GetPadState() const; private: - GCPadStatus CheckStatus(int port, const std::array<u8, 37>& adapter_payload); + GCPadStatus GetPadStatus(int port, const std::array<u8, 37>& adapter_payload); void PadToState(const GCPadStatus& pad, GCState& state); |