Make use of the new EnumMap class

This commit is contained in:
SirLynix
2023-05-30 12:32:37 +02:00
parent d914f41404
commit dfe6b2ddcf
46 changed files with 354 additions and 379 deletions

View File

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

View File

@@ -20,7 +20,7 @@ namespace Nz
inline std::shared_ptr<Cursor>& Cursor::Get(SystemCursor cursor)
{
return s_systemCursors[UnderlyingCast(cursor)];
return s_systemCursors[cursor];
}
}