]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/tilemgr.cxx
New PathsDialog, for managing locations.
[flightgear.git] / src / Scenery / tilemgr.cxx
index 96a10fd19e03bdec936ac4141b1067adaff64ab3..ec3028d3ea2a4e80d17d0ca7a059515c3012df3f 100644 (file)
@@ -168,11 +168,17 @@ void FGTileMgr::reinit()
       _options->setModelData(new FGNasalModelDataProxy);
   
   
-    // protect against multiple scenery reloads and properly reset flags,
-    // otherwise aircraft fall through the ground while reloading scenery
-    if (!fgGetBool("/sim/sceneryloaded",true))
+    if (state != Start)
+    {
+      // protect against multiple scenery reloads and properly reset flags,
+      // otherwise aircraft fall through the ground while reloading scenery
+      if (_scenery_loaded->getBoolValue() == false) {
+        SG_LOG( SG_TERRAIN, SG_INFO, "/sim/sceneryloaded already false, avoiding duplicate re-init of tile manager" );
         return;
-    fgSetBool("/sim/sceneryloaded",false);
+      }
+    }
+  
+    _scenery_loaded->setBoolValue(false);
     fgSetDouble("/sim/startup/splash-alpha", 1.0);
     
     materialLibChanged();
@@ -213,6 +219,9 @@ bool FGTileMgr::sched_tile( const SGBucket& b, double priority, bool current_vie
     {
         // create a new entry
         t = new TileEntry( b );
+        SG_LOG( SG_TERRAIN, SG_INFO, "sched_tile: new tile entry for:" << b );
+
+
         // insert the tile into the cache, update will generate load request
         if ( tile_cache.insert_tile( t ) )
         {
@@ -495,8 +504,10 @@ bool FGTileMgr::schedule_scenery(const SGGeod& position, double range_m, double
     SGBucket bucket(position);
     available = sched_tile( bucket, priority, false, duration );
   
-    if ((!available)&&(duration==0.0))
+    if ((!available)&&(duration==0.0)) {
+        SG_LOG( SG_TERRAIN, SG_DEBUG, "schedule_scenery: Scheduling tile at bucket:" << bucket << " return false" );
         return false;
+    }
 
     SGVec3d cartPos = SGVec3d::fromGeod(position);