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

@@ -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;
};