diff --git a/src/gl_glx.c b/src/gl_glx.c index a886efc..7143aee 100644 --- a/src/gl_glx.c +++ b/src/gl_glx.c @@ -147,14 +147,7 @@ void init_joystick() { } #endif -#ifdef Joystick -static cvar_t *in_joystick; -static qboolean joystick_avail = false; -static int joy_fd, jx, jy, jt; -static cvar_t *j_invert_y; -#endif - -#ifdef Joystick +#ifdef HAVE_JOYSTICK void InitJoystick() { int i, err; glob_t pglob; @@ -537,7 +530,7 @@ static void IN_DeactivateMouse( void ) mouse_active = false; } -#ifdef Joystick +#ifdef HAVE_JOYSTICK if (joystick_avail) if (close(joy_fd)) ri.Con_Printf(PRINT_ALL, "Error, Problem closing joystick."); @@ -559,7 +552,7 @@ static void IN_ActivateMouse( void ) void RW_IN_Frame (void) { int i; -#ifdef Joystick +#ifdef HAVE_JOYSTICK struct js_event e; int key_index; #endif @@ -573,7 +566,7 @@ void RW_IN_Frame (void) } mouse_oldbuttonstate = mouse_buttonstate; } -#ifdef Joystick +#ifdef HAVE_JOYSTICK if (joystick_avail) { while (read(joy_fd, &e, sizeof(struct js_event))!=-1) { if (JS_EVENT_BUTTON & e.type) { diff --git a/src/rw_sdl.c b/src/rw_sdl.c index 471f869..6a3531b 100644 --- a/src/rw_sdl.c +++ b/src/rw_sdl.c @@ -126,18 +126,7 @@ static cvar_t *m_pitch; static cvar_t *m_forward; static cvar_t *my_freelook; -/************************ - * Joystick - ************************/ -#ifdef Joystick -static cvar_t *in_joystick; -static cvar_t *j_invert_y; -static qboolean joystick_avail; -static SDL_Joystick *joy; -static int joy_oldbuttonstate; -static int joy_numbuttons; -static int jx, jy, jt; - +#ifdef HAVE_JOYSTICK /************************ * Joystick ************************/ @@ -149,7 +138,7 @@ static int joy_oldbuttonstate; static int joy_numbuttons; static int jx, jy, jt; static int lr_axis, ud_axis, throttle_axis; -#endif +#endif /* HAVE_JOYSTICK */ static void Force_CenterView_f (void) { @@ -1081,7 +1070,7 @@ void KBD_Update(void) if (!mx && !my) SDL_GetRelativeMouseState(&mx, &my); -#ifdef Joystick +#ifdef HAVE_JOYSTICK if (joystick_avail && joy) { jx = SDL_JoystickGetAxis(joy, lr_axis); jy = SDL_JoystickGetAxis(joy, ud_axis); diff --git a/src/rw_x11.c b/src/rw_x11.c index 3858047..a8aa127 100644 --- a/src/rw_x11.c +++ b/src/rw_x11.c @@ -620,7 +620,7 @@ static void IN_ActivateMouse( void ) install_grabs(); mouse_active = true; } -#ifdef Joystick +#ifdef HAVE_JOYSTICK if (joystick_avail) if (close(joy_fd)) ri.Con_Printf(PRINT_ALL, "Error, Problem closing joystick.");