diff --git a/src/Nazara/Utility/Formats/STBLoader.cpp b/src/Nazara/Utility/Formats/STBLoader.cpp index 524520813..7b48697e1 100644 --- a/src/Nazara/Utility/Formats/STBLoader.cpp +++ b/src/Nazara/Utility/Formats/STBLoader.cpp @@ -8,7 +8,8 @@ #include #include #include -#include +#include +#include #define STB_IMAGE_IMPLEMENTATION #include #include @@ -37,10 +38,11 @@ namespace Nz static stbi_io_callbacks s_stbiCallbacks = { StbiRead, StbiSkip, StbiEof }; + constexpr auto s_supportedExtensions = frozen::make_unordered_set({ "bmp", "gif", "hdr", "jpg", "jpeg", "pic", "png", "ppm", "pgm", "psd", "tga" }); + bool IsSTBSupported(const std::string_view& extension) { - static std::unordered_set supportedExtensions = {"bmp", "gif", "hdr", "jpg", "jpeg", "pic", "png", "ppm", "pgm", "psd", "tga"}; - return supportedExtensions.find(extension) != supportedExtensions.end(); + return s_supportedExtensions.find(extension) != s_supportedExtensions.end(); } Ternary CheckSTB(Stream& stream, const ImageParams& parameters) diff --git a/xmake.lua b/xmake.lua index 8650fbda9..a3d973eba 100644 --- a/xmake.lua +++ b/xmake.lua @@ -89,7 +89,7 @@ local modules = { }, Utility = { Deps = {"NazaraCore"}, - Packages = {"entt", "freetype", "stb"} + Packages = {"entt", "freetype", "frozen", "stb"} }, VulkanRenderer = { Deps = {"NazaraRenderer"},