mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-15 14:10:11 +00:00
Merge pull request #1017 from erwincoumans/master
also allow absolute path in asset files (.obj, .stl, .dae etc)
This commit is contained in:
commit
3b7c4d0947
@ -512,6 +512,18 @@ bool findExistingMeshFile(
|
|||||||
shorter.reverse();
|
shorter.reverse();
|
||||||
|
|
||||||
std::string existing_file;
|
std::string existing_file;
|
||||||
|
|
||||||
|
{
|
||||||
|
std::string attempt = fn;
|
||||||
|
FILE* f = fopen(attempt.c_str(), "rb");
|
||||||
|
if (f)
|
||||||
|
{
|
||||||
|
existing_file = attempt;
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (existing_file.empty())
|
||||||
|
{
|
||||||
for (std::list<std::string>::iterator x=shorter.begin(); x!=shorter.end(); ++x)
|
for (std::list<std::string>::iterator x=shorter.begin(); x!=shorter.end(); ++x)
|
||||||
{
|
{
|
||||||
std::string attempt = *x + "/" + fn;
|
std::string attempt = *x + "/" + fn;
|
||||||
@ -526,6 +538,7 @@ bool findExistingMeshFile(
|
|||||||
//b3Printf("%s: found '%s'", error_message_prefix.c_str(), attempt.c_str());
|
//b3Printf("%s: found '%s'", error_message_prefix.c_str(), attempt.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (existing_file.empty())
|
if (existing_file.empty())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user