From 403c560a7ae3d1a3e4c20224447fe4f48499305f Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Fri, 9 Dec 2022 16:23:23 +0100 Subject: [PATCH] LibGL: Correct `GL_LIGHT_MODEL_LOCAL_VIEWER` comparison We were comparing the `x` parameter to `1.f` instead of `0.f`. --- Userland/Libraries/LibGL/Lighting.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibGL/Lighting.cpp b/Userland/Libraries/LibGL/Lighting.cpp index 97eb0f4894..638a27bba0 100644 --- a/Userland/Libraries/LibGL/Lighting.cpp +++ b/Userland/Libraries/LibGL/Lighting.cpp @@ -179,11 +179,10 @@ void GLContext::gl_light_model(GLenum pname, GLfloat x, GLfloat y, GLfloat z, GL case GL_LIGHT_MODEL_LOCAL_VIEWER: // 0 means the viewer is at infinity // 1 means they're in local (eye) space - lighting_params.viewer_at_infinity = (x != 1.0f); + lighting_params.viewer_at_infinity = (x == 0.f); break; case GL_LIGHT_MODEL_TWO_SIDE: - VERIFY(y == 0.0f && z == 0.0f && w == 0.0f); - lighting_params.two_sided_lighting = x; + lighting_params.two_sided_lighting = (x != 0.f); break; default: VERIFY_NOT_REACHED();