]> git.mxchange.org Git - flightgear.git/commitdiff
Added custom joystick client support so that flight gear can read values
authorcurt <curt>
Wed, 19 Apr 2000 21:22:16 +0000 (21:22 +0000)
committercurt <curt>
Wed, 19 Apr 2000 21:22:16 +0000 (21:22 +0000)
being shipped over from a separate joystick server.

src/Main/fg_io.cxx
src/Main/main.cxx
src/Main/options.cxx

index 45934a1da7bf027b247d056ce3d1d7208ac7f96a..981a6f9e3e2902e09aa308c616f732710dcdad6b 100644 (file)
@@ -41,6 +41,7 @@
 #include <Network/nmea.hxx>
 #include <Network/pve.hxx>
 #include <Network/rul.hxx>
+#include <Network/joyclient.hxx>
 
 #include <Time/timestamp.hxx>
 
@@ -86,6 +87,9 @@ static FGProtocol *parse_port_config( const string& config )
     } else if ( protocol == "rul" ) {
        FGRUL *rul = new FGRUL;
        io = rul;
+    } else if ( protocol == "joyclient" ) {
+       FGJoyClient *joyclient = new FGJoyClient;
+       io = joyclient;
     } else {
        return NULL;
     }
index 01ef96ee2367823ffa2c7ad2b90e7271caa8494c..f1d9ad8f6cfa73b213ae4372ef98f733b47d5bc1 100644 (file)
@@ -1292,10 +1292,6 @@ int main( int argc, char **argv ) {
     _control87(MCW_EM, MCW_EM);  /* defined in float.h */
 #endif
 
-    // Initialize ssg (from plib).  Needs to come before we do any
-    // other ssg related stuff
-    ssgInit();
-
     // set default log levels
     fglog().setLogLevels( FG_ALL, FG_INFO );
 
@@ -1324,10 +1320,14 @@ int main( int argc, char **argv ) {
 
     // Initialize the various GLUT Event Handlers.
     if( !fgGlutInitEvents() ) {
-       FG_LOG( FG_GENERAL, FG_ALERT, 
-               "GLUT event handler initialization failed ..." );
-       exit(-1);
+       FG_LOG( FG_GENERAL, FG_ALERT, 
+               "GLUT event handler initialization failed ..." );
+       exit(-1);
     }
+    // Initialize ssg (from plib).  Needs to come before we do any
+    // other ssg stuff, but after opengl/glut has been initialized.
+    ssgInit();
 
     // Initialize the user interface (we need to do this before
     // passing off control to glut and before fgInitGeneral to get our
index 1a6a5a7e088f4ebb14c79fcb48e4f7b5d25662b4..d63ab83f542afe42b7d1237ee6014c11ecdf22fd 100644 (file)
@@ -767,6 +767,8 @@ int fgOPTIONS::parse_option( const string& arg ) {
        parse_channel( "pve", arg.substr(6) );
     } else if ( arg.find( "--rul=" ) != string::npos ) {
        parse_channel( "rul", arg.substr(6) );
+    } else if ( arg.find( "--joyclient=" ) != string::npos ) {
+       parse_channel( "joyclient", arg.substr(12) );
 #ifdef FG_NETWORK_OLK
     } else if ( arg == "--disable-network-olk" ) {
        network_olk = false;