-
- if (( !e->is_loaded() )&&
- ((!e->is_expired(current_time))||
- e->is_current_view() ))
- {
- // schedule tile for loading with osg pager
- _pager->queueRequest(e->tileFileName,
- e->getNode(),
- e->get_priority(),
- framestamp,
- e->getDatabaseRequest(),
- _options.get());
- loading++;
- }
- } else
- {
+
+ if (!e->is_loaded()) {
+ if (!didRefreshMaterialCache) {
+ didRefreshMaterialCache = true;
+ globals->get_matlib()->refreshActiveMaterials();
+ }
+
+ bool nonExpiredOrCurrent = !e->is_expired(current_time) || e->is_current_view();
+ bool downloading = isTileDirSyncing(e->tileFileName);
+ isDownloadingScenery |= downloading;
+ if ( !downloading && nonExpiredOrCurrent) {
+ // schedule tile for loading with osg pager
+ _pager->queueRequest(e->tileFileName,
+ e->getNode(),
+ e->get_priority(),
+ framestamp,
+ e->getDatabaseRequest(),
+ _options.get());
+ loading++;
+ }
+ } // of tile not loaded case
+ } else {