diff --git a/rpcs3/Emu/RSX/Overlays/overlay_controls.cpp b/rpcs3/Emu/RSX/Overlays/overlay_controls.cpp index f60e37db33..94253a9d24 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_controls.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_controls.cpp @@ -74,12 +74,13 @@ namespace rsx for (const auto &res : texture_resource_files) { // First check the global config dir - auto info = std::make_unique((fs::get_config_dir() + "Icons/ui/" + res).c_str()); + const std::string image_path = fs::get_config_dir() + "Icons/ui/" + res; + auto info = std::make_unique(image_path.c_str()); if (info->data == nullptr) { // Resource was not found in config dir, try and grab from relative path (linux) - auto src = "Icons/ui/" + res; + std::string src = "Icons/ui/" + res; info = std::make_unique(src.c_str()); #ifndef _WIN32 // Check for Icons in ../share/rpcs3 for AppImages, @@ -133,19 +134,8 @@ namespace rsx if (info->data != nullptr) { // Install the image to config dir - auto dst_dir = fs::get_config_dir() + "Icons/ui/"; - auto dst = dst_dir + res; - - if (!fs::is_dir(dst_dir)) - { - auto root_folder = fs::get_config_dir() + "Icons/"; - if (!fs::is_dir(root_folder)) - fs::create_dir(root_folder); - - fs::create_dir(dst_dir); - } - - fs::copy_file(src, dst, true); + fs::create_path(image_path); + fs::copy_file(src, image_path, true); } }