ReaderWriterSTG::readNode(const std::string& fileName,
const osgDB::ReaderWriter::Options* options) const
{
- std::string tileName = osgDB::getNameLessExtension(fileName);
- tileName = osgDB::getSimpleFileName(tileName);
-
- osg::Node* result = TileEntry::loadTileByName(tileName, options);
+ osg::Node* result = TileEntry::loadTileByFileName(fileName, options);
// For debugging race conditions
#ifdef SLOW_PAGER
sleep(5);
// what we'll want to do with the database pager.
osg::Node*
-TileEntry::loadTileByName(const string& index_str,
- const osgDB::ReaderWriter::Options* options)
+TileEntry::loadTileByFileName(const string& fileName,
+ const osgDB::ReaderWriter::Options* options)
{
+ std::string index_str = osgDB::getNameLessExtension(fileName);
+ index_str = osgDB::getSimpleFileName(index_str);
+
long tileIndex;
{
std::istringstream idxStream(index_str);
SG_LOG( SG_TERRAIN, SG_INFO, "Loading tile " << index_str );
osgDB::FilePathList path_list=options->getDatabasePathList();
+ // Make sure we find the original filename here...
+ path_list.push_front(osgDB::getFilePath(fileName));
// scan and parse all files and store information
for (unsigned int i = 0; i < path_list.size(); i++) {
/**
* Transition to OSG database pager
*/
- static osg::Node* loadTileByName(const std::string& index_str,
- const osgDB::ReaderWriter::Options*);
+ static osg::Node* loadTileByFileName(const std::string& index_str,
+ const osgDB::ReaderWriter::Options*);
/**
* Return true if the tile entry is loaded, otherwise return false
* indicating that the loading thread is still working on this.