diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2023-02-17 02:39:51 +0100 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2023-02-26 05:20:32 +0100 |
commit | 60688bf0d5fa6daf40ccd10af82386bc2d32f1fa (patch) | |
tree | 242cb7de7a65be1337f61c4bcdd8dfca79b0ecfa /src/core/hid/hid_types.h | |
parent | Merge pull request #9848 from german77/metroid_motion (diff) | |
download | yuzu-60688bf0d5fa6daf40ccd10af82386bc2d32f1fa.tar yuzu-60688bf0d5fa6daf40ccd10af82386bc2d32f1fa.tar.gz yuzu-60688bf0d5fa6daf40ccd10af82386bc2d32f1fa.tar.bz2 yuzu-60688bf0d5fa6daf40ccd10af82386bc2d32f1fa.tar.lz yuzu-60688bf0d5fa6daf40ccd10af82386bc2d32f1fa.tar.xz yuzu-60688bf0d5fa6daf40ccd10af82386bc2d32f1fa.tar.zst yuzu-60688bf0d5fa6daf40ccd10af82386bc2d32f1fa.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hid/hid_types.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/hid/hid_types.h b/src/core/hid/hid_types.h index 6b35f448c..983f0addd 100644 --- a/src/core/hid/hid_types.h +++ b/src/core/hid/hid_types.h @@ -690,6 +690,32 @@ constexpr size_t NpadIdTypeToIndex(NpadIdType npad_id_type) { } } +/// Converts a NpadIdType to a config array index. +constexpr size_t NpadIdTypeToConfigIndex(NpadIdType npad_id_type) { + switch (npad_id_type) { + case NpadIdType::Player1: + return 0; + case NpadIdType::Player2: + return 1; + case NpadIdType::Player3: + return 2; + case NpadIdType::Player4: + return 3; + case NpadIdType::Player5: + return 4; + case NpadIdType::Player6: + return 5; + case NpadIdType::Player7: + return 6; + case NpadIdType::Player8: + return 7; + case NpadIdType::Other: + case NpadIdType::Handheld: + default: + return 0; + } +} + /// Converts an array index to a NpadIdType constexpr NpadIdType IndexToNpadIdType(size_t index) { switch (index) { |