Skip to content

Commit 15dddde

Browse files
committed
Fix build.
1 parent 4d59f8f commit 15dddde

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Common/NintendoSwitch/NintendoSwitch_ControllerDefs.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,30 @@ namespace NintendoSwitch{
1919
constexpr uint16_t TICKS_PER_SECOND = 125;
2020

2121
// Buttons
22+
enum Button : uint16_t{
23+
BUTTON_NONE = 0,
24+
BUTTON_Y = ((uint16_t)1 << 0),
25+
BUTTON_B = ((uint16_t)1 << 1),
26+
BUTTON_A = ((uint16_t)1 << 2),
27+
BUTTON_X = ((uint16_t)1 << 3),
28+
BUTTON_L = ((uint16_t)1 << 4),
29+
BUTTON_R = ((uint16_t)1 << 5),
30+
BUTTON_ZL = ((uint16_t)1 << 6),
31+
BUTTON_ZR = ((uint16_t)1 << 7),
32+
BUTTON_MINUS = ((uint16_t)1 << 8),
33+
BUTTON_PLUS = ((uint16_t)1 << 9),
34+
BUTTON_LCLICK = ((uint16_t)1 << 10),
35+
BUTTON_RCLICK = ((uint16_t)1 << 11),
36+
BUTTON_HOME = ((uint16_t)1 << 12),
37+
BUTTON_CAPTURE = ((uint16_t)1 << 13),
38+
};
39+
inline Button operator|(Button x, Button y){
40+
return (Button)((uint16_t)x | (uint16_t)y);
41+
}
42+
inline void operator|=(Button& x, Button y){
43+
x = (Button)((uint16_t)x | (uint16_t)y);
44+
}
45+
#if 0
2246
using Button = uint16_t;
2347
constexpr Button BUTTON_Y = ((uint16_t)1 << 0);
2448
constexpr Button BUTTON_B = ((uint16_t)1 << 1);
@@ -34,6 +58,7 @@ constexpr Button BUTTON_LCLICK = ((uint16_t)1 << 10);
3458
constexpr Button BUTTON_RCLICK = ((uint16_t)1 << 11);
3559
constexpr Button BUTTON_HOME = ((uint16_t)1 << 12);
3660
constexpr Button BUTTON_CAPTURE = ((uint16_t)1 << 13);
61+
#endif
3762

3863
// Dpad
3964
enum DpadPosition : uint8_t{

0 commit comments

Comments
 (0)