Fix texture paths on case-sensitive file systems, fixes #2807

This commit is contained in:
Marianne Gagnon 2017-03-09 18:41:35 -05:00
parent 12e6bab90a
commit 62d64847c4
2 changed files with 6 additions and 4 deletions

View File

@ -72,7 +72,7 @@ Material::Material(const XMLNode *node, bool deprecated)
if (relativePath.size() == 0)
Log::warn("Material", "Cannot determine texture full path : <%s>", m_texname.c_str());
else
m_full_path = file_manager->getFileSystem()->getAbsolutePath(relativePath.c_str()).c_str();
m_full_path = m_original_full_path = file_manager->getFileSystem()->getAbsolutePath(relativePath.c_str()).c_str();
core::stringc texfname(m_texname.c_str());
texfname.make_lower();
@ -435,12 +435,12 @@ Material::Material(const std::string& fname, bool is_full_path,
if (is_full_path)
{
m_texname = StringUtils::getBasename(fname);
m_full_path = fname;
m_full_path = m_original_full_path = fname;
}
else
{
m_texname = fname;
m_full_path = file_manager->getFileSystem()->getAbsolutePath(
m_full_path = m_original_full_path = file_manager->getFileSystem()->getAbsolutePath(
file_manager->searchTexture(m_texname).c_str()).c_str();
}
@ -527,7 +527,7 @@ void Material::install(bool srgb, bool premul_alpha)
else
{
m_texture = STKTexManager::getInstance()->getTexture
(m_full_path, srgb, premul_alpha, false/*set_material*/,
(m_original_full_path, srgb, premul_alpha, false/*set_material*/,
srgb/*mesh_tex*/);
}

View File

@ -91,6 +91,8 @@ private:
std::string m_texname;
std::string m_full_path;
std::string m_original_full_path;
/** Name of a special sfx to play when a kart is on this terrain, or
* "" if no special sfx exists. */