From 6f079dcf2e91e7a8d2d509e21ff7856146ab9532 Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 6 Oct 1999 20:58:40 +0000 Subject: [PATCH] Added a simple auto-coordination capability. If only a single 2-axis joystick is found, and the user hasn't specified a preference, enable autocoordination. --- src/Joystick/joystick.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Joystick/joystick.cxx b/src/Joystick/joystick.cxx index ac38aaea2..1f766e363 100644 --- a/src/Joystick/joystick.cxx +++ b/src/Joystick/joystick.cxx @@ -31,6 +31,7 @@ #include #include +#include
#if defined( ENABLE_PLIB_JOYSTICK ) # include // plib include @@ -161,6 +162,21 @@ int fgJoystickInit( void ) { return 0; } + // I hate doing this sort of thing, but it's overridable from the + // command line/config file. If the user hasn't specified an + // autocoordination preference, and if they have a single 2 axis + // joystick, then automatical enable auto_coordination. + + if ( (current_options.get_auto_coordination() == + fgOPTIONS::FG_AUTO_COORD_NOT_SPECIFIED) && + (!js0->notWorking() && js1->notWorking() && (js0->getNumAxes() < 3) + ) + ) + { + current_options.set_auto_coordination(fgOPTIONS::FG_AUTO_COORD_ENABLED); + } + + #elif defined( ENABLE_GLUT_JOYSTICK ) glutJoystickFunc(joystick, 100); -- 2.39.5