1
0
mirror of https://github.com/cathery/sys-con.git synced 2024-12-26 03:17:58 +00:00

Add a static assertion for correct joystick values

This commit is contained in:
cathery 2020-01-25 01:41:11 +03:00
parent bde2cfa2b0
commit f59352bee3

View File

@ -4,6 +4,11 @@
#define JOYSTICK_MAX_FIXED (JOYSTICK_MAX - 1) #define JOYSTICK_MAX_FIXED (JOYSTICK_MAX - 1)
#define JOYSTICK_MIN_FIXED (JOYSTICK_MIN + 1) #define JOYSTICK_MIN_FIXED (JOYSTICK_MIN + 1)
static_assert(
JOYSTICK_MAX_FIXED <= 32767 && JOYSTICK_MIN_FIXED >= -32767,
"Seems like you're using a libnx build that has fixed the joystick values, please remove these _FIXED defines and use the unmodified joystick values instead"
);
SwitchControllerHandler::SwitchControllerHandler(std::unique_ptr<IController> &&controller) SwitchControllerHandler::SwitchControllerHandler(std::unique_ptr<IController> &&controller)
: m_controller(std::move(controller)) : m_controller(std::move(controller))
{ {