From c03b21f0eac44b02b939cf27ee0e2eb43278b664 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Thu, 13 Jan 2022 02:59:46 +0100 Subject: [PATCH] LibGL: Make `MaterialFace` a simple `u8` enum Now we don't need to use `to_underlying` everywhere. --- Userland/Libraries/LibGL/SoftwareGLContext.cpp | 16 ++++++++-------- Userland/Libraries/LibGL/SoftwareGLContext.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Userland/Libraries/LibGL/SoftwareGLContext.cpp b/Userland/Libraries/LibGL/SoftwareGLContext.cpp index b2bac5cbd21..6f9403e0e0d 100644 --- a/Userland/Libraries/LibGL/SoftwareGLContext.cpp +++ b/Userland/Libraries/LibGL/SoftwareGLContext.cpp @@ -3187,14 +3187,14 @@ void SoftwareGLContext::gl_materialf(GLenum face, GLenum pname, GLfloat param) switch (face) { case GL_FRONT: - m_material_states.at(to_underlying(MaterialFace::Front)).shininess = param; + m_material_states.at(MaterialFace::Front).shininess = param; break; case GL_BACK: - m_material_states.at(to_underlying(MaterialFace::Back)).shininess = param; + m_material_states.at(MaterialFace::Back).shininess = param; break; case GL_FRONT_AND_BACK: - m_material_states.at(to_underlying(MaterialFace::Front)).shininess = param; - m_material_states.at(to_underlying(MaterialFace::Back)).shininess = param; + m_material_states.at(MaterialFace::Front).shininess = param; + m_material_states.at(MaterialFace::Back).shininess = param; break; default: VERIFY_NOT_REACHED(); @@ -3236,14 +3236,14 @@ void SoftwareGLContext::gl_materialfv(GLenum face, GLenum pname, GLfloat const* switch (face) { case GL_FRONT: - update_material(m_material_states.at(to_underlying(MaterialFace::Front)), pname, params); + update_material(m_material_states.at(MaterialFace::Front), pname, params); break; case GL_BACK: - update_material(m_material_states.at(to_underlying(MaterialFace::Back)), pname, params); + update_material(m_material_states.at(MaterialFace::Back), pname, params); break; case GL_FRONT_AND_BACK: - update_material(m_material_states.at(to_underlying(MaterialFace::Front)), pname, params); - update_material(m_material_states.at(to_underlying(MaterialFace::Back)), pname, params); + update_material(m_material_states.at(MaterialFace::Front), pname, params); + update_material(m_material_states.at(MaterialFace::Back), pname, params); break; } diff --git a/Userland/Libraries/LibGL/SoftwareGLContext.h b/Userland/Libraries/LibGL/SoftwareGLContext.h index 06de61a85ac..a9d9b5e6da9 100644 --- a/Userland/Libraries/LibGL/SoftwareGLContext.h +++ b/Userland/Libraries/LibGL/SoftwareGLContext.h @@ -41,7 +41,7 @@ struct ContextParameter { } value; }; -enum class MaterialFace : u8 { +enum MaterialFace : u8 { Front = 0, Back = 1, };