Changed to static loading of the help icons to avoid texture pop-in.

Also cleaned up some error logging for the help icon loading.
This commit is contained in:
Leon Styhre 2021-04-05 13:26:25 +02:00
parent f3321009fe
commit 0243b4bcf8

View file

@ -121,16 +121,17 @@ std::shared_ptr<TextureResource> HelpComponent::getIconTexture(const char* name)
auto pathLookup = ICON_PATH_MAP.find(name); auto pathLookup = ICON_PATH_MAP.find(name);
if (pathLookup == ICON_PATH_MAP.cend()) { if (pathLookup == ICON_PATH_MAP.cend()) {
LOG(LogError) << "Unknown help icon \"" << name << "\"!"; LOG(LogError) << "Unknown help icon \"" << name << "\"";
return nullptr; return nullptr;
} }
if (!ResourceManager::getInstance()->fileExists(pathLookup->second)) { if (!ResourceManager::getInstance()->fileExists(pathLookup->second)) {
LOG(LogError) << "Help icon \"" << name << LOG(LogError) << "Couldn't load help icon \"" << name <<
"\" - corresponding image file \"" << pathLookup->second << "\" misisng!"; "\" as the file \"" << pathLookup->second << "\" is missing";
return nullptr; return nullptr;
} }
std::shared_ptr<TextureResource> tex = TextureResource::get(pathLookup->second); std::shared_ptr<TextureResource> tex =
TextureResource::get(pathLookup->second, false, false, false);
mIconCache[std::string(name)] = tex; mIconCache[std::string(name)] = tex;
return tex; return tex;
} }