diff --git a/src/Scenery/tileentry.hxx b/src/Scenery/tileentry.hxx index 1866e33c8..86bdd40c3 100644 --- a/src/Scenery/tileentry.hxx +++ b/src/Scenery/tileentry.hxx @@ -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. diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index 27f1f8313..7a94bb3f7 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -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);