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)
{
// 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();
}
}
-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());
-}
* graph for this tile.
*/
void removeFromSceneGraph();
-
- /**
- * Refresh a tile, reload the node from disk.
- */
- void refresh();
/**
* return the scenegraph node for the terrain
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))
// 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;