]> git.mxchange.org Git - flightgear.git/commitdiff
- fixed an initialization order bug that prevented reading correct
authorcurt <curt>
Wed, 20 Jun 2001 22:22:26 +0000 (22:22 +0000)
committercurt <curt>
Wed, 20 Jun 2001 22:22:26 +0000 (22:22 +0000)
  ground elevation at start-up

src/Scenery/tilemgr.cxx

index 9ecffda84af2999dedea1a88deea1228c3f9db97..3993368498619fce2f754b741a818585f13f7215 100644 (file)
@@ -378,6 +378,30 @@ int FGTileMgr::update( double lon, double lat ) {
        delete dm;
     }
 
+    // cout << "current elevation (ssg) == " << scenery.cur_elev << endl;
+
+    previous_bucket = current_bucket;
+    last_longitude = longitude;
+    last_latitude  = latitude;
+
+    // activate loader thread one out of every 5 frames
+    if ( counter_hack == 0 ) {
+        // Notify the tile loader that it can load another tile
+        // loader.update();
+
+       if ( !attach_queue.empty() ) {
+#ifdef ENABLE_THREADS
+           FGTileEntry* e = attach_queue.pop();
+#else
+           FGTileEntry* e = attach_queue.front();
+            attach_queue.pop();
+#endif
+           e->add_ssg_nodes( terrain, ground );
+           // cout << "Adding ssg nodes for "
+       }
+    }
+    counter_hack = (counter_hack + 1) % 5;
+
     if ( scenery.center == Point3D(0.0) ) {
        // initializing
        cout << "initializing scenery current elevation  ... " << endl;
@@ -414,30 +438,6 @@ int FGTileMgr::update( double lon, double lat ) {
        }  
     }
 
-    // cout << "current elevation (ssg) == " << scenery.cur_elev << endl;
-
-    previous_bucket = current_bucket;
-    last_longitude = longitude;
-    last_latitude  = latitude;
-
-    // activate loader thread one out of every 5 frames
-    counter_hack = (counter_hack + 1) % 5;
-    if ( !counter_hack ) {
-        // Notify the tile loader that it can load another tile
-        // loader.update();
-
-       if ( !attach_queue.empty() ) {
-#ifdef ENABLE_THREADS
-           FGTileEntry* e = attach_queue.pop();
-#else
-           FGTileEntry* e = attach_queue.front();
-            attach_queue.pop();
-#endif
-           e->add_ssg_nodes( terrain, ground );
-           // cout << "Adding ssg nodes for "
-       }
-    }
-
     return 1;
 }