| 381 | } |
| 382 | |
| 383 | uint64_t load_icon_texture(const std::string& icon_name) { |
| 384 | { |
| 385 | std::lock_guard lock(g_icon_cache_mutex); |
| 386 | auto it = g_icon_cache.find(icon_name); |
| 387 | if (it != g_icon_cache.end()) { |
| 388 | return it->second; |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | try { |
| 393 | return load_icon_from_path(lfs::vis::getAssetPath("icon/" + icon_name), icon_name); |
| 394 | } catch (const std::exception& e) { |
| 395 | LOG_WARN("Failed to load icon {}: {}", icon_name, e.what()); |
| 396 | return load_default_icon(); |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | uint64_t load_scene_icon(const std::string& icon_name) { |
| 401 | const std::string cache_key = "scene/" + icon_name + ".png"; |
no test coverage detected