Respect tile expiry time when cache is disabled.
Tiles added via the visible mechanism always have an expiry time of 0.0, so this only affects tiles added by elevation queries, from the AI or FDM.
This commit is contained in:
parent
2e76a2c72a
commit
fd248e9391
3 changed files with 5 additions and 5 deletions
src/Scenery
|
@ -127,14 +127,14 @@ long TileCache::get_drop_tile() {
|
|||
return min_index;
|
||||
}
|
||||
|
||||
long TileCache::get_first_invisible_tile() const
|
||||
long TileCache::get_first_expired_tile() const
|
||||
{
|
||||
const_tile_map_iterator current = tile_cache.begin();
|
||||
const_tile_map_iterator end = tile_cache.end();
|
||||
|
||||
for ( ; current != end; ++current ) {
|
||||
TileEntry *e = current->second;
|
||||
if (!e->is_current_view())
|
||||
if (!e->is_current_view() && e->is_expired(current_time))
|
||||
{
|
||||
return current->first;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
// nothing available to be removed.
|
||||
long get_drop_tile();
|
||||
|
||||
long get_first_invisible_tile() const;
|
||||
long get_first_expired_tile() const;
|
||||
|
||||
// Clear all flags indicating tiles belonging to the current view
|
||||
void clear_current_view();
|
||||
|
|
|
@ -370,7 +370,7 @@ void FGTileMgr::update_queues(bool& isDownloadingScenery)
|
|||
if (dropTiles)
|
||||
{
|
||||
long drop_index = _enableCache ? tile_cache.get_drop_tile() :
|
||||
tile_cache.get_first_invisible_tile();
|
||||
tile_cache.get_first_expired_tile();
|
||||
while ( drop_index > -1 )
|
||||
{
|
||||
// schedule tile for deletion with osg pager
|
||||
|
@ -387,7 +387,7 @@ void FGTileMgr::update_queues(bool& isDownloadingScenery)
|
|||
_pager->queueDeleteRequest(subgraph);
|
||||
|
||||
if (!_enableCache)
|
||||
drop_index = tile_cache.get_first_invisible_tile();
|
||||
drop_index = tile_cache.get_first_expired_tile();
|
||||
// limit tiles dropped to drop_count
|
||||
else if (--drop_count > 0)
|
||||
drop_index = tile_cache.get_drop_tile();
|
||||
|
|
Loading…
Add table
Reference in a new issue