From Thorsten Brehm, "attached update changes OSG's src/osgDB/Registry.cpp, so it doesn't (accidentally) resolve relative paths against the current working directory when searching for resources. So far, such paths were always resolved against the cwd first.
I guess the previous behaviour of giving the cwd precedence over any path configured in the "database path list" (osgDB::Options) wasn't intentional. Otherwise, if it was intentional after all, it'd be good to add another feature instead, to make this configurable - e.g. a flag in osgDB::Options to disable this, if an application doesn't want the cwd being considered. " Note from Robert Osfield, this submission will change the default behaviour of searching for files so can potentially break existing applications as it won't search the current working direction unless it's included in the DataFilePathList entry in the Options or Registy. I'll add a follow up submission to add back in this feature.
This commit is contained in:
@@ -985,7 +985,7 @@ std::string Registry::findDataFileImplementation(const std::string& filename, co
|
||||
// if data file contains a server address then we can't find it in local directories so return empty string.
|
||||
if (containsServerAddress(filename)) return std::string();
|
||||
|
||||
if(fileExists(filename))
|
||||
if (osgDB::isAbsolutePath(filename) && fileExists(filename))
|
||||
{
|
||||
OSG_DEBUG << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
|
||||
return filename;
|
||||
|
||||
Reference in New Issue
Block a user