Changes to use the new joystick library if it is available.
This commit is contained in:
parent
372eeb7aa7
commit
309f1543a9
3 changed files with 32 additions and 14 deletions
|
@ -64,7 +64,11 @@
|
||||||
#include <Cockpit/cockpit.hxx>
|
#include <Cockpit/cockpit.hxx>
|
||||||
#include <Debug/fg_debug.h>
|
#include <Debug/fg_debug.h>
|
||||||
#include <GUI/gui.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/fg_geodesy.hxx>
|
||||||
#include <Math/mat3.h>
|
#include <Math/mat3.h>
|
||||||
#include <Math/polar3d.hxx>
|
#include <Math/polar3d.hxx>
|
||||||
|
@ -464,8 +468,6 @@ static void fgMainLoop( void ) {
|
||||||
int elapsed, multi_loop;
|
int elapsed, multi_loop;
|
||||||
int i;
|
int i;
|
||||||
double accum;
|
double accum;
|
||||||
// double joy_x, joy_y;
|
|
||||||
// int joy_b1, joy_b2;
|
|
||||||
|
|
||||||
c = &cur_control_params;
|
c = &cur_control_params;
|
||||||
f = current_aircraft.flight;
|
f = current_aircraft.flight;
|
||||||
|
@ -511,12 +513,10 @@ static void fgMainLoop( void ) {
|
||||||
// update "time"
|
// update "time"
|
||||||
fgTimeUpdate(f, t);
|
fgTimeUpdate(f, t);
|
||||||
|
|
||||||
// Read joystick
|
#ifdef ENABLE_JOYSTICK_SUPPORT
|
||||||
/* fgJoystickRead( &joy_x, &joy_y, &joy_b1, &joy_b2 );
|
// Read joystick and update control settings
|
||||||
printf( "Joystick X %f Y %f B1 %d B2 %d\n",
|
fgJoystickRead();
|
||||||
joy_x, joy_y, joy_b1, joy_b2 );
|
#endif
|
||||||
fgElevSet( -joy_y );
|
|
||||||
fgAileronSet( joy_x ); */
|
|
||||||
|
|
||||||
// Get elapsed time for this past frame
|
// Get elapsed time for this past frame
|
||||||
elapsed = fgGetTimeInterval();
|
elapsed = fgGetTimeInterval();
|
||||||
|
@ -894,6 +894,9 @@ int main( int argc, char **argv ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// 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
|
// Revision 1.59 1998/10/17 01:34:21 curt
|
||||||
// C++ ifying ...
|
// C++ ifying ...
|
||||||
//
|
//
|
||||||
|
|
|
@ -13,6 +13,13 @@ if ENABLE_WIN32_AUDIO
|
||||||
LIBS += -lwinmm
|
LIBS += -lwinmm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if ENABLE_JOYSTICK_SUPPORT
|
||||||
|
DEFS += -DENABLE_JOYSTICK_SUPPORT
|
||||||
|
JOYSTICK_LIBS = $(top_builddir)/Simulator/Joystick/libJoystick.a
|
||||||
|
else
|
||||||
|
JOYSTICK_LIBS =
|
||||||
|
endif
|
||||||
|
|
||||||
if ENABLE_XMESA_FX
|
if ENABLE_XMESA_FX
|
||||||
DEFS += -DXMESA -DFX
|
DEFS += -DXMESA -DFX
|
||||||
endif
|
endif
|
||||||
|
@ -46,8 +53,7 @@ fgfs_LDADD = \
|
||||||
$(top_builddir)/Simulator/Objects/libObjects.a \
|
$(top_builddir)/Simulator/Objects/libObjects.a \
|
||||||
$(top_builddir)/Simulator/Time/libTime.a \
|
$(top_builddir)/Simulator/Time/libTime.a \
|
||||||
$(top_builddir)/Simulator/Weather/libWeather.a \
|
$(top_builddir)/Simulator/Weather/libWeather.a \
|
||||||
$(top_builddir)/Simulator/Joystick/libJoystick.a \
|
$(JOYSTICK_LIBS) $(AUDIO_LIBS) \
|
||||||
$(AUDIO_LIBS) \
|
|
||||||
$(top_builddir)/Lib/Math/libMath.a \
|
$(top_builddir)/Lib/Math/libMath.a \
|
||||||
$(top_builddir)/Lib/Bucket/libBucket.a \
|
$(top_builddir)/Lib/Bucket/libBucket.a \
|
||||||
$(top_builddir)/Lib/Debug/libDebug.a \
|
$(top_builddir)/Lib/Debug/libDebug.a \
|
||||||
|
|
|
@ -50,7 +50,11 @@
|
||||||
#include <Autopilot/autopilot.hxx>
|
#include <Autopilot/autopilot.hxx>
|
||||||
#include <Cockpit/cockpit.hxx>
|
#include <Cockpit/cockpit.hxx>
|
||||||
#include <Debug/fg_debug.h>
|
#include <Debug/fg_debug.h>
|
||||||
#include <Joystick/joystick.h>
|
|
||||||
|
#ifdef ENABLE_JOYSTICK_SUPPORT
|
||||||
|
# include <Joystick/joystick.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <Math/fg_geodesy.hxx>
|
#include <Math/fg_geodesy.hxx>
|
||||||
#include <Math/fg_random.h>
|
#include <Math/fg_random.h>
|
||||||
#include <Math/point3d.hxx>
|
#include <Math/point3d.hxx>
|
||||||
|
@ -345,12 +349,14 @@ int fgInitSubsystems( void )
|
||||||
FG_Altitude * FEET_TO_METER);
|
FG_Altitude * FEET_TO_METER);
|
||||||
// end of thing that I just stuck in that I should probably move
|
// end of thing that I just stuck in that I should probably move
|
||||||
|
|
||||||
|
#ifdef ENABLE_JOYSTICK_SUPPORT
|
||||||
// Joystick support
|
// Joystick support
|
||||||
if (fgJoystickInit(0) ) {
|
if ( fgJoystickInit() ) {
|
||||||
// Joystick initialized ok.
|
// Joystick initialized ok.
|
||||||
} else {
|
} else {
|
||||||
fgPrintf( FG_GENERAL, FG_EXIT, "Error in Joystick initialization!\n" );
|
fgPrintf( FG_GENERAL, FG_ALERT, "Error in Joystick initialization!\n" );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Autopilot init added here, by Jeff Goeke-Smith
|
// Autopilot init added here, by Jeff Goeke-Smith
|
||||||
fgAPInit(¤t_aircraft);
|
fgAPInit(¤t_aircraft);
|
||||||
|
@ -362,6 +368,9 @@ int fgInitSubsystems( void )
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.45 1998/10/25 10:57:21 curt
|
||||||
|
// Changes to use the new joystick library if it is available.
|
||||||
|
//
|
||||||
// Revision 1.44 1998/10/18 01:17:17 curt
|
// Revision 1.44 1998/10/18 01:17:17 curt
|
||||||
// Point3D tweaks.
|
// Point3D tweaks.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Reference in a new issue