]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/newcache.cxx
Fix for vanishing-model problem: models are drawn in the same scene
[flightgear.git] / src / Scenery / newcache.cxx
index 8c0ebdb3cac1fa9ec87ecc221c6ea8645e6be3e0..f7f599fb9b7e669962849727e9fb489cbc9bd814 100644 (file)
@@ -133,7 +133,7 @@ bool FGNewCache::make_space() {
            if ( e->is_loaded() && (e->get_pending_models() == 0) ) {
                // calculate approximate distance from view point
                sgdCopyVec3( abs_view_pos,
-                            globals->get_current_view()->get_abs_view_pos() );
+                            globals->get_current_view()->get_absolute_view_pos() );
 
                SG_LOG( SG_TERRAIN, SG_DEBUG, "DIST Abs view pos = " 
                        << abs_view_pos[0] << ","
@@ -173,13 +173,15 @@ bool FGNewCache::make_space() {
            return false;
        }
     }
+
+    SG_LOG( SG_TERRAIN, SG_ALERT, "WHOOPS!!! Hit an unhandled condition in  "
+            "FGNewCache::make_space()." );
+    return false;
 }
 
 
 // Clear all completely loaded tiles (ignores partially loaded tiles)
 void FGNewCache::clear_cache() {
-    // This is a hack that should really get cleaned up at some point
-    extern ssgBranch *terrain;
 
     tile_map_iterator current = tile_cache.begin();
     tile_map_iterator end = tile_cache.end();
@@ -195,7 +197,7 @@ void FGNewCache::clear_cache() {
     }
 
     // and ... just in case we missed something ... 
-    terrain->removeAllKids();
+    globals->get_terrain_branch()->removeAllKids();
 }
 
 
@@ -216,3 +218,4 @@ bool FGNewCache::insert_tile( FGTileEntry *e ) {
         return false;
     }
 }
+