1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-10-06 22:32:48 +00:00

Fix oversight in texture loading that could cause the cape to appear as white blorb. Thx Daxar.

This commit is contained in:
fgenesis 2015-06-10 01:49:12 +02:00
commit 8bd40be8aa
3 changed files with 14 additions and 8 deletions

View file

@ -4465,14 +4465,18 @@ std::pair<CountedPtr<Texture>, TextureLoadResult> Core::doTextureAdd(const std::
return std::make_pair(t, (TextureLoadResult)res);
}
CountedPtr<Texture> Core::addTexture(const std::string &textureName)
CountedPtr<Texture> Core::addTexture(const std::string &textureName, TextureLoadResult *pLoadResult /* = 0 */)
{
if (textureName.empty()) return NULL;
BBGE_PROF(Core_addTexture);
std::pair<CountedPtr<Texture>, TextureLoadResult> texResult;
if (textureName.empty())
{
if(pLoadResult)
*pLoadResult = TEX_FAILED;
return NULL;
}
std::pair<CountedPtr<Texture>, TextureLoadResult> texResult;
std::string texture = textureName;
stringToLowerUserData(texture);
std::string internalTextureName = texture;
@ -4513,7 +4517,8 @@ CountedPtr<Texture> Core::addTexture(const std::string &textureName)
debugLog(os.str());
}
}
if(pLoadResult)
*pLoadResult = texResult.second;
return texResult.first;
}