]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/native_ctrls.cxx
Updated adf property names.
[flightgear.git] / src / Network / native_ctrls.cxx
index 2cc20ff5f56c50e3755f69ccc2556cd5eb8c0b9c..6f512b8e5ac82a6a281073d447e3eba92e5f2c07 100644 (file)
@@ -24,6 +24,8 @@
 #include <simgear/debug/logstream.hxx>
 #include <simgear/io/iochannel.hxx>
 
+#include <Scenery/scenery.hxx> // ground elevation
+
 #include "native_ctrls.hxx"
 
 
@@ -64,14 +66,16 @@ static void global2raw( const FGControls *global, FGRawCtrls *raw ) {
     raw->elevator_trim = globals->get_controls()->get_elevator_trim();
     raw->rudder = globals->get_controls()->get_rudder();
     raw->flaps = globals->get_controls()->get_flaps();
-    for ( i = 0; i < FG_MAX_ENGINES; ++i ) {    
+    for ( i = 0; i < FGRawCtrls::FG_MAX_ENGINES; ++i ) {    
        raw->throttle[i] = globals->get_controls()->get_throttle(i);
        raw->mixture[i] = globals->get_controls()->get_mixture(i);
        raw->prop_advance[i] = globals->get_controls()->get_prop_advance(i);
     }
-    for ( i = 0; i < FG_MAX_WHEELS; ++i ) {
+    for ( i = 0; i < FGRawCtrls::FG_MAX_WHEELS; ++i ) {
        raw->brake[i] =  globals->get_controls()->get_brake(i);
     }
+
+    raw->hground = globals->get_scenery()->get_cur_elev();
 }
 
 
@@ -84,14 +88,16 @@ static void raw2global( const FGRawCtrls *raw, FGControls *global ) {
        globals->get_controls()->set_elevator_trim( raw->elevator_trim );
        globals->get_controls()->set_rudder( raw->rudder );
        globals->get_controls()->set_flaps( raw->flaps );
-       for ( i = 0; i < FG_MAX_ENGINES; ++i ) {    
+       for ( i = 0; i < FGRawCtrls::FG_MAX_ENGINES; ++i ) {    
            globals->get_controls()->set_throttle( i, raw->throttle[i] );
            globals->get_controls()->set_mixture( i, raw->mixture[i] );
            globals->get_controls()->set_prop_advance( i, raw->prop_advance[i]);
        }
-       for ( i = 0; i < FG_MAX_WHEELS; ++i ) {
+       for ( i = 0; i < FGRawCtrls::FG_MAX_WHEELS; ++i ) {
            globals->get_controls()->set_brake( i, raw->brake[i] );
        }
+       globals->get_controls()->set_gear_down( raw->gear_handle );
+       globals->get_scenery()->set_cur_elev( raw->hground );
     } else {
        SG_LOG( SG_IO, SG_ALERT, "Error: version mismatch in raw2global()" );
        SG_LOG( SG_IO, SG_ALERT,