Don't try to create textures for empty names.
It's not designed to work with empty file names, because the "existFile" function in irrlicht returns true for directories, our file manager doesn't check that it's a directory and generally strange things happen. This solves a problem with luna track that doesn't have a screenshot and possibly with some broken add-ons, so that valgrind doesn't complain anymore. Benau, feel free to revert it if you have better solution.
This commit is contained in:
parent
6710fc2a5c
commit
1123ceeceb
@ -147,6 +147,12 @@ video::ITexture* STKTexManager::getTexture(const std::string& path,
|
||||
TexConfig* tc, bool no_upload,
|
||||
bool create_if_unfound)
|
||||
{
|
||||
if (path.empty())
|
||||
{
|
||||
Log::error("STKTexManager", "Texture name is empty.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
auto ret = m_all_textures.find(path);
|
||||
if (!no_upload && ret != m_all_textures.end())
|
||||
return ret->second;
|
||||
|
Loading…
Reference in New Issue
Block a user