mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-03-17 18:55:19 +01:00
overlays/icon: Handle some edge cases
This commit is contained in:
parent
9e6fecb4ca
commit
6cf2cc67d3
|
|
@ -6,11 +6,15 @@
|
|||
namespace rsx::overlays::home_menu
|
||||
{
|
||||
std::unordered_map<fa_icon, std::unique_ptr<image_info>> g_icons_cache;
|
||||
std::mutex g_icons_cache_lock;
|
||||
|
||||
static const char* fa_icon_to_filename(fa_icon icon)
|
||||
{
|
||||
switch (icon)
|
||||
{
|
||||
default:
|
||||
case fa_icon::none:
|
||||
return "";
|
||||
case fa_icon::home:
|
||||
return "home.png";
|
||||
case fa_icon::settings:
|
||||
|
|
@ -47,6 +51,13 @@ namespace rsx::overlays::home_menu
|
|||
|
||||
const image_info* get_icon(fa_icon icon)
|
||||
{
|
||||
if (icon == fa_icon::none)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::lock_guard lock(g_icons_cache_lock);
|
||||
|
||||
auto found = g_icons_cache.find(icon);
|
||||
if (found != g_icons_cache.end())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ namespace rsx::overlays::home_menu
|
|||
{
|
||||
enum class fa_icon
|
||||
{
|
||||
home = 0,
|
||||
none = 0,
|
||||
home,
|
||||
settings,
|
||||
back,
|
||||
floppy,
|
||||
|
|
|
|||
Loading…
Reference in a new issue