1
0
Fork 0

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:
James Turner 2013-09-30 12:07:35 +01:00
parent e03ebef99f
commit cb087dc4de
6 changed files with 1 additions and 49 deletions

View 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)
{

View 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();

View 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());
}

View 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

View 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))

View 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;