Utility: Switch static unordered_set to constexpr
This commit is contained in:
parent
6171125d21
commit
ad80f3e0ec
|
|
@ -8,7 +8,8 @@
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Core/Stream.hpp>
|
#include <Nazara/Core/Stream.hpp>
|
||||||
#include <Nazara/Utility/Image.hpp>
|
#include <Nazara/Utility/Image.hpp>
|
||||||
#include <unordered_set>
|
#include <frozen/string.h>
|
||||||
|
#include <frozen/unordered_set.h>
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
#include <stb_image.h>
|
#include <stb_image.h>
|
||||||
#include <Nazara/Utility/Debug.hpp>
|
#include <Nazara/Utility/Debug.hpp>
|
||||||
|
|
@ -37,10 +38,11 @@ namespace Nz
|
||||||
|
|
||||||
static stbi_io_callbacks s_stbiCallbacks = { StbiRead, StbiSkip, StbiEof };
|
static stbi_io_callbacks s_stbiCallbacks = { StbiRead, StbiSkip, StbiEof };
|
||||||
|
|
||||||
|
constexpr auto s_supportedExtensions = frozen::make_unordered_set<frozen::string>({ "bmp", "gif", "hdr", "jpg", "jpeg", "pic", "png", "ppm", "pgm", "psd", "tga" });
|
||||||
|
|
||||||
bool IsSTBSupported(const std::string_view& extension)
|
bool IsSTBSupported(const std::string_view& extension)
|
||||||
{
|
{
|
||||||
static std::unordered_set<std::string_view> supportedExtensions = {"bmp", "gif", "hdr", "jpg", "jpeg", "pic", "png", "ppm", "pgm", "psd", "tga"};
|
return s_supportedExtensions.find(extension) != s_supportedExtensions.end();
|
||||||
return supportedExtensions.find(extension) != supportedExtensions.end();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ternary CheckSTB(Stream& stream, const ImageParams& parameters)
|
Ternary CheckSTB(Stream& stream, const ImageParams& parameters)
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ local modules = {
|
||||||
},
|
},
|
||||||
Utility = {
|
Utility = {
|
||||||
Deps = {"NazaraCore"},
|
Deps = {"NazaraCore"},
|
||||||
Packages = {"entt", "freetype", "stb"}
|
Packages = {"entt", "freetype", "frozen", "stb"}
|
||||||
},
|
},
|
||||||
VulkanRenderer = {
|
VulkanRenderer = {
|
||||||
Deps = {"NazaraRenderer"},
|
Deps = {"NazaraRenderer"},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue