]> git.mxchange.org Git - flightgear.git/commitdiff
Add ground elevation to the net_gui.hxx structure.
authorcurt <curt>
Tue, 24 Jun 2003 15:10:50 +0000 (15:10 +0000)
committercurt <curt>
Tue, 24 Jun 2003 15:10:50 +0000 (15:10 +0000)
src/Network/native_gui.cxx
src/Network/net_gui.hxx

index e2b2391cbb5fde0d1bb27a9eab66541464537ea3..a681be59ef2845cf529bdda6d4fc98e041052a24 100644 (file)
@@ -35,6 +35,7 @@
 #include <Time/tmp.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
+#include <Scenery/scenery.hxx>
 
 #include "native_gui.hxx"
 
@@ -144,9 +145,10 @@ void FGProps2NetGUI( FGNetGUI *net ) {
         net->fuel_quantity[i] = node->getDoubleValue("level-gal_us");
     }
 
-    // the following really aren't used in this context
+    // Environment
     net->cur_time = globals->get_time_params()->get_cur_time();
     net->warp = globals->get_warp();
+    net->ground_elev = globals->get_scenery()->get_cur_elev();
 
     // Approach
     net->tuned_freq = current_radiostack->get_navcom1()->get_nav_freq();
@@ -209,6 +211,7 @@ void FGProps2NetGUI( FGNetGUI *net ) {
 
     net->cur_time = htonl( net->cur_time );
     net->warp = htonl( net->warp );
+    net->ground_elev = htonl( net->ground_elev );
 
     htonf(net->tuned_freq);
     htonf(net->nav_radial);
@@ -243,6 +246,7 @@ void FGNetGUI2Props( FGNetGUI *net ) {
 
     net->cur_time = ntohl(net->cur_time);
     net->warp = ntohl(net->warp);
+    net->ground_elev = htonl( net->ground_elev );
 
     htonf(net->tuned_freq);
     net->in_range = htonl(net->in_range);
@@ -277,6 +281,7 @@ void FGNetGUI2Props( FGNetGUI *net ) {
        }
 
         globals->set_warp( net->warp );
+        globals->get_scenery()->set_cur_elev( net->ground_elev );
 
         // Approach
         fgSetDouble( "/radios/nav[0]/frequencies/selected-mhz",
index d99735a3ed5b77453ebaf50e0c28a9fe93474f5f..dad5b4b6b4359e157879476a579c4d11c64b62ee 100644 (file)
@@ -31,7 +31,7 @@
 #endif                                   
 
 
-const int FG_NET_GUI_VERSION = 3;
+const int FG_NET_GUI_VERSION = 4;
 
 
 // Define a structure containing the top level flight dynamics model
@@ -73,6 +73,7 @@ public:
     // Environment
     time_t cur_time;            // current unix time
     long int warp;              // offset in seconds to unix time
+    float ground_elev;          // ground elev (meters)
 
     // Approach
     float tuned_freq;           // currently tuned frequency