Tile-manager: kill off tile-refresh.
Now the manager waits on terrasync, we never need to do the 'experimental' refresh feature, since we only load finished tiles.
This commit is contained in:
parent
e03ebef99f
commit
cb087dc4de
6 changed files with 1 additions and 49 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -115,11 +115,6 @@ public:
|
|||
*/
|
||||
void removeFromSceneGraph();
|
||||
|
||||
/**
|
||||
* Refresh a tile, reload the node from disk.
|
||||
*/
|
||||
void refresh();
|
||||
|
||||
/**
|
||||
* return the scenegraph node for the terrain
|
||||
*/
|
||||
|
|
|
@ -104,16 +104,9 @@ 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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue