]> git.mxchange.org Git - flightgear.git/commitdiff
Moved Oliver's network stuff to his own subdir: NetworkOLK.
authorcurt <curt>
Wed, 12 Jan 2000 18:09:35 +0000 (18:09 +0000)
committercurt <curt>
Wed, 12 Jan 2000 18:09:35 +0000 (18:09 +0000)
src/Cockpit/hud.cxx
src/Main/Makefile.am
src/Main/main.cxx
src/Main/options.cxx

index a85624fc2b6b3abaac0ac5fd966add290ce77856..d4f753855fae1238df5d9c1a1738445d5c652f31 100644 (file)
@@ -50,7 +50,7 @@
 #include <Math/fg_random.h>
 #include <Math/mat3.h>
 #include <Math/polar3d.hxx>
-#include <Network/network.h>
+#include <NetworkOLK/network.h>
 #include <Scenery/scenery.hxx>
 #include <Time/fg_timer.hxx>
 
@@ -1274,6 +1274,13 @@ void fgUpdateHUD( void ) {
   char *gmt_str = get_formated_gmt_time();
   HUD_TextList.add( fgText(40, 10, gmt_str) );
 
+#ifdef FG_NETWORK_OLK
+  if ( net_hud_display ) {
+      net_hud_update();
+  }
+#endif
+
+
   // temporary
   extern bool fgAPAltitudeEnabled( void );
   extern bool fgAPHeadingEnabled( void );
index 3d4f54170ee1efab5eba9329ea1a1d38223accd2..007c4686733a9a2e69cc0f225208f8db8cf3307c 100644 (file)
@@ -5,9 +5,18 @@ SERIAL_LIBS =
 endif
 
 if ENABLE_OLD_WEATHER
-WEATHER_LIBS = $(top_builddir)/Simulator/Weather/libWeather.a
+WEATHER_LIBS = $(top_builddir)/Simulator/Weather/libWeather.a
 else
-WEATHER_LIBS = $(top_builddir)/Simulator/WeatherCM/libWeatherCM.a
+WEATHER_LIBS = $(top_builddir)/Simulator/WeatherCM/libWeatherCM.a
+endif
+
+if ENABLE_NETWORK_OLK
+NETWORK_LIBS = \
+       $(top_builddir)/Simulator/Network/libNetwork.a \
+       $(top_builddir)/Simulator/NetworkOLK/libNetworkOLK.a
+else
+NETWORK_LIBS = \
+       $(top_builddir)/Simulator/Network/libNetwork.a
 endif
 
 if OLD_AUTOMAKE
@@ -46,7 +55,7 @@ fgfs_LDADD = \
        $(top_builddir)/Simulator/GUI/libGUI.a \
        $(top_builddir)/Simulator/Scenery/libScenery.a \
        $(top_builddir)/Simulator/Airports/libAirports.a \
-        $(top_builddir)/Simulator/Network/libNetwork.a \
+        $(NETWORK_LIBS) \
        $(top_builddir)/Simulator/Objects/libObjects.a \
        $(top_builddir)/Simulator/Clouds/libClouds.a \
        $(top_builddir)/Simulator/Time/libTime.a \
index 7f4d5cd304b1a205a06b9d4ddf258997c6d03543..a6c2bcaea631a48a36a8bdfd77c64925b0c270f5 100644 (file)
@@ -82,7 +82,7 @@
 #include <Math/fg_random.h>
 #include <Misc/fgpath.hxx>
 #ifdef FG_NETWORK_OLK
-#include <Network/network.h>
+#include <NetworkOLK/network.h>
 #endif
 #include <Objects/materialmgr.hxx>
 #include <Scenery/scenery.hxx>
@@ -144,6 +144,12 @@ ssgBranch *terrain = NULL;
 ssgSelector *penguin_sel = NULL;
 ssgTransform *penguin_pos = NULL;
 
+#ifdef FG_NETWORK_OLK
+ssgSelector *fgd_sel = NULL;
+ssgTransform *fgd_pos = NULL;
+//sgMat4 sgTUX;
+#endif
+
 // current fdm/position used for view
 FGInterface cur_view_fdm;
 
@@ -361,7 +367,11 @@ void fgRenderFrame( void ) {
        }
 
        // update fog params if visibility has changed
+#ifndef FG_OLD_WEATHER
        double cur_visibility = WeatherDatabase->getWeatherVisibility();
+#else
+       double cur_visibility = current_weather.get_visibility();
+#endif
        double actual_visibility = cur_visibility;
 
        if ( current_options.get_clouds() ) {
@@ -541,6 +551,25 @@ void fgRenderFrame( void ) {
            penguin_pos->setTransform( &tuxpos );
        }
 
+# ifdef FG_NETWORK_OLK
+       sgCoord fgdpos;
+       other = head->next;             /* put listpointer to start  */
+       while ( other != tail) {        /* display all except myself */
+           if ( strcmp( other->ipadr, fgd_mcp_ip) != 0) {
+               other->fgd_sel->select(1);
+               sgSetCoord( &fgdpos, other->sgFGD_COORD );
+               other->fgd_pos->setTransform( &fgdpos );
+           }
+           other = other->next;
+       }
+
+       // fgd_sel->select(1);
+       // sgCopyMat4( sgTUX, current_view.sgVIEW);
+       // sgCoord fgdpos;
+       // sgSetCoord( &fgdpos, sgFGD_VIEW );
+       // fgd_pos->setTransform( &fgdpos);
+# endif
+
        ssgSetCamera( current_view.VIEW );
 
        // position tile nodes and update range selectors
@@ -703,6 +732,14 @@ static void fgMainLoop( void ) {
     FG_LOG( FG_ALL, FG_DEBUG, "Running Main Loop");
     FG_LOG( FG_ALL, FG_DEBUG, "======= ==== ====");
 
+#ifdef FG_NETWORK_OLK
+    if ( net_is_registered == 0 ) {           // We first have to reg. to fgd
+        // printf("FGD: Netupdate\n");
+        fgd_send_com( "A", FGFS_host);   // Send Mat4 data
+        fgd_send_com( "B", FGFS_host);   // Recv Mat4 data
+    }
+#endif
+
 #if defined( ENABLE_PLIB_JOYSTICK )
     // Read joystick and update control settings
     if ( current_options.get_control_mode() == fgOPTIONS::FG_JOYSTICK ) {
@@ -1280,7 +1317,7 @@ int main( int argc, char **argv ) {
 
 #ifdef FG_NETWORK_OLK
     // Do the network intialization
-    printf("Multipilot mode %s\n", fg_net_init() );
+    printf("Multipilot mode %s\n", fg_net_init( scene ) );
 #endif
 
     scene->addKid( terrain );
index 6ec0724e2ff711e80a9c5a36112ed9cca61be92b..41bc4c33b1017765a0eadadb84c717248c7ddb80 100644 (file)
@@ -45,7 +45,7 @@ bool global_fullscreen = true;
 #include <Cockpit/cockpit.hxx>
 #include <FDM/flight.hxx>
 #ifdef FG_NETWORK_OLK
-#  include <Network/network.h>
+#  include <NetworkOLK/network.h>
 #endif
 #include <Time/fg_time.hxx>