mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-04 13:55:03 -06: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
|
namespace rsx::overlays::home_menu
|
||||||
{
|
{
|
||||||
std::unordered_map<fa_icon, std::unique_ptr<image_info>> g_icons_cache;
|
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)
|
static const char* fa_icon_to_filename(fa_icon icon)
|
||||||
{
|
{
|
||||||
switch (icon)
|
switch (icon)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
case fa_icon::none:
|
||||||
|
return "";
|
||||||
case fa_icon::home:
|
case fa_icon::home:
|
||||||
return "home.png";
|
return "home.png";
|
||||||
case fa_icon::settings:
|
case fa_icon::settings:
|
||||||
@ -47,6 +51,13 @@ namespace rsx::overlays::home_menu
|
|||||||
|
|
||||||
const image_info* get_icon(fa_icon icon)
|
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);
|
auto found = g_icons_cache.find(icon);
|
||||||
if (found != g_icons_cache.end())
|
if (found != g_icons_cache.end())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -7,7 +7,8 @@ namespace rsx::overlays::home_menu
|
|||||||
{
|
{
|
||||||
enum class fa_icon
|
enum class fa_icon
|
||||||
{
|
{
|
||||||
home = 0,
|
none = 0,
|
||||||
|
home,
|
||||||
settings,
|
settings,
|
||||||
back,
|
back,
|
||||||
floppy,
|
floppy,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user