mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-12-18 20:08:06 +00:00
JOY_ID constant
This commit is contained in:
@@ -805,7 +805,7 @@ EX bool is_joy_any(int sym) {
|
||||
}
|
||||
|
||||
EX bool is_joy_index(int sym, int index) {
|
||||
return is_joy_any(sym) && (sym & 127) == index;
|
||||
return is_joy_any(sym) && (sym & (JOY_ID - 1)) == index;
|
||||
}
|
||||
|
||||
#if HDR
|
||||
@@ -1227,7 +1227,7 @@ EX void handle_event(SDL_Event& ev) {
|
||||
}
|
||||
|
||||
else if(ev.type == SDL_EVENT_JOYSTICK_BUTTON_DOWN && defaultjoy) {
|
||||
sym = uni = PSEUDOKEY_JOY + 128 * ev.jbutton.which + ev.jbutton.button;
|
||||
sym = uni = PSEUDOKEY_JOY + JOY_ID * ev.jbutton.which + ev.jbutton.button;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
#define PSEUDOKEY_ONSCREEN_KEYBOARD 2509
|
||||
|
||||
#define PSEUDOKEY_JOY 4096
|
||||
#define JOY_ID 128
|
||||
|
||||
#ifndef CAP_PNG
|
||||
#define CAP_PNG (!ISMOBWEB)
|
||||
|
||||
Reference in New Issue
Block a user