From 27cb7044669c62922be6f68913007d2567ce2480 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Sat, 26 Jun 2021 12:48:28 -0700 Subject: Eliminate VarType for ComponentFormat --- Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp') diff --git a/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp b/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp index 9a6e568c8d..d21a40ebc1 100644 --- a/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp +++ b/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "Common/CommonTypes.h" +#include "Common/EnumMap.h" #include "Common/GL/GLUtil.h" #include "Common/MsgHandler.h" @@ -23,10 +24,11 @@ Renderer::CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl) return std::make_unique(vtx_decl); } -static inline GLuint VarToGL(VarType t) +static inline GLuint VarToGL(ComponentFormat t) { - static const GLuint lookup[5] = {GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, - GL_FLOAT}; + static constexpr Common::EnumMap lookup = { + GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_FLOAT, + }; return lookup[t]; } -- cgit v1.2.3