]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/tilemgr.cxx
Updates to allow weather system and atis to interact better.
[flightgear.git] / src / Scenery / tilemgr.cxx
index eb2dbf591fb5aa87a6cf44b05fb109b16389ca17..5d7f125a41db2208305b231393880ef12e6e9d4b 100644 (file)
@@ -154,7 +154,20 @@ void FGTileMgr::sched_tile( const SGBucket& b ) {
 
 // schedule a needed buckets for loading
 void FGTileMgr::schedule_needed() {
-    cout << "scheduling needed tiles for " << longitude << " " << latitude << endl;
+    // sanity check (unfortunately needed!)
+    if ( longitude < -180.0 || longitude > 180.0 
+         || latitude < -90.0 || latitude > 90.0 )
+    {
+        SG_LOG( SG_TERRAIN, SG_ALERT,
+                "Attempting to schedule tiles for bogus latitude and" );
+        SG_LOG( SG_TERRAIN, SG_ALERT,
+                "longitude.  This is a FATAL error.  Exiting!" );
+        exit(-1);        
+    }
+
+   SG_LOG( SG_TERRAIN, SG_INFO,
+           "scheduling needed tiles for " << longitude << " " << latitude );
+
 #ifndef FG_OLD_WEATHER
     if ( WeatherDatabase != NULL ) {
        vis = WeatherDatabase->getWeatherVisibility();
@@ -251,7 +264,8 @@ void FGTileMgr::initialize_queue()
 // chunks.  If the chunk isn't already in the cache, then read it from
 // disk.
 int FGTileMgr::update( double lon, double lat ) {
-    SG_LOG( SG_TERRAIN, SG_DEBUG, "FGTileMgr::update() for" << lon << " " << lat );
+    // SG_LOG( SG_TERRAIN, SG_DEBUG, "FGTileMgr::update() for "
+    //         << lon << " " << lat );
 
     longitude = lon;
     latitude = lat;
@@ -381,7 +395,8 @@ int FGTileMgr::update( double lon, double lat ) {
            scenery.set_cur_normal( tmp_normal );
        } else {
            scenery.set_cur_elev( -9999.0 );
-       }  
+       }
+       // cout << "Current elevation = " << scenery.get_cur_elev() << endl;
 #if 0
     }
 #endif