1
0
Fork 0

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.
This commit is contained in:
curt 1999-10-06 20:58:40 +00:00
parent 6de1139450
commit 6f079dcf2e

View file

@ -31,6 +31,7 @@
#include <Aircraft/aircraft.hxx>
#include <Debug/logstream.hxx>
#include <Main/options.hxx>
#if defined( ENABLE_PLIB_JOYSTICK )
# include <js.h> // 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);