comparison controller_info.c @ 2526:9c6f53425140

Fix SDL version guard for paddle buttons
author Michael Pavone <pavone@retrodev.com>
date Mon, 11 Nov 2024 10:45:14 -0800
parents e836cf11783b
children 8675663d4984
comparison
equal deleted inserted replaced
2525:1843adbe9899 2526:9c6f53425140
326 } 326 }
327 327
328 const char *get_button_label(controller_info *info, int button) 328 const char *get_button_label(controller_info *info, int button)
329 { 329 {
330 #ifndef USE_FBDEV 330 #ifndef USE_FBDEV
331 #if SDL_VERSION_ATLEAST(2,0,12) 331 #if SDL_VERSION_ATLEAST(2,0,14)
332 if (info->subtype == SUBTYPE_XBOX_ELITE && button >= SDL_CONTROLLER_BUTTON_PADDLE1 && button <= SDL_CONTROLLER_BUTTON_PADDLE4) { 332 if (info->subtype == SUBTYPE_XBOX_ELITE && button >= SDL_CONTROLLER_BUTTON_PADDLE1 && button <= SDL_CONTROLLER_BUTTON_PADDLE4) {
333 static char const * names[] = {"Paddle 1", "Paddle 2", "Paddle 3", "Paddle 4"}; 333 static char const * names[] = {"Paddle 1", "Paddle 2", "Paddle 3", "Paddle 4"};
334 return names[button - SDL_CONTROLLER_BUTTON_PADDLE1]; 334 return names[button - SDL_CONTROLLER_BUTTON_PADDLE1];
335 } 335 }
336 if (button == SDL_CONTROLLER_BUTTON_TOUCHPAD && (info->subtype == SUBTYPE_PS4 || info->subtype == SUBTYPE_PS5)) { 336 if (button == SDL_CONTROLLER_BUTTON_TOUCHPAD && (info->subtype == SUBTYPE_PS4 || info->subtype == SUBTYPE_PS5)) {