X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fjoystick.h;fp=src%2Fjoystick.h;h=64fd00690bf2e106baa661f10de0619a67d82fdd;hb=41cfe645942062496cd063eb46e17d677a76c645;hp=a48c2bb39f2d54d212fc4bb25f41aab51ad54249;hpb=0e5a0f487acaed09a34c655b83ea637c83f4a0f0;p=rocksndiamonds.git diff --git a/src/joystick.h b/src/joystick.h index a48c2bb3..64fd0069 100644 --- a/src/joystick.h +++ b/src/joystick.h @@ -34,12 +34,22 @@ /* get these values from the program 'js' from the joystick package, */ /* set JOYSTICK_PERCENT to a threshold appropriate for your joystick */ + +#ifdef USE_SDL_LIBRARY +#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,6 +73,15 @@ #endif +#ifdef USE_SDL_LIBRARY +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); @@ -70,3 +89,4 @@ int AnyJoystick(void); int AnyJoystickButton(void); #endif +