X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flibgame%2Fjoystick.h;h=74dbad76c1b44a4bab313cd0c5387ceb0ce79b71;hb=835e565490c1502920280c77eed9bb65fa932164;hp=dfc3089b8851cd0402f7a2fb8f037bd071ee6849;hpb=0d4ace80d081e080a704ee15227e209d5953e325;p=rocksndiamonds.git diff --git a/src/libgame/joystick.h b/src/libgame/joystick.h index dfc3089b..74dbad76 100644 --- a/src/libgame/joystick.h +++ b/src/libgame/joystick.h @@ -1,15 +1,13 @@ -/*********************************************************** -* Artsoft Retro-Game Library * -*----------------------------------------------------------* -* (c) 1995-2006 Artsoft Entertainment * -* Holger Schemel * -* Detmolder Strasse 189 * -* 33604 Bielefeld * -* Germany * -* e-mail: info@artsoft.org * -*----------------------------------------------------------* -* joystick.h * -***********************************************************/ +// ============================================================================ +// Artsoft Retro-Game Library +// ---------------------------------------------------------------------------- +// (c) 1995-2014 by Artsoft Entertainment +// Holger Schemel +// info@artsoft.org +// http://www.artsoft.org/ +// ---------------------------------------------------------------------------- +// joystick.h +// ============================================================================ #ifndef JOYSTICK_H #define JOYSTICK_H @@ -19,6 +17,8 @@ #define JOYSTICK_NOT_AVAILABLE 0 #define JOYSTICK_AVAILABLE (1 << 0) #define JOYSTICK_ACTIVE (1 << 1) +#define JOYSTICK_CONFIGURED (1 << 2) +#define JOYSTICK_NOT_CONFIGURED (1 << 3) #define JOYSTICK_ACTIVATED (JOYSTICK_AVAILABLE | JOYSTICK_ACTIVE) #if defined(PLATFORM_FREEBSD) @@ -36,21 +36,14 @@ /* 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_MAX_AXIS_POS 32767 + +#define JOYSTICK_XLEFT -JOYSTICK_MAX_AXIS_POS #define JOYSTICK_XMIDDLE 0 -#define JOYSTICK_XRIGHT 32767 -#define JOYSTICK_YUPPER -32767 +#define JOYSTICK_XRIGHT +JOYSTICK_MAX_AXIS_POS +#define JOYSTICK_YUPPER -JOYSTICK_MAX_AXIS_POS #define JOYSTICK_YMIDDLE 0 -#define JOYSTICK_YLOWER 32767 -#else -#define JOYSTICK_XLEFT 1 -#define JOYSTICK_XMIDDLE 128 -#define JOYSTICK_XRIGHT 255 -#define JOYSTICK_YUPPER 1 -#define JOYSTICK_YMIDDLE 128 -#define JOYSTICK_YLOWER 255 -#endif +#define JOYSTICK_YLOWER +JOYSTICK_MAX_AXIS_POS #define JOYSTICK_PERCENT 25 @@ -72,11 +65,6 @@ #define JOY_BUTTON_NEW_PRESSED 2 #define JOY_BUTTON_NEW_RELEASED 3 -#if defined(PLATFORM_UNIX) -void UnixInitJoysticks(void); -boolean UnixReadJoystick(int, int *, int *, boolean *, boolean *); -#endif - char *getJoyNameFromJoySymbol(int); int getJoySymbolFromJoyName(char *); int getJoystickNrFromDeviceName(char *); @@ -84,6 +72,7 @@ char *getDeviceNameFromJoystickNr(int); void CheckJoystickData(void); int Joystick(int); +int JoystickExt(int, boolean); int JoystickButton(int); int AnyJoystick(void); int AnyJoystickButton(void);