/* XXX The below hack is done until freeglut's autoconf is updated. */
# define HAVE_USB_JS 1
-# if defined(__FreeBSD__) && __FreeBSD_version >= 500000
+# if defined(__FreeBSD__)
# include <sys/joystick.h>
# else
/*
if (usage > 0 && usage < _JS_MAX_BUTTONS + 1)
{
if (d)
- joy->os->cache_buttons |= (1 << usage - 1);
+ joy->os->cache_buttons |= (1 << ( usage - 1 ));
else
- joy->os->cache_buttons &= ~(1 << usage - 1);
+ joy->os->cache_buttons &= ~(1 << ( usage - 1 ));
}
}
}
# ifdef JS_NEW
unsigned char u;
# else
- int counter;
+# if defined( __linux__ )
+ int counter;
+# endif
# endif
#endif
*/
void fgInitialiseJoysticks ( void )
{
- /* Initialization courtesy of OpenGLUT -- do we want it? */
- if( !fgState.JoysticksInitialised )
- {
- int ident ;
- for ( ident = 0; ident < MAX_NUM_JOYSTICKS; ident++ )
- fghJoystickInit( ident );
+ if( !fgState.JoysticksInitialised )
+ {
+ int ident ;
+ for ( ident = 0; ident < MAX_NUM_JOYSTICKS; ident++ )
+ fghJoystickInit( ident );
- fgState.JoysticksInitialised = GL_TRUE;
- }
+ fgState.JoysticksInitialised = GL_TRUE;
+ }
}
/*
*/
int fgJoystickDetect( void )
{
- int ident;
+ int ident;
- fgInitialiseJoysticks ();
+ fgInitialiseJoysticks ();
- if ( !fgJoystick )
- return 0;
+ if ( !fgJoystick )
+ return 0;
- if ( !fgState.JoysticksInitialised )
- return 0;
+ if ( !fgState.JoysticksInitialised )
+ return 0;
- for( ident=0; ident<MAX_NUM_JOYSTICKS; ident++ )
- if( fgJoystick[ident] && !fgJoystick[ident]->error )
- return 1;
+ for( ident=0; ident<MAX_NUM_JOYSTICKS; ident++ )
+ if( fgJoystick[ident] && !fgJoystick[ident]->error )
+ return 1;
- return 0;
+ return 0;
}
/*