]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/native_fdm.cxx
Moved random ground cover object management code (userdata.[ch]xx) over
[flightgear.git] / src / Network / native_fdm.cxx
index 8a8d743a9dc644fd9ac45409088084f20e70026e..985ac08b4894b17cd2940e13266cb49f9d50a4ae 100644 (file)
@@ -401,10 +401,23 @@ bool FGNativeFDM::process() {
                FGNetFDM2Props( &buf );
            }
        } else {
-           while ( io->read( (char *)(& buf), length ) == length ) {
-               SG_LOG( SG_IO, SG_DEBUG, "Success reading data." );
-               FGNetFDM2Props( &buf );
+            // double dt = 1000000.0 / 30.0;
+            // SGTimeStamp current; current.stamp();
+            int result;
+            result = io->read( (char *)(& buf), length );
+            if ( result == length ) {
+                SG_LOG( SG_IO, SG_DEBUG, "  Success reading data." );
+                FGNetFDM2Props( &buf );
+            }
+           while ( result == length /* || current - last_time < dt */ ) {
+                result = io->read( (char *)(& buf), length );
+                if ( result == length ) {
+                    SG_LOG( SG_IO, SG_DEBUG, "  Success reading data." );
+                    FGNetFDM2Props( &buf );
+                }
+                // current.stamp();
            }
+            // last_time = current;
        }
     }