Apply tentative patch for ticket 964
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@13034 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -284,7 +284,8 @@ void MaterialManager::popTempMaterial()
|
||||
Material *MaterialManager::getMaterial(const std::string& fname,
|
||||
bool is_full_path,
|
||||
bool make_permanent,
|
||||
bool complain_if_not_found)
|
||||
bool complain_if_not_found,
|
||||
bool strip_path)
|
||||
{
|
||||
if(fname=="")
|
||||
{
|
||||
@@ -297,8 +298,13 @@ Material *MaterialManager::getMaterial(const std::string& fname,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
std::string basename=StringUtils::getBasename(fname);
|
||||
|
||||
std::string basename;
|
||||
|
||||
if (strip_path)
|
||||
basename = StringUtils::getBasename(fname);
|
||||
else
|
||||
basename = fname;
|
||||
|
||||
// Search backward so that temporary (track) textures are found first
|
||||
for(int i = (int)m_materials.size()-1; i>=0; i-- )
|
||||
{
|
||||
|
||||
@@ -65,7 +65,8 @@ public:
|
||||
Material *getMaterial (const std::string& t,
|
||||
bool is_full_path=false,
|
||||
bool make_permanent=false,
|
||||
bool complain_if_not_found=true);
|
||||
bool complain_if_not_found=true,
|
||||
bool strip_path=true);
|
||||
void addSharedMaterial(const std::string& filename, bool deprecated = false);
|
||||
bool pushTempMaterial (const std::string& filename, bool deprecated = false);
|
||||
bool pushTempMaterial (const XMLNode *root, const std::string& filename, bool deprecated = false);
|
||||
|
||||
@@ -224,8 +224,10 @@ void KartProperties::load(const std::string &filename, const std::string &node)
|
||||
// (e.g. when freeing temp. materials from a track, the last icon
|
||||
// would get deleted, too.
|
||||
m_icon_material = material_manager->getMaterial(m_icon_file,
|
||||
/*is_full+path*/true,
|
||||
/*make_permanent*/true);
|
||||
/*is_full_path*/true,
|
||||
/*make_permanent*/true,
|
||||
/*complain_if_not_found*/true,
|
||||
/*strip_path*/false);
|
||||
if(m_minimap_icon_file!="")
|
||||
m_minimap_icon = irr_driver->getTexture(m_root+m_minimap_icon_file);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user