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

View File

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

View File

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

View File

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

View File

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

View File

@ -90,7 +90,7 @@ namespace Nz
{
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::RightBottom] = Vector2f(1.f, 0.f);
cornerExtent[RectCorner::LeftTop] = Vector2f(0.f, 1.f);

View File

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

View File

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

View File

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

View File

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

View File

@ -12,7 +12,7 @@
#include <Nazara/Platform/Config.hpp>
#include <Nazara/Platform/Enums.hpp>
#include <Nazara/Utility/Image.hpp>
#include <NazaraUtils/EnumMap.hpp>
#include <NazaraUtils/EnumArray.hpp>
#include <array>
namespace Nz
@ -54,7 +54,7 @@ namespace Nz
SystemCursor m_systemCursor;
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"
// 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>
namespace Nz
@ -28,7 +28,7 @@ namespace Nz
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())
pos = frustum.ComputeCorner(corner);

View File

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

View File

@ -11,7 +11,7 @@
#include <Nazara/Core/ObjectLibrary.hpp>
#include <Nazara/Utility/Config.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <NazaraUtils/EnumMap.hpp>
#include <NazaraUtils/EnumArray.hpp>
#include <NazaraUtils/SparsePtr.hpp>
#include <array>
#include <vector>
@ -78,7 +78,7 @@ namespace Nz
std::size_t m_stride;
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/Wrapper/Loader.hpp>
#include <Nazara/VulkanRenderer/Wrapper/PhysicalDevice.hpp>
#include <NazaraUtils/EnumMap.hpp>
#include <NazaraUtils/EnumArray.hpp>
#include <vulkan/vulkan_core.h>
#include <array>
#include <memory>
@ -113,7 +113,7 @@ namespace Nz
std::vector<const QueueList*> m_queuesByFamily;
Instance& m_instance;
const Vk::PhysicalDevice* m_physicalDevice;
EnumMap<QueueType, UInt32> m_defaultQueues;
EnumArray<QueueType, UInt32> m_defaultQueues;
VkAllocationCallbacks m_allocator;
VkDevice m_device;
VkResult m_lastErrorCode;

View File

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@
#include <Nazara/Network/Algorithm.hpp>
#include <Nazara/Network/NetBuffer.hpp>
#include <Nazara/Network/Posix/IpAddressImpl.hpp>
#include <NazaraUtils/EnumMap.hpp>
#include <NazaraUtils/EnumArray.hpp>
#include <NazaraUtils/StackArray.hpp>
#include <cstring>
#include <poll.h>
@ -1018,7 +1018,7 @@ namespace Nz
{
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_INET, //< NetProtocol::IPv4
AF_INET6, //< NetProtocol::IPv6
@ -1032,7 +1032,7 @@ namespace Nz
{
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_STREAM, //< SocketType::TCP
SOCK_DGRAM, //< SocketType::UDP

View File

@ -8,7 +8,7 @@
#include <Nazara/Core/Log.hpp>
#include <Nazara/Core/StringExt.hpp>
#include <Nazara/Network/Win32/IpAddressImpl.hpp>
#include <NazaraUtils/EnumMap.hpp>
#include <NazaraUtils/EnumArray.hpp>
#include <NazaraUtils/StackArray.hpp>
// 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");
constexpr EnumMap<NetProtocol, int> addressFamily {
constexpr EnumArray<NetProtocol, int> addressFamily {
AF_UNSPEC, //< NetProtocol::Any
AF_INET, //< NetProtocol::IPv4
AF_INET6, //< NetProtocol::IPv6
@ -1014,7 +1014,7 @@ namespace Nz
{
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_STREAM, //< SocketType::TCP
SOCK_DGRAM, //< SocketType::UDP

View File

@ -88,5 +88,5 @@ namespace Nz
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
{
constexpr EnumMap<SystemCursor, SDL_SystemCursor> s_systemCursorIds =
constexpr EnumArray<SystemCursor, SDL_SystemCursor> s_systemCursorIds =
{
SDL_SYSTEM_CURSOR_CROSSHAIR, // SystemCursor::Crosshair
SDL_SYSTEM_CURSOR_ARROW, // SystemCursor::Default

View File

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

View File

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

View File

@ -16,7 +16,7 @@ namespace Nz
{
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
1 * sizeof(double), // ComponentType::Double1
2 * sizeof(double), // ComponentType::Double2
@ -349,5 +349,5 @@ namespace Nz
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;
};