1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:57:45 +00:00

LibGL: Reduce nesting levels in gl_tex_env

This commit is contained in:
Jelle Raaijmakers 2021-12-30 00:40:42 +01:00 committed by Andreas Kling
parent 8cf91a5ae5
commit 92ecd66490

View file

@ -1970,8 +1970,12 @@ void SoftwareGLContext::gl_tex_env(GLenum target, GLenum pname, GLfloat param)
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_tex_env, target, pname, param); APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_tex_env, target, pname, param);
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION); RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
if (target == GL_TEXTURE_ENV) { // FIXME: We currently only support a subset of possible target values. Implement the rest!
if (pname == GL_TEXTURE_ENV_MODE) { RETURN_WITH_ERROR_IF(target != GL_TEXTURE_ENV, GL_INVALID_ENUM);
// FIXME: We currently only support a subset of possible pname values. Implement the rest!
RETURN_WITH_ERROR_IF(pname != GL_TEXTURE_ENV_MODE, GL_INVALID_ENUM);
auto param_enum = static_cast<GLenum>(param); auto param_enum = static_cast<GLenum>(param);
switch (param_enum) { switch (param_enum) {
@ -1982,15 +1986,7 @@ void SoftwareGLContext::gl_tex_env(GLenum target, GLenum pname, GLfloat param)
break; break;
default: default:
// FIXME: We currently only support a subset of possible param values. Implement the rest! // FIXME: We currently only support a subset of possible param values. Implement the rest!
RETURN_WITH_ERROR_IF(true, GL_INVALID_ENUM); dbgln_if(GL_DEBUG, "gl_tex_env({:#x}, {:#x}, {}): param unimplemented", target, pname, param);
break;
}
} else {
// FIXME: We currently only support a subset of possible pname values. Implement the rest!
RETURN_WITH_ERROR_IF(true, GL_INVALID_ENUM);
}
} else {
// FIXME: We currently only support a subset of possible target values. Implement the rest!
RETURN_WITH_ERROR_IF(true, GL_INVALID_ENUM); RETURN_WITH_ERROR_IF(true, GL_INVALID_ENUM);
} }
} }