mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-06 18:12:55 +02:00
Add preprocessor checks and warnings for building on older Xcode SDKs
This commit is contained in:
parent
88c5cfbbae
commit
f81dda36fd
1 changed files with 15 additions and 2 deletions
|
@ -13,6 +13,7 @@
|
|||
// Yes, it is still a mess, but it is working.
|
||||
|
||||
#import <GameController/GameController.h>
|
||||
#include <Availability.h>
|
||||
|
||||
#import <SDL_scancode.h>
|
||||
#import <SDL_keyboard.h>
|
||||
|
@ -194,17 +195,29 @@ s.d.ca.dir = (axis.value >= 0) ? AxisDir::Positive : AxisDir::Negative;
|
|||
checkButtonElement(dpad, dpad.right, SDL_CONTROLLER_BUTTON_DPAD_RIGHT, 12)
|
||||
checkButtonAlt(leftShoulder, SDL_CONTROLLER_BUTTON_LEFTSHOULDER, 12)
|
||||
checkButtonAlt(rightShoulder, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, 12)
|
||||
|
||||
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_14_1
|
||||
// Requires macOS 10.14.1+
|
||||
checkButtonAlt(leftThumbstickButton, SDL_CONTROLLER_BUTTON_LEFTSTICK, 14)
|
||||
checkButtonAlt(rightThumbstickButton, SDL_CONTROLLER_BUTTON_RIGHTSTICK, 14)
|
||||
|
||||
#else
|
||||
#warning "This SDK doesn't support the detection of thumbstick buttons. You will not be able to rebind them from the menu on 10.14.1 or higher."
|
||||
#endif
|
||||
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_15
|
||||
// Requires macOS 10.15+
|
||||
checkButton(Menu, SDL_CONTROLLER_BUTTON_START, 15)
|
||||
checkButton(Options, SDL_CONTROLLER_BUTTON_BACK, 15)
|
||||
#else
|
||||
#warning "This SDK doesn't support the detection of Start and Back buttons. You will not be able to rebind them from the menu on 10.15 or higher."
|
||||
#endif
|
||||
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_11_0
|
||||
// Requires macOS 11.0+
|
||||
checkButton(Home, SDL_CONTROLLER_BUTTON_GUIDE, 16)
|
||||
#else
|
||||
#warning "This SDK doesn't support the detection of the Guide button. You will not be able to rebind it from the menu on 11.0 or higher."
|
||||
#endif
|
||||
|
||||
checkAxis(leftThumbstick, xAxis, SDL_CONTROLLER_AXIS_LEFTX)
|
||||
checkAxis(leftThumbstick, yAxis, SDL_CONTROLLER_AXIS_LEFTY)
|
||||
|
|
Loading…
Add table
Reference in a new issue