]> git.mxchange.org Git - flightgear.git/commitdiff
Tile-manager: kill off tile-refresh.
authorJames Turner <zakalawe@mac.com>
Mon, 30 Sep 2013 11:07:35 +0000 (12:07 +0100)
committerJames Turner <zakalawe@mac.com>
Mon, 30 Sep 2013 11:07:35 +0000 (12:07 +0100)
Now the manager waits on terrasync, we never need to do the
'experimental' refresh feature, since we only load finished tiles.

src/Scenery/tilecache.cxx
src/Scenery/tilecache.hxx
src/Scenery/tileentry.cxx
src/Scenery/tileentry.hxx
src/Scenery/tilemgr.cxx
src/Scenery/tilemgr.hxx

index 172b604ff5f662dcd6b90cbf3fb18fed8f4bc067..bdec44d3b693a0b3b213104d93bcb2d3e8efc765 100644 (file)
@@ -179,21 +179,6 @@ bool TileCache::insert_tile( TileEntry *e ) {
     return true;
 }
 
-/**
- * Reloads a tile when it's already in memory.
- */
-void TileCache::refresh_tile(long tile_index)
-{
-    const_tile_map_iterator it = tile_cache.find( tile_index );
-    if ( it == tile_cache.end() )
-        return;
-
-    SG_LOG( SG_TERRAIN, SG_DEBUG, "REFRESHING CACHE ENTRY = " << tile_index );
-
-    if (it->second)
-        it->second->refresh();
-}
-
 // update tile's priority and expiry time according to current request
 void TileCache::request_tile(TileEntry* t,float priority,bool current_view,double request_time)
 {
index eb65696c839aadda533f28841f3a360d3d763f41..a1f43cecf95ac9f6121b1da74c09e4569073c54c 100644 (file)
@@ -81,9 +81,6 @@ public:
     // and this does not free the object which is pointed to.
     void clear_entry( long cache_entry );
 
-    // Refresh/reload a tile when it's already in memory.
-    void refresh_tile(long tile_index);
-
     // Clear all completely loaded tiles (ignores partially loaded tiles)
     void clear_cache();
 
index d85c73926a11e2c72ccd336ccc8497a694a58e25..a901f6dfa685240954dd89f9adcb0e26ef9fd695 100644 (file)
@@ -119,19 +119,3 @@ TileEntry::removeFromSceneGraph()
     }
 }
 
-void
-TileEntry::refresh()
-{
-    osg::Group *parent = NULL;
-    // find the nodes branch parent
-    if ( _node->getNumParents() > 0 ) {
-        // find the first parent (should only be one)
-        parent = _node->getParent( 0 ) ;
-        if( parent ) {
-            parent->removeChild( _node.get() );
-        }
-    }
-    _node = new osg::LOD;
-    if (parent)
-        parent->addChild(_node.get());
-}
index 54cebe768ead04c2ec6e2d5cdc6429a1a2726343..1eb4b7d175c841abed2cd297adc5743c303e2ea4 100644 (file)
@@ -114,11 +114,6 @@ public:
      * graph for this tile.
      */
     void removeFromSceneGraph();
-    
-    /**
-     * Refresh a tile, reload the node from disk.
-     */
-    void refresh();
 
     /**
      * return the scenegraph node for the terrain
index 642133229175a302d9132463c4f5fd75966110cd..7aba0f11c665f0515497fac75d61970e59d5b6b6 100644 (file)
@@ -104,17 +104,10 @@ void FGTileMgr::init() {
     reinit();
 }
 
-void FGTileMgr::refresh_tile(void* tileMgr, long tileIndex)
-{
-    ((FGTileMgr*) tileMgr)->tile_cache.refresh_tile(tileIndex);
-}
-
 void FGTileMgr::reinit()
 {
     _terra_sync = static_cast<simgear::SGTerraSync*> (globals->get_subsystem("terrasync"));
-    if (_terra_sync)
-        _terra_sync->setTileRefreshCb(&refresh_tile, this);
-
+    
     // protect against multiple scenery reloads and properly reset flags,
     // otherwise aircraft fall through the ground while reloading scenery
     if (!fgGetBool("/sim/sceneryloaded",true))
index 9f00a8a11d47bf7e710742a59e853796a948b5d8..c95f915a05cd89d4f1803a44f06b81715bd2d228 100644 (file)
@@ -86,8 +86,6 @@ private:
     // schedule tiles for the viewer bucket
     void schedule_tiles_at(const SGGeod& location, double rangeM);
 
-    static void refresh_tile(void* tileMgr, long tileIndex);
-
     SGPropertyNode_ptr _visibilityMeters;
     SGPropertyNode_ptr _maxTileRangeM, _disableNasalHooks;
     SGPropertyNode_ptr _scenery_loaded, _scenery_override;