diff --git a/src/graphics/presentation/window/window.cpp b/src/graphics/presentation/window/window.cpp index 593dc71e6..f4899e132 100644 --- a/src/graphics/presentation/window/window.cpp +++ b/src/graphics/presentation/window/window.cpp @@ -27,6 +27,7 @@ #include "common/systemInfo.h" #include "common/threads.h" #include "common/timer.h" +#include "common/stringUtils.h" #include "graphics/host_gpu/graphicContext.h" #include "graphics/host_gpu/renderer/render.h" #include "graphics/host_gpu/renderer/renderContext.h" @@ -45,6 +46,7 @@ #include #include #include +#include #define STB_IMAGE_IMPLEMENTATION #define STBI_NO_SIMD @@ -945,10 +947,10 @@ struct WindowIcon { } }; -static void WindowLoadPngIcon(const std::string& path, WindowIcon* icon) { +static void WindowLoadPngIcon(const std::filesystem::path& path, WindowIcon* icon) { Common::File f; if (!f.Open(path, Common::File::Mode::Read)) { - EXIT("Can't open icon file %s\n", path.c_str()); + EXIT("Can't open icon file %s\n", Common::PathToString(path).c_str()); } int width = 0; @@ -974,7 +976,7 @@ void WindowContext::UpdateIcon() { static bool icon_loaded = false; if (!icon_loaded) { - std::string icon_path; + std::filesystem::path icon_path; if (Loader::SystemContentGetIconPath(&icon_path)) { WindowLoadPngIcon(icon_path, &icon); } diff --git a/src/loader/systemContent.cpp b/src/loader/systemContent.cpp index 2ce0a2e89..f4a4c27fc 100644 --- a/src/loader/systemContent.cpp +++ b/src/loader/systemContent.cpp @@ -647,20 +647,20 @@ uint64_t SystemContentGetFlexibleMemorySize() { return sc->psf.GetFlexibleMemorySize(); } -bool SystemContentGetIconPath(std::string* path) { - if (path == nullptr) { - return false; - } +bool SystemContentGetIconPath(std::filesystem::path* path) { + if (path == nullptr) { + return false; + } - auto* sc = Common::Singleton::Instance(); + auto* sc = Common::Singleton::Instance(); - if (sc->icon_path.empty()) { - return false; - } + if (sc->icon_path.empty()) { + return false; + } - *path = Common::PathToString(sc->icon_path); + *path = sc->icon_path; - return true; + return true; } bool SystemContentGetChunksNum(uint32_t* num) { diff --git a/src/loader/systemContent.h b/src/loader/systemContent.h index f3216f1f6..778847641 100644 --- a/src/loader/systemContent.h +++ b/src/loader/systemContent.h @@ -15,7 +15,7 @@ bool SystemContentParamSfoGetInt(const char* name, int32_t* value); bool SystemContentParamSfoGetString(const char* name, std::string* value); bool SystemContentParamSfoGetString(const char* name, char* value, size_t value_size); uint64_t SystemContentGetFlexibleMemorySize(); -bool SystemContentGetIconPath(std::string* path); +bool SystemContentGetIconPath(std::filesystem::path* path); bool SystemContentGetChunksNum(uint32_t* num); } // namespace Loader