]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/ADA.cxx
Provide a fix for the MSVC/Cygwin GDI build problem
[flightgear.git] / src / FDM / ADA.cxx
index 65de055990ba928144fb24a84d1dc9b566c2d98f..11728b7bf2940b7a091249849f1aace8629d6b16 100644 (file)
 
 // Modified by Cdr. VS Renganthan <vsranga@ada.ernet.in>, 12 Oct 2K
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include <simgear/io/iochannel.hxx>
+#include <simgear/io/sg_socket.hxx>
 #include <simgear/constants.h>
 
 #include <Controls/controls.hxx>
@@ -190,7 +195,7 @@ void FGADA::init() {
     copy_to_FGADA();
        // Write FGExternal structure from socket to establish connection
        int result = fdmsock->write(OutBuffer, nbytes);
-       printf("Connection established.\n");
+       printf("Connection established = %d.\n", result);
     }
 }
 
@@ -222,15 +227,15 @@ void FGADA::update( double dt ) {
 
     copy_to_FGADA();
     fgGetDouble("/sim/view/offset",view_offset);
-       if ( view_offset == 0.0) {
-         memcpy (&OutBuffer, &visuals_to_sixdof, sizeof (OutBuffer));
-                int result = fdmsock->write(OutBuffer, nbytes);
-       }
+    if ( view_offset == 0.0) {
+        memcpy (&OutBuffer, &visuals_to_sixdof, sizeof (OutBuffer));
+        fdmsock->write(OutBuffer, nbytes);
+    }
 }
 
 // Convert from the FGInterface struct to the FGADA struct (output)
 bool FGADA::copy_to_FGADA () {
-    ground_elevation = scenery.get_cur_elev();
+    ground_elevation = globals->get_scenery()->get_cur_elev();
     return true;
 }