Path fix attempt
This commit is contained in:
parent
342cb82653
commit
c791fd46c1
@ -71,23 +71,27 @@ Material* MaterialManager::getMaterialFor(video::ITexture* t,
|
||||
|
||||
core::stringc img_path = core::stringc(t->getName());
|
||||
const std::string image = StringUtils::getBasename(img_path.c_str());
|
||||
// Search backward so that temporary (track) textures are found first
|
||||
for (int i = (int)m_materials.size() - 1; i >= 0; i--)
|
||||
if (!img_path.empty() && (img_path.findFirst('/') != -1 || img_path.findFirst('\\') != -1))
|
||||
{
|
||||
std::string full_path = m_materials[i]->getTexFullPath();
|
||||
if (m_materials[i]->getTexFullPath() == img_path.c_str())
|
||||
// Search backward so that temporary (track) textures are found first
|
||||
for (int i = (int)m_materials.size() - 1; i >= 0; i--)
|
||||
{
|
||||
return m_materials[i];
|
||||
if (m_materials[i]->getTexFullPath() == img_path.c_str())
|
||||
{
|
||||
return m_materials[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i = (int)m_materials.size()-1; i>=0; i-- )
|
||||
else
|
||||
{
|
||||
if (m_materials[i]->getTexFname()==image)
|
||||
for (int i = (int)m_materials.size() - 1; i >= 0; i--)
|
||||
{
|
||||
return m_materials[i];
|
||||
}
|
||||
} // for i
|
||||
|
||||
if (m_materials[i]->getTexFname() == image)
|
||||
{
|
||||
return m_materials[i];
|
||||
}
|
||||
} // for i
|
||||
}
|
||||
return m_default_material;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user