Oh, I forgot one thing. We defined our own ABS macro as well. So the macros should be:
Code:
#ifndef DEADBAND_INPUT_THRESHOLD
#define DEADBAND_INPUT_THRESHOLD 0.10
#endif
#define ABS(n) (((n) < 0)? -(n): (n))
#define DEADBAND(n,t) ((ABS(n) > (t))? (n): 0)
#define DEADBAND_INPUT(n) DEADBAND(n, DEADBAND_INPUT_THRESHOLD)
float x = DEADBAND_INPUT(joystick.GetX());
float y = DEADBAND_INPUT(-joystick.GetY());