WS30 - Remove log spam for missing tiles
Previously any missing WS30 tiles created multiple OSG WARN messages from the file not being found. This change does a check to ensure the file actually exists before put it on the queue for loading.
This commit is contained in:
parent
e6c2e258b5
commit
4f01ddb1cc
2 changed files with 20 additions and 6 deletions
|
@ -94,11 +94,6 @@ public:
|
|||
// properly drawn relative to our (0,0,0) point
|
||||
void prep_ssg_node(float vis);
|
||||
|
||||
/**
|
||||
* Transition to OSG database pager
|
||||
*/
|
||||
static osg::Node* loadTileByFileName(const std::string& index_str,
|
||||
const osgDB::Options*);
|
||||
/**
|
||||
* Return true if the tile entry is loaded, otherwise return false
|
||||
* indicating that the loading thread is still working on this.
|
||||
|
|
|
@ -311,6 +311,25 @@ bool FGTileMgr::sched_tile( const SGBucket& b, double priority, bool current_vie
|
|||
{
|
||||
// create a new entry
|
||||
v = new VPBTileEntry( b );
|
||||
|
||||
// If we put the tile on the queue blindly and it doesn't exist,
|
||||
// OSG created huge amounts of log spam and WARN level. So
|
||||
// do a quick check here and drop out if the file doesn't exist.
|
||||
bool found = false;
|
||||
auto filePathList = _options->getDatabasePathList();
|
||||
for (auto path : filePathList) {
|
||||
SGPath p(path, v->tileFileName);
|
||||
if (p.exists()) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! found) {
|
||||
delete v;
|
||||
return false;
|
||||
}
|
||||
|
||||
SG_LOG( SG_TERRAIN, SG_INFO, "sched_tile: new VPB tile entry for:" << b );
|
||||
|
||||
// insert the tile into the cache, update will generate load request
|
||||
|
@ -328,7 +347,7 @@ bool FGTileMgr::sched_tile( const SGBucket& b, double priority, bool current_vie
|
|||
SG_LOG( SG_TERRAIN, SG_DEBUG, " New tile cache size " << (int)tile_cache.get_size() );
|
||||
}
|
||||
|
||||
// update tile's properties. We ensure VPB tiles have maximum priority - priority is calcualated as
|
||||
// update tile's properties. We ensure VPB tiles have maximum priority - priority is calculated as
|
||||
// _negative_ the square of the distance from the viewer to the tile.
|
||||
// so by multiplying by 0.1 we increase the number towards 0.
|
||||
tile_cache.request_tile(v,priority * 0.1,current_view,duration);
|
||||
|
|
Loading…
Reference in a new issue