From: James Turner Date: Mon, 30 Sep 2013 11:07:35 +0000 (+0100) Subject: Tile-manager: kill off tile-refresh. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cb087dc4def164eadaae6f7262892feb9ec2a8ca;p=flightgear.git 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. --- diff --git a/src/Scenery/tilecache.cxx b/src/Scenery/tilecache.cxx index 172b604ff..bdec44d3b 100644 --- a/src/Scenery/tilecache.cxx +++ b/src/Scenery/tilecache.cxx @@ -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) { diff --git a/src/Scenery/tilecache.hxx b/src/Scenery/tilecache.hxx index eb65696c8..a1f43cecf 100644 --- a/src/Scenery/tilecache.hxx +++ b/src/Scenery/tilecache.hxx @@ -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(); diff --git a/src/Scenery/tileentry.cxx b/src/Scenery/tileentry.cxx index d85c73926..a901f6dfa 100644 --- a/src/Scenery/tileentry.cxx +++ b/src/Scenery/tileentry.cxx @@ -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()); -} diff --git a/src/Scenery/tileentry.hxx b/src/Scenery/tileentry.hxx index 54cebe768..1eb4b7d17 100644 --- a/src/Scenery/tileentry.hxx +++ b/src/Scenery/tileentry.hxx @@ -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 diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index 642133229..7aba0f11c 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -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 (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)) diff --git a/src/Scenery/tilemgr.hxx b/src/Scenery/tilemgr.hxx index 9f00a8a11..c95f915a0 100644 --- a/src/Scenery/tilemgr.hxx +++ b/src/Scenery/tilemgr.hxx @@ -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;