X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNetwork%2Fnative_ctrls.cxx;h=2ad871f834f28387b39baebd9cb1eea00661e054;hb=a0588272dc51ef0b2630f981cf1a913665cdc87a;hp=388fa1f7187c81f431cab2b56f3fb6c5ef9d1710;hpb=619226e9d069d2a3e8ebf8658fb5441ca8a2c233;p=flightgear.git diff --git a/src/Network/native_ctrls.cxx b/src/Network/native_ctrls.cxx index 388fa1f71..2ad871f83 100644 --- a/src/Network/native_ctrls.cxx +++ b/src/Network/native_ctrls.cxx @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // $Id$ @@ -29,15 +29,16 @@ #include #include // endian tests -#include #include
#include // ground elevation #include "native_ctrls.hxx" // FreeBSD works better with this included last ... (?) -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined( _MSC_VER ) # include +#elif defined( __MINGW32__ ) +# include #else # include // htonl() ntohl() #endif @@ -203,12 +204,7 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes, net->temp_c = fgGetDouble("/environment/temperature-degc"); net->press_inhg = fgGetDouble("/environment/pressure-sea-level-inhg"); - // cur_fdm_state->get_ground_elev_ft() is what we want ... this - // reports the altitude of the aircraft. - // "/environment/ground-elevation-m" reports the ground elevation - // of the current view point which could change substantially if - // the user is switching views. - net->hground = cur_fdm_state->get_ground_elev_ft() * SG_FEET_TO_METER; + net->hground = fgGetDouble("/position/ground-elev-m"); net->magvar = fgGetDouble("/environment/magnetic-variation-deg"); net->icing = fgGetBool("/hazards/icing/wing"); @@ -293,7 +289,7 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes, int i; SGPropertyNode * node; -/*************** + if ( net_byte_order ) { // convert from network byte order net->version = htonl(net->version); @@ -350,7 +346,7 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes, net->speedup = htonl(net->speedup); net->freeze = htonl(net->freeze); } -*************/ + if ( net->version != FG_NET_CTRLS_VERSION ) { SG_LOG( SG_IO, SG_ALERT, "Version mismatch with raw controls packet format." ); @@ -434,7 +430,7 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes, node->setDoubleValue( "wind-speed-kt", net->wind_speed_kt ); node->setDoubleValue( "wind-from-heading-deg", net->wind_dir_deg ); node->setDoubleValue( "turbulence/magnitude-norm", net->turbulence_norm ); - node->setBoolValue( "magnetic-variation-deg", net->magvar ); + node->setDoubleValue( "magnetic-variation-deg", net->magvar ); node->setDoubleValue( "/environment/temperature-degc", net->temp_c ); @@ -467,7 +463,6 @@ bool FGNativeCtrls::process() { int length = sizeof(FGNetCtrls); if ( get_direction() == SG_IO_OUT ) { - // cout << "size of cur_fdm_state = " << length << endl; FGProps2NetCtrls( &net_ctrls, true, true );