X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fjoystick.h;h=735f75c8f932683afbf3f28ff4c4de3a000d7591;hb=1465ca1ffdf2104d25b9a46ca9bf8a3f175403fd;hp=a48c2bb39f2d54d212fc4bb25f41aab51ad54249;hpb=2357c391b4a587709627cc30316734b3c83c8134;p=rocksndiamonds.git diff --git a/src/joystick.h b/src/joystick.h index a48c2bb3..735f75c8 100644 --- a/src/joystick.h +++ b/src/joystick.h @@ -19,6 +19,7 @@ /* values for the joystick */ #define JOYSTICK_OFF 0 #define JOYSTICK_AVAILABLE 1 + #ifdef __FreeBSD__ #include #define DEV_JOYSTICK_0 "/dev/joy0" @@ -34,12 +35,22 @@ /* get these values from the program 'js' from the joystick package, */ /* set JOYSTICK_PERCENT to a threshold appropriate for your joystick */ + +#ifdef TARGET_SDL +#define JOYSTICK_XLEFT -32767 +#define JOYSTICK_XMIDDLE 0 +#define JOYSTICK_XRIGHT 32767 +#define JOYSTICK_YUPPER -32767 +#define JOYSTICK_YMIDDLE 0 +#define JOYSTICK_YLOWER 32767 +#else #define JOYSTICK_XLEFT 30 #define JOYSTICK_XMIDDLE 530 #define JOYSTICK_XRIGHT 1250 #define JOYSTICK_YUPPER 40 #define JOYSTICK_YMIDDLE 680 #define JOYSTICK_YLOWER 1440 +#endif #define JOYSTICK_PERCENT 25 @@ -63,10 +74,19 @@ #endif +#if defined(TARGET_SDL) +SDL_Joystick *Get_SDL_Joystick(int); +boolean Open_SDL_Joystick(int); +void Close_SDL_Joystick(int); +boolean Check_SDL_JoystickOpened(int); +void HandleJoystickEvent(Event *); +int Get_SDL_Joystick_Axis(int, int); +#endif + void CheckJoystickData(void); int Joystick(int); int JoystickButton(int); int AnyJoystick(void); int AnyJoystickButton(void); -#endif +#endif /* JOYSTICK_H */