mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:57:44 +00:00
LibGL: Reduce nesting levels in gl_tex_env
This commit is contained in:
parent
8cf91a5ae5
commit
92ecd66490
1 changed files with 16 additions and 20 deletions
|
@ -1970,27 +1970,23 @@ 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);
|
||||
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
|
||||
|
||||
if (target == GL_TEXTURE_ENV) {
|
||||
if (pname == GL_TEXTURE_ENV_MODE) {
|
||||
auto param_enum = static_cast<GLenum>(param);
|
||||
// FIXME: We currently only support a subset of possible target values. Implement the rest!
|
||||
RETURN_WITH_ERROR_IF(target != GL_TEXTURE_ENV, GL_INVALID_ENUM);
|
||||
|
||||
switch (param_enum) {
|
||||
case GL_MODULATE:
|
||||
case GL_REPLACE:
|
||||
case GL_DECAL:
|
||||
m_active_texture_unit->set_env_mode(param_enum);
|
||||
break;
|
||||
default:
|
||||
// FIXME: We currently only support a subset of possible param values. Implement the rest!
|
||||
RETURN_WITH_ERROR_IF(true, GL_INVALID_ENUM);
|
||||
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!
|
||||
// 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);
|
||||
|
||||
switch (param_enum) {
|
||||
case GL_MODULATE:
|
||||
case GL_REPLACE:
|
||||
case GL_DECAL:
|
||||
m_active_texture_unit->set_env_mode(param_enum);
|
||||
break;
|
||||
default:
|
||||
// FIXME: We currently only support a subset of possible param values. Implement the rest!
|
||||
dbgln_if(GL_DEBUG, "gl_tex_env({:#x}, {:#x}, {}): param unimplemented", target, pname, param);
|
||||
RETURN_WITH_ERROR_IF(true, GL_INVALID_ENUM);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue