Rename EnumMap to EnumArray after nazarautils update

This commit is contained in:
SirLynix 2023-05-30 13:49:19 +02:00
parent cff918f6a3
commit 2886a2e0c0
27 changed files with 59 additions and 59 deletions

View File

@ -15,7 +15,7 @@
#include <Nazara/Audio/Enums.hpp> #include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/OpenAL.hpp> #include <Nazara/Audio/OpenAL.hpp>
#include <Nazara/Core/Algorithm.hpp> #include <Nazara/Core/Algorithm.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <NazaraUtils/MovablePtr.hpp> #include <NazaraUtils/MovablePtr.hpp>
#include <array> #include <array>
#include <string> #include <string>
@ -71,8 +71,8 @@ namespace Nz
OpenALDevice& operator=(OpenALDevice&&) = delete; OpenALDevice& operator=(OpenALDevice&&) = delete;
private: private:
EnumMap<AudioFormat, ALenum> m_audioFormatValues; EnumArray<AudioFormat, ALenum> m_audioFormatValues;
EnumMap<OpenALExtension, ALenum> m_extensionStatus; EnumArray<OpenALExtension, ALenum> m_extensionStatus;
std::string m_renderer; std::string m_renderer;
std::string m_vendor; std::string m_vendor;
OpenALLibrary& m_library; OpenALLibrary& m_library;

View File

@ -10,7 +10,7 @@
#include <NazaraUtils/Prerequisites.hpp> #include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp> #include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Enums.hpp> #include <Nazara/Core/Enums.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <array> #include <array>
#include <string_view> #include <string_view>
@ -43,7 +43,7 @@ namespace Nz
void FetchMemoryInfo(); void FetchMemoryInfo();
std::array<char, 3 * 4 * 4> m_cpuBrandString; std::array<char, 3 * 4 * 4> m_cpuBrandString;
EnumMap<ProcessorCap, bool> m_cpuCapabilities; EnumArray<ProcessorCap, bool> m_cpuCapabilities;
ProcessorVendor m_cpuVendor; ProcessorVendor m_cpuVendor;
unsigned int m_cpuThreadCount; unsigned int m_cpuThreadCount;
UInt64 m_systemTotalMemory; UInt64 m_systemTotalMemory;

View File

@ -78,8 +78,8 @@ namespace Nz
struct DefaultTextures struct DefaultTextures
{ {
EnumMap<ImageType, std::shared_ptr<Texture>> depthTextures; EnumArray<ImageType, std::shared_ptr<Texture>> depthTextures;
EnumMap<ImageType, std::shared_ptr<Texture>> whiteTextures; EnumArray<ImageType, std::shared_ptr<Texture>> whiteTextures;
}; };
private: private:

View File

@ -97,7 +97,7 @@ namespace Nz
std::vector<TextureData> m_textures; std::vector<TextureData> m_textures;
std::vector<UniformBlockData> m_uniformBlocks; std::vector<UniformBlockData> m_uniformBlocks;
mutable std::weak_ptr<MaterialInstance> m_defaultInstance; mutable std::weak_ptr<MaterialInstance> m_defaultInstance;
EnumMap<EngineShaderBinding, UInt32> m_engineShaderBindings; EnumArray<EngineShaderBinding, UInt32> m_engineShaderBindings;
MaterialSettings m_settings; MaterialSettings m_settings;
ShaderReflection m_reflection; ShaderReflection m_reflection;
}; };

View File

@ -50,7 +50,7 @@ namespace Nz
private: private:
inline void UpdateVertices(); inline void UpdateVertices();
EnumMap<RectCorner, Color> m_cornerColor; EnumArray<RectCorner, Color> m_cornerColor;
std::array<VertexStruct_XYZ_Color_UV, 4> m_vertices; std::array<VertexStruct_XYZ_Color_UV, 4> m_vertices;
std::shared_ptr<MaterialInstance> m_material; std::shared_ptr<MaterialInstance> m_material;
Color m_color; Color m_color;

View File

@ -90,7 +90,7 @@ namespace Nz
{ {
VertexStruct_XYZ_Color_UV* vertices = m_vertices.data(); VertexStruct_XYZ_Color_UV* vertices = m_vertices.data();
EnumMap<RectCorner, Vector2f> cornerExtent; EnumArray<RectCorner, Vector2f> cornerExtent;
cornerExtent[RectCorner::LeftBottom] = Vector2f(0.f, 0.f); cornerExtent[RectCorner::LeftBottom] = Vector2f(0.f, 0.f);
cornerExtent[RectCorner::RightBottom] = Vector2f(1.f, 0.f); cornerExtent[RectCorner::RightBottom] = Vector2f(1.f, 0.f);
cornerExtent[RectCorner::LeftTop] = Vector2f(0.f, 1.f); cornerExtent[RectCorner::LeftTop] = Vector2f(0.f, 1.f);

View File

@ -15,7 +15,7 @@
#include <Nazara/Math/Plane.hpp> #include <Nazara/Math/Plane.hpp>
#include <Nazara/Math/Sphere.hpp> #include <Nazara/Math/Sphere.hpp>
#include <Nazara/Math/Vector3.hpp> #include <Nazara/Math/Vector3.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <array> #include <array>
#include <string> #include <string>
@ -28,7 +28,7 @@ namespace Nz
{ {
public: public:
Frustum() = default; Frustum() = default;
explicit Frustum(const EnumMap<FrustumPlane, Plane<T>>& planes); explicit Frustum(const EnumArray<FrustumPlane, Plane<T>>& planes);
template<typename U> explicit Frustum(const Frustum<U>& frustum); template<typename U> explicit Frustum(const Frustum<U>& frustum);
Frustum(const Frustum& frustum) = default; Frustum(const Frustum& frustum) = default;
~Frustum() = default; ~Frustum() = default;
@ -64,7 +64,7 @@ namespace Nz
friend bool Unserialize(SerializationContext& context, Frustum<U>* frustum, TypeTag<Frustum<U>>); friend bool Unserialize(SerializationContext& context, Frustum<U>* frustum, TypeTag<Frustum<U>>);
private: private:
EnumMap<FrustumPlane, Plane<T>> m_planes; EnumArray<FrustumPlane, Plane<T>> m_planes;
}; };
using Frustumd = Frustum<double>; using Frustumd = Frustum<double>;

View File

@ -8,7 +8,7 @@
#include <Nazara/Core/Algorithm.hpp> #include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Math/Algorithm.hpp> #include <Nazara/Math/Algorithm.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <cstring> #include <cstring>
#include <sstream> #include <sstream>
#include <Nazara/Core/Debug.hpp> #include <Nazara/Core/Debug.hpp>
@ -31,7 +31,7 @@ namespace Nz
* \param planes Frustum of type U to convert to type T * \param planes Frustum of type U to convert to type T
*/ */
template<typename T> template<typename T>
Frustum<T>::Frustum(const EnumMap<FrustumPlane, Plane<T>>& planes) : Frustum<T>::Frustum(const EnumArray<FrustumPlane, Plane<T>>& planes) :
m_planes(planes) m_planes(planes)
{ {
} }
@ -419,7 +419,7 @@ namespace Nz
Vector3<T> fc = eye + f * zFar; Vector3<T> fc = eye + f * zFar;
// Computing the frustum // Computing the frustum
EnumMap<BoxCorner, Vector3<T>> corners; EnumArray<BoxCorner, Vector3<T>> corners;
corners[BoxCorner::FarLeftBottom] = fc - u * farH - s * farW; corners[BoxCorner::FarLeftBottom] = fc - u * farH - s * farW;
corners[BoxCorner::FarLeftTop] = fc + u * farH - s * farW; corners[BoxCorner::FarLeftTop] = fc + u * farH - s * farW;
corners[BoxCorner::FarRightTop] = fc + u * farH + s * farW; corners[BoxCorner::FarRightTop] = fc + u * farH + s * farW;
@ -432,7 +432,7 @@ namespace Nz
// Construction of frustum's planes // Construction of frustum's planes
EnumMap<FrustumPlane, Plane<T>> planes; EnumArray<FrustumPlane, Plane<T>> planes;
planes[FrustumPlane::Bottom] = Plane(corners[BoxCorner::NearLeftBottom], corners[BoxCorner::NearRightBottom], corners[BoxCorner::FarRightBottom]); planes[FrustumPlane::Bottom] = Plane(corners[BoxCorner::NearLeftBottom], corners[BoxCorner::NearRightBottom], corners[BoxCorner::FarRightBottom]);
planes[FrustumPlane::Far] = Plane(corners[BoxCorner::FarRightTop], corners[BoxCorner::FarLeftTop], corners[BoxCorner::FarLeftBottom]); planes[FrustumPlane::Far] = Plane(corners[BoxCorner::FarRightTop], corners[BoxCorner::FarLeftTop], corners[BoxCorner::FarLeftBottom]);
planes[FrustumPlane::Left] = Plane(corners[BoxCorner::NearLeftTop], corners[BoxCorner::NearLeftBottom], corners[BoxCorner::FarLeftBottom]); planes[FrustumPlane::Left] = Plane(corners[BoxCorner::NearLeftTop], corners[BoxCorner::NearLeftBottom], corners[BoxCorner::FarLeftBottom]);
@ -456,7 +456,7 @@ namespace Nz
T plane[4]; T plane[4];
T invLength; T invLength;
EnumMap<FrustumPlane, Plane<T>> planes; EnumArray<FrustumPlane, Plane<T>> planes;
// Extract the numbers for the RIGHT plane // Extract the numbers for the RIGHT plane
plane[0] = viewProjMatrix[3] - viewProjMatrix[0]; plane[0] = viewProjMatrix[3] - viewProjMatrix[0];

View File

@ -11,7 +11,7 @@
#include <Nazara/Math/Enums.hpp> #include <Nazara/Math/Enums.hpp>
#include <Nazara/Math/Matrix4.hpp> #include <Nazara/Math/Matrix4.hpp>
#include <Nazara/Math/Vector3.hpp> #include <Nazara/Math/Vector3.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <string> #include <string>
namespace Nz namespace Nz
@ -54,7 +54,7 @@ namespace Nz
Box<T> localBox; Box<T> localBox;
private: private:
EnumMap<BoxCorner, Vector3<T>> m_corners; EnumArray<BoxCorner, Vector3<T>> m_corners;
}; };
using OrientedBoxd = OrientedBox<double>; using OrientedBoxd = OrientedBox<double>;

View File

@ -16,7 +16,7 @@
#include <Nazara/OpenGLRenderer/Wrapper/Loader.hpp> #include <Nazara/OpenGLRenderer/Wrapper/Loader.hpp>
#include <Nazara/Renderer/Enums.hpp> #include <Nazara/Renderer/Enums.hpp>
#include <Nazara/Renderer/RenderStates.hpp> #include <Nazara/Renderer/RenderStates.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <array> #include <array>
#include <string> #include <string>
#include <unordered_set> #include <unordered_set>
@ -257,10 +257,10 @@ namespace Nz::GL
struct TextureUnit struct TextureUnit
{ {
GLuint sampler = 0; GLuint sampler = 0;
EnumMap<TextureTarget, GLuint> textureTargets = { 0 }; EnumArray<TextureTarget, GLuint> textureTargets = { 0 };
}; };
EnumMap<BufferTarget, GLuint> bufferTargets = { 0 }; EnumArray<BufferTarget, GLuint> bufferTargets = { 0 };
std::vector<BufferBinding> storageUnits; std::vector<BufferBinding> storageUnits;
std::vector<BufferBinding> uboUnits; std::vector<BufferBinding> uboUnits;
std::vector<ImageUnits> imageUnits; std::vector<ImageUnits> imageUnits;
@ -275,7 +275,7 @@ namespace Nz::GL
RenderStates renderStates; RenderStates renderStates;
}; };
EnumMap<Extension, ExtensionStatus> m_extensionStatus; EnumArray<Extension, ExtensionStatus> m_extensionStatus;
std::array<GLFunction, UnderlyingCast(FunctionIndex::Count)> m_originalFunctionPointer; std::array<GLFunction, UnderlyingCast(FunctionIndex::Count)> m_originalFunctionPointer;
mutable std::unique_ptr<BlitFramebuffers> m_blitFramebuffers; mutable std::unique_ptr<BlitFramebuffers> m_blitFramebuffers;
std::unordered_set<std::string> m_supportedExtensions; std::unordered_set<std::string> m_supportedExtensions;

View File

@ -12,7 +12,7 @@
#include <Nazara/Platform/Config.hpp> #include <Nazara/Platform/Config.hpp>
#include <Nazara/Platform/Enums.hpp> #include <Nazara/Platform/Enums.hpp>
#include <Nazara/Utility/Image.hpp> #include <Nazara/Utility/Image.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <array> #include <array>
namespace Nz namespace Nz
@ -54,7 +54,7 @@ namespace Nz
SystemCursor m_systemCursor; SystemCursor m_systemCursor;
std::unique_ptr<CursorImpl> m_impl; std::unique_ptr<CursorImpl> m_impl;
static EnumMap<SystemCursor, std::shared_ptr<Cursor>> s_systemCursors; static EnumArray<SystemCursor, std::shared_ptr<Cursor>> s_systemCursors;
}; };
} }

View File

@ -2,7 +2,7 @@
// This file is part of the "Nazara Engine - Renderer module" // This file is part of the "Nazara Engine - Renderer module"
// For conditions of distribution and use, see copyright notice in Config.hpp // For conditions of distribution and use, see copyright notice in Config.hpp
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <Nazara/Renderer/Debug.hpp> #include <Nazara/Renderer/Debug.hpp>
namespace Nz namespace Nz
@ -28,7 +28,7 @@ namespace Nz
inline void DebugDrawer::DrawFrustum(const Frustumf& frustum, const Color& color) inline void DebugDrawer::DrawFrustum(const Frustumf& frustum, const Color& color)
{ {
EnumMap<BoxCorner, Vector3f> corners; EnumArray<BoxCorner, Vector3f> corners;
for (auto&& [corner, pos] : corners.iter_kv()) for (auto&& [corner, pos] : corners.iter_kv())
pos = frustum.ComputeCorner(corner); pos = frustum.ComputeCorner(corner);

View File

@ -12,7 +12,7 @@
#include <Nazara/Utility/Config.hpp> #include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Enums.hpp> #include <Nazara/Utility/Enums.hpp>
#include <NazaraUtils/Bitset.hpp> #include <NazaraUtils/Bitset.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <array> #include <array>
#include <functional> #include <functional>
@ -89,9 +89,9 @@ namespace Nz
static bool Initialize(); static bool Initialize();
static void Uninitialize(); static void Uninitialize();
static EnumMap<PixelFormat, EnumMap<PixelFormat, ConvertFunction>> s_convertFunctions; static EnumArray<PixelFormat, EnumArray<PixelFormat, ConvertFunction>> s_convertFunctions;
static EnumMap<PixelFormat, EnumMap<PixelFlipping, FlipFunction>> s_flipFunctions; static EnumArray<PixelFormat, EnumArray<PixelFlipping, FlipFunction>> s_flipFunctions;
static EnumMap<PixelFormat, PixelFormatDescription> s_pixelFormatInfos; static EnumArray<PixelFormat, PixelFormatDescription> s_pixelFormatInfos;
}; };
} }

View File

@ -11,7 +11,7 @@
#include <Nazara/Core/ObjectLibrary.hpp> #include <Nazara/Core/ObjectLibrary.hpp>
#include <Nazara/Utility/Config.hpp> #include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Enums.hpp> #include <Nazara/Utility/Enums.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <NazaraUtils/SparsePtr.hpp> #include <NazaraUtils/SparsePtr.hpp>
#include <array> #include <array>
#include <vector> #include <vector>
@ -78,7 +78,7 @@ namespace Nz
std::size_t m_stride; std::size_t m_stride;
VertexInputRate m_inputRate; VertexInputRate m_inputRate;
static EnumMap<VertexLayout, std::shared_ptr<VertexDeclaration>> s_declarations; static EnumArray<VertexLayout, std::shared_ptr<VertexDeclaration>> s_declarations;
}; };
} }

View File

@ -13,7 +13,7 @@
#include <Nazara/VulkanRenderer/Config.hpp> #include <Nazara/VulkanRenderer/Config.hpp>
#include <Nazara/VulkanRenderer/Wrapper/Loader.hpp> #include <Nazara/VulkanRenderer/Wrapper/Loader.hpp>
#include <Nazara/VulkanRenderer/Wrapper/PhysicalDevice.hpp> #include <Nazara/VulkanRenderer/Wrapper/PhysicalDevice.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <vulkan/vulkan_core.h> #include <vulkan/vulkan_core.h>
#include <array> #include <array>
#include <memory> #include <memory>
@ -113,7 +113,7 @@ namespace Nz
std::vector<const QueueList*> m_queuesByFamily; std::vector<const QueueList*> m_queuesByFamily;
Instance& m_instance; Instance& m_instance;
const Vk::PhysicalDevice* m_physicalDevice; const Vk::PhysicalDevice* m_physicalDevice;
EnumMap<QueueType, UInt32> m_defaultQueues; EnumArray<QueueType, UInt32> m_defaultQueues;
VkAllocationCallbacks m_allocator; VkAllocationCallbacks m_allocator;
VkDevice m_device; VkDevice m_device;
VkResult m_lastErrorCode; VkResult m_lastErrorCode;

View File

@ -4,7 +4,7 @@
#include <Nazara/Core/AbstractLogger.hpp> #include <Nazara/Core/AbstractLogger.hpp>
#include <Nazara/Core/Algorithm.hpp> #include <Nazara/Core/Algorithm.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <sstream> #include <sstream>
#include <Nazara/Core/Debug.hpp> #include <Nazara/Core/Debug.hpp>
@ -12,7 +12,7 @@ namespace Nz
{ {
namespace NAZARA_ANONYMOUS_NAMESPACE namespace NAZARA_ANONYMOUS_NAMESPACE
{ {
constexpr EnumMap<ErrorType, std::string_view> s_errorTypes = { constexpr EnumArray<ErrorType, std::string_view> s_errorTypes = {
"Assert failed: ", // ErrorType::AssertFailed "Assert failed: ", // ErrorType::AssertFailed
"Internal error: ", // ErrorType::Internal "Internal error: ", // ErrorType::Internal
"Error: ", // ErrorType::Normal "Error: ", // ErrorType::Normal

View File

@ -4,7 +4,7 @@
#include <Nazara/Core/HardwareInfo.hpp> #include <Nazara/Core/HardwareInfo.hpp>
#include <Nazara/Core/Error.hpp> #include <Nazara/Core/Error.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <frozen/string.h> #include <frozen/string.h>
#include <frozen/unordered_map.h> #include <frozen/unordered_map.h>
#include <algorithm> #include <algorithm>
@ -24,7 +24,7 @@ namespace Nz
{ {
namespace NAZARA_ANONYMOUS_NAMESPACE namespace NAZARA_ANONYMOUS_NAMESPACE
{ {
constexpr EnumMap<ProcessorVendor, std::string_view> s_vendorNames { constexpr EnumArray<ProcessorVendor, std::string_view> s_vendorNames {
"ACRN", // ProcessorVendor::ACRN "ACRN", // ProcessorVendor::ACRN
"Advanced Micro Devices", // ProcessorVendor::AMD "Advanced Micro Devices", // ProcessorVendor::AMD
"ao486", // ProcessorVendor::Ao486 "ao486", // ProcessorVendor::Ao486

View File

@ -4,7 +4,7 @@
#include <Nazara/Core/StdLogger.hpp> #include <Nazara/Core/StdLogger.hpp>
#include <Nazara/Core/Algorithm.hpp> #include <Nazara/Core/Algorithm.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <cstdio> #include <cstdio>
#include <Nazara/Core/Debug.hpp> #include <Nazara/Core/Debug.hpp>
@ -12,7 +12,7 @@ namespace Nz
{ {
namespace NAZARA_ANONYMOUS_NAMESPACE namespace NAZARA_ANONYMOUS_NAMESPACE
{ {
constexpr EnumMap<ErrorType, std::string_view> s_errorTypes = { constexpr EnumArray<ErrorType, std::string_view> s_errorTypes = {
"Assert failed: ", // ErrorType::AssertFailed "Assert failed: ", // ErrorType::AssertFailed
"Internal error: ", // ErrorType::Internal "Internal error: ", // ErrorType::Internal
"Error: ", // ErrorType::Normal "Error: ", // ErrorType::Normal

View File

@ -116,7 +116,7 @@ namespace Nz
void Tilemap::UpdateVertices() const void Tilemap::UpdateVertices() const
{ {
EnumMap<RectCorner, Vector2f> cornerExtent; EnumArray<RectCorner, Vector2f> cornerExtent;
cornerExtent[RectCorner::LeftBottom] = Vector2f(0.f, 0.f); cornerExtent[RectCorner::LeftBottom] = Vector2f(0.f, 0.f);
cornerExtent[RectCorner::RightBottom] = Vector2f(1.f, 0.f); cornerExtent[RectCorner::RightBottom] = Vector2f(1.f, 0.f);
cornerExtent[RectCorner::LeftTop] = Vector2f(0.f, 1.f); cornerExtent[RectCorner::LeftTop] = Vector2f(0.f, 1.f);

View File

@ -9,7 +9,7 @@
#include <Nazara/Network/Algorithm.hpp> #include <Nazara/Network/Algorithm.hpp>
#include <Nazara/Network/NetBuffer.hpp> #include <Nazara/Network/NetBuffer.hpp>
#include <Nazara/Network/Posix/IpAddressImpl.hpp> #include <Nazara/Network/Posix/IpAddressImpl.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <NazaraUtils/StackArray.hpp> #include <NazaraUtils/StackArray.hpp>
#include <cstring> #include <cstring>
#include <poll.h> #include <poll.h>
@ -1018,7 +1018,7 @@ namespace Nz
{ {
NazaraAssert(protocol <= NetProtocol::Max, "Protocol has value out of enum"); NazaraAssert(protocol <= NetProtocol::Max, "Protocol has value out of enum");
constexpr EnumMap<NetProtocol, int> addressFamily { constexpr EnumArray<NetProtocol, int> addressFamily {
AF_UNSPEC, //< NetProtocol::Any AF_UNSPEC, //< NetProtocol::Any
AF_INET, //< NetProtocol::IPv4 AF_INET, //< NetProtocol::IPv4
AF_INET6, //< NetProtocol::IPv6 AF_INET6, //< NetProtocol::IPv6
@ -1032,7 +1032,7 @@ namespace Nz
{ {
NazaraAssert(type <= SocketType::Max, "Socket type has value out of enum"); NazaraAssert(type <= SocketType::Max, "Socket type has value out of enum");
constexpr EnumMap<SocketType, int> socketType { constexpr EnumArray<SocketType, int> socketType {
SOCK_RAW, //< SocketType::Raw SOCK_RAW, //< SocketType::Raw
SOCK_STREAM, //< SocketType::TCP SOCK_STREAM, //< SocketType::TCP
SOCK_DGRAM, //< SocketType::UDP SOCK_DGRAM, //< SocketType::UDP

View File

@ -8,7 +8,7 @@
#include <Nazara/Core/Log.hpp> #include <Nazara/Core/Log.hpp>
#include <Nazara/Core/StringExt.hpp> #include <Nazara/Core/StringExt.hpp>
#include <Nazara/Network/Win32/IpAddressImpl.hpp> #include <Nazara/Network/Win32/IpAddressImpl.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <NazaraUtils/StackArray.hpp> #include <NazaraUtils/StackArray.hpp>
// Some compilers (older versions of MinGW) lack Mstcpip.h which defines some structs/defines // Some compilers (older versions of MinGW) lack Mstcpip.h which defines some structs/defines
@ -1000,7 +1000,7 @@ namespace Nz
{ {
NazaraAssert(protocol <= NetProtocol::Max, "Protocol has value out of enum"); NazaraAssert(protocol <= NetProtocol::Max, "Protocol has value out of enum");
constexpr EnumMap<NetProtocol, int> addressFamily { constexpr EnumArray<NetProtocol, int> addressFamily {
AF_UNSPEC, //< NetProtocol::Any AF_UNSPEC, //< NetProtocol::Any
AF_INET, //< NetProtocol::IPv4 AF_INET, //< NetProtocol::IPv4
AF_INET6, //< NetProtocol::IPv6 AF_INET6, //< NetProtocol::IPv6
@ -1014,7 +1014,7 @@ namespace Nz
{ {
NazaraAssert(type <= SocketType::Max, "Socket type has value out of enum"); NazaraAssert(type <= SocketType::Max, "Socket type has value out of enum");
constexpr EnumMap<SocketType, int> socketType { constexpr EnumArray<SocketType, int> socketType {
SOCK_RAW, //< SocketType::Raw SOCK_RAW, //< SocketType::Raw
SOCK_STREAM, //< SocketType::TCP SOCK_STREAM, //< SocketType::TCP
SOCK_DGRAM, //< SocketType::UDP SOCK_DGRAM, //< SocketType::UDP

View File

@ -88,5 +88,5 @@ namespace Nz
cursor.reset(); cursor.reset();
} }
EnumMap<SystemCursor, std::shared_ptr<Cursor>> Cursor::s_systemCursors; EnumArray<SystemCursor, std::shared_ptr<Cursor>> Cursor::s_systemCursors;
} }

View File

@ -12,7 +12,7 @@ namespace Nz
{ {
namespace NAZARA_ANONYMOUS_NAMESPACE namespace NAZARA_ANONYMOUS_NAMESPACE
{ {
constexpr EnumMap<SystemCursor, SDL_SystemCursor> s_systemCursorIds = constexpr EnumArray<SystemCursor, SDL_SystemCursor> s_systemCursorIds =
{ {
SDL_SYSTEM_CURSOR_CROSSHAIR, // SystemCursor::Crosshair SDL_SYSTEM_CURSOR_CROSSHAIR, // SystemCursor::Crosshair
SDL_SYSTEM_CURSOR_ARROW, // SystemCursor::Default SDL_SYSTEM_CURSOR_ARROW, // SystemCursor::Default

View File

@ -13,7 +13,7 @@
#include <Nazara/Utility/Image.hpp> #include <Nazara/Utility/Image.hpp>
#include <Nazara/Utility/Utility.hpp> #include <Nazara/Utility/Utility.hpp>
#include <NazaraUtils/CallOnExit.hpp> #include <NazaraUtils/CallOnExit.hpp>
#include <NazaraUtils/EnumMap.hpp> #include <NazaraUtils/EnumArray.hpp>
#include <filesystem> #include <filesystem>
#include <stdexcept> #include <stdexcept>
@ -117,7 +117,7 @@ namespace Nz
#endif #endif
#else #else
constexpr EnumMap<RenderAPI, const char*> rendererPaths = { constexpr EnumArray<RenderAPI, const char*> rendererPaths = {
NazaraRendererPrefix "NazaraDirect3DRenderer" NazaraRendererDebugSuffix, // Direct3D NazaraRendererPrefix "NazaraDirect3DRenderer" NazaraRendererDebugSuffix, // Direct3D
NazaraRendererPrefix "NazaraMantleRenderer" NazaraRendererDebugSuffix, // Mantle NazaraRendererPrefix "NazaraMantleRenderer" NazaraRendererDebugSuffix, // Mantle
NazaraRendererPrefix "NazaraMetalRenderer" NazaraRendererDebugSuffix, // Metal NazaraRendererPrefix "NazaraMetalRenderer" NazaraRendererDebugSuffix, // Metal

View File

@ -1835,7 +1835,7 @@ namespace Nz
} }
} }
EnumMap<PixelFormat, EnumMap<PixelFormat, PixelFormatInfo::ConvertFunction>> PixelFormatInfo::s_convertFunctions; EnumArray<PixelFormat, EnumArray<PixelFormat, PixelFormatInfo::ConvertFunction>> PixelFormatInfo::s_convertFunctions;
EnumMap<PixelFormat, EnumMap<PixelFlipping, PixelFormatInfo::FlipFunction>> PixelFormatInfo::s_flipFunctions; EnumArray<PixelFormat, EnumArray<PixelFlipping, PixelFormatInfo::FlipFunction>> PixelFormatInfo::s_flipFunctions;
EnumMap<PixelFormat, PixelFormatDescription> PixelFormatInfo::s_pixelFormatInfos; EnumArray<PixelFormat, PixelFormatDescription> PixelFormatInfo::s_pixelFormatInfos;
} }

View File

@ -16,7 +16,7 @@ namespace Nz
{ {
namespace NAZARA_ANONYMOUS_NAMESPACE namespace NAZARA_ANONYMOUS_NAMESPACE
{ {
constexpr EnumMap<ComponentType, std::size_t> s_componentStride = { constexpr EnumArray<ComponentType, std::size_t> s_componentStride = {
4 * sizeof(float), // ComponentType::Color 4 * sizeof(float), // ComponentType::Color
1 * sizeof(double), // ComponentType::Double1 1 * sizeof(double), // ComponentType::Double1
2 * sizeof(double), // ComponentType::Double2 2 * sizeof(double), // ComponentType::Double2
@ -349,5 +349,5 @@ namespace Nz
s_declarations.fill(nullptr); s_declarations.fill(nullptr);
} }
EnumMap<VertexLayout, std::shared_ptr<VertexDeclaration>> VertexDeclaration::s_declarations; EnumArray<VertexLayout, std::shared_ptr<VertexDeclaration>> VertexDeclaration::s_declarations;
} }

View File

@ -28,7 +28,7 @@ namespace Nz
{ {
} }
EnumMap<QueueType, Vk::CommandPool> commandPools; EnumArray<QueueType, Vk::CommandPool> commandPools;
VulkanDescriptorSetLayoutCache setLayoutCache; VulkanDescriptorSetLayoutCache setLayoutCache;
}; };