mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibGL: Make MaterialFace
a simple u8
enum
Now we don't need to use `to_underlying` everywhere.
This commit is contained in:
parent
58e025ac08
commit
c03b21f0ea
Notes:
sideshowbarker
2024-07-17 20:59:54 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/c03b21f0eac Pull-request: https://github.com/SerenityOS/serenity/pull/11851 Reviewed-by: https://github.com/Quaker762 ✅ Reviewed-by: https://github.com/sunverwerth ✅
2 changed files with 9 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ struct ContextParameter {
|
|||
} value;
|
||||
};
|
||||
|
||||
enum class MaterialFace : u8 {
|
||||
enum MaterialFace : u8 {
|
||||
Front = 0,
|
||||
Back = 1,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue