mirror of
https://github.com/OpenMW/openmw.git
synced 2026-01-04 22:43:06 +00:00
Merge branch 'luaui_noerror' into 'master'
Lua UI API: Let image manager handle missing textures See merge request OpenMW/openmw!1722
This commit is contained in:
commit
593a16737c
1 changed files with 3 additions and 9 deletions
|
|
@ -7,15 +7,9 @@ namespace LuaUi
|
|||
{
|
||||
std::shared_ptr<TextureResource> ResourceManager::registerTexture(TextureData data)
|
||||
{
|
||||
std::string normalizedPath = mVfs->normalizeFilename(data.mPath);
|
||||
if (!mVfs->exists(normalizedPath))
|
||||
{
|
||||
auto error = Misc::StringUtils::format("Texture with path \"%s\" doesn't exist", data.mPath);
|
||||
throw std::logic_error(error);
|
||||
}
|
||||
data.mPath = normalizedPath;
|
||||
|
||||
TextureResources& list = mTextures[normalizedPath];
|
||||
data.mPath = mVfs->normalizeFilename(data.mPath);
|
||||
|
||||
TextureResources& list = mTextures[data.mPath];
|
||||
list.push_back(std::make_shared<TextureResource>(data));
|
||||
return list.back();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue