#include <Cockpit/cockpit.hxx>
#include <Debug/fg_debug.h>
#include <GUI/gui.h>
-#include <Joystick/joystick.h>
+
+#ifdef ENABLE_JOYSTICK_SUPPORT
+# include <Joystick/joystick.hxx>
+#endif
+
#include <Math/fg_geodesy.hxx>
#include <Math/mat3.h>
#include <Math/polar3d.hxx>
// What should we do when we have nothing else to do? Let's get ready
// for the next move and update the display?
static void fgMainLoop( void ) {
- fgCONTROLS *c;
fgFLIGHT *f;
fgGENERAL *g;
fgTIME *t;
int elapsed, multi_loop;
int i;
double accum;
- // double joy_x, joy_y;
- // int joy_b1, joy_b2;
- c = &cur_control_params;
f = current_aircraft.flight;
g = &general;
t = &cur_time_params;
// update "time"
fgTimeUpdate(f, t);
- // Read joystick
- /* fgJoystickRead( &joy_x, &joy_y, &joy_b1, &joy_b2 );
- printf( "Joystick X %f Y %f B1 %d B2 %d\n",
- joy_x, joy_y, joy_b1, joy_b2 );
- fgElevSet( -joy_y );
- fgAileronSet( joy_x ); */
+#ifdef ENABLE_JOYSTICK_SUPPORT
+ // Read joystick and update control settings
+ fgJoystickRead();
+#endif
// Get elapsed time for this past frame
elapsed = fgGetTimeInterval();
// Run audio scheduler
#ifdef ENABLE_AUDIO_SUPPORT
if ( current_options.get_sound() && audio_sched->working() ) {
- double param = c->throttle[0] * 2.0 + 1.0;
+ double param = controls.get_throttle( 0 ) * 2.0 + 1.0;
pitch_envelope.setStep ( 0, 0.01, param );
volume_envelope.setStep ( 0, 0.01, param );
// $Log$
+// Revision 1.61 1998/10/25 14:08:47 curt
+// Turned "struct fgCONTROLS" into a class, with inlined accessor functions.
+//
+// Revision 1.60 1998/10/25 10:57:18 curt
+// Changes to use the new joystick library if it is available.
+//
// Revision 1.59 1998/10/17 01:34:21 curt
// C++ ifying ...
//