From 4e225f78bc2b26c759df307a316578c42b228a7f Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Wed, 1 Jan 2003 00:55:03 +0000 Subject: [PATCH] enabled linux joystick --- arch/linux/joystick.c | 15 ++++++--------- arch/sdl/Makefile.am | 2 ++ arch/sdl/event.c | 29 ++++++----------------------- configure.ac | 8 ++++++++ 4 files changed, 22 insertions(+), 32 deletions(-) diff --git a/arch/linux/joystick.c b/arch/linux/joystick.c index b569796c..c4f2b9ab 100644 --- a/arch/linux/joystick.c +++ b/arch/linux/joystick.c @@ -1,15 +1,8 @@ +/* $Id: joystick.c,v 1.2 2003-01-01 00:55:03 btb Exp $ */ /* - * $Source: /cvs/cvsroot/d2x/arch/linux/joystick.c,v $ - * $Revision: 1.1 $ - * $Author: bradleyb $ - * $Date: 2001-10-24 09:25:05 $ * * Linux joystick support * - * $Log: not supported by cvs2svn $ - * Revision 1.4 2001/01/29 14:03:57 bradleyb - * Fixed build, minor fixes - * */ #ifdef HAVE_CONFIG_H @@ -112,7 +105,9 @@ int j_Update_state () { } -void joy_set_cal_vals(int *axis_min, int *axis_center, int *axis_max) { +void joy_set_cal_vals(int *axis_min, int *axis_center, int *axis_max) +{ +/* stpohle - this is already done in the "joy_init" function, so we don't need it in here. int i; for (i = 0; i < 4; i++) { @@ -120,6 +115,8 @@ void joy_set_cal_vals(int *axis_min, int *axis_center, int *axis_max) { j_axis[i].min_val = axis_min[i]; j_axis[i].max_val = axis_max[i]; } + +*/ } diff --git a/arch/sdl/Makefile.am b/arch/sdl/Makefile.am index 31981731..8d11ff91 100644 --- a/arch/sdl/Makefile.am +++ b/arch/sdl/Makefile.am @@ -4,7 +4,9 @@ noinst_LIBRARIES = libarch_sdl.a INCLUDES = -I$(top_srcdir)/arch/include -I$(top_srcdir)/include -I$(top_srcdir)/main +if !USE_LINUX_JOY JOYSTICK_SRCS = joy.c joydefs.c +endif if !USE_SVGALIB if !USE_GGI diff --git a/arch/sdl/event.c b/arch/sdl/event.c index 9d13ed67..d8560669 100644 --- a/arch/sdl/event.c +++ b/arch/sdl/event.c @@ -1,30 +1,9 @@ +/* $Id: event.c,v 1.7 2003-01-01 00:55:03 btb Exp $ */ + /* - * $Source: /cvs/cvsroot/d2x/arch/sdl/event.c,v $ - * $Revision: 1.6 $ - * $Author: bradleyb $ - * $Date: 2002-07-16 22:37:14 $ * * SDL Event related stuff * - * $Log: not supported by cvs2svn $ - * Revision 1.5 2002/02/16 02:08:30 bradleyb - * allow older sdl versions - * - * Revision 1.4 2001/12/03 02:43:02 bradleyb - * lots of makefile fixes, and sdl joystick stuff - * - * Revision 1.3 2001/11/14 10:43:10 bradleyb - * remove cruft, fix formatting, begin joystick stuff - * - * Revision 1.2 2001/10/31 07:41:54 bradleyb - * Sync with d1x - * - * Revision 1.1 2001/10/24 09:25:05 bradleyb - * Moved input stuff to arch subdirs, as in d1x. - * - * Revision 1.2 2001/01/29 14:03:57 bradleyb - * Fixed build, minor fixes - * */ #ifdef HAVE_CONFIG_H @@ -39,8 +18,10 @@ extern void key_handler(SDL_KeyboardEvent *event); extern void mouse_button_handler(SDL_MouseButtonEvent *mbe); extern void mouse_motion_handler(SDL_MouseMotionEvent *mme); +#ifndef USE_LINUX_JOY // stpohle - so we can choose at compile time.. extern void joy_button_handler(SDL_JoyButtonEvent *jbe); extern void joy_axis_handler(SDL_JoyAxisEvent *jae); +#endif static int initialised=0; @@ -61,6 +42,7 @@ void event_poll() case SDL_MOUSEMOTION: mouse_motion_handler((SDL_MouseMotionEvent *)&event); break; +#ifndef USE_LINUX_JOY // stpohle - so we can choose at compile time.. case SDL_JOYBUTTONDOWN: case SDL_JOYBUTTONUP: joy_button_handler((SDL_JoyButtonEvent *)&event); @@ -71,6 +53,7 @@ void event_poll() case SDL_JOYBALLMOTION: case SDL_JOYHATMOTION: break; +#endif case SDL_QUIT: { void quit_request(); quit_request(); diff --git a/configure.ac b/configure.ac index 6d76c13a..15de539e 100644 --- a/configure.ac +++ b/configure.ac @@ -114,6 +114,14 @@ if test x$enable_release = xyes; then D2X_FEATURES="release ${D2X_FEATURES}" fi +dnl Build without using sdl-joystick ? +AC_ARG_ENABLE(linuxjoy, + [ --enable-linuxjoy do not use the SDL Joystick. (eg for MS Sidewinder)],,) +if test x$enable_linuxjoy = xyes; then + AC_DEFINE(USE_LINUX_JOY,,[define to not use the SDL_Joystick routines.]) +fi +AM_CONDITIONAL(USE_LINUX_JOY, test x$enable_linuxjoy = xyes) + dnl Build with FAST_FILE_IO? AC_ARG_ENABLE(fastfileio, [ --disable-fastfileio Disable fast file i/o. ],,) -- 2.39.2