Compare commits
1
Commits
1918cc89bf
...
08e558482f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08e558482f |
No files matched your search
@@ -341,7 +341,7 @@ WFObj::VertexRef WFObj::readVertexRef(const std::string ref)
|
||||
void WFObj::loadMaterial(const std::string & name)
|
||||
{
|
||||
Buffer buff;
|
||||
string path = (name[0] != '/') ? basePath(m_path) + name : name;
|
||||
string path = resolvePath(name);
|
||||
if (!m_loadfile(path.c_str(), buff))
|
||||
{
|
||||
cerr << "WFObj: error: couldn't open material file '" << path << "'"
|
||||
@@ -422,7 +422,7 @@ void WFObj::loadMaterial(const std::string & name)
|
||||
}
|
||||
else if (tokens[0] == "map_Kd")
|
||||
{
|
||||
m_materials[mat_name].texture = loadTexture(tokens[1]);
|
||||
m_materials[mat_name].texture = loadTexture(resolvePath(tokens[1]));
|
||||
if (m_materials[mat_name].texture != 0)
|
||||
m_materials[mat_name].flags |= Material::TEXTURE_BIT;
|
||||
}
|
||||
@@ -571,6 +571,11 @@ GLuint WFObj::loadTexture(const std::string & path)
|
||||
return id;
|
||||
}
|
||||
|
||||
string WFObj::resolvePath(const string & name)
|
||||
{
|
||||
return (name[0] != '/') ? basePath(m_path) + name : name;
|
||||
}
|
||||
|
||||
bool WFObj::VertexRef::operator<(const VertexRef & other) const
|
||||
{
|
||||
if (vertex != other.vertex)
|
||||
|
||||
Reference in new issue
Block a user