From b3e0275e89171f8d927df81ceddc1698ce626a44 Mon Sep 17 00:00:00 2001 From: Cody Glassman Date: Tue, 22 Mar 2022 05:41:26 +0000 Subject: [PATCH] Lua UI API: Let image manager handle missing textures --- components/lua_ui/resources.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/components/lua_ui/resources.cpp b/components/lua_ui/resources.cpp index 605c9ba58b..0f9890c523 100644 --- a/components/lua_ui/resources.cpp +++ b/components/lua_ui/resources.cpp @@ -7,15 +7,9 @@ namespace LuaUi { std::shared_ptr 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(data)); return list.back(); }