From 3a386645c2e30904d777a3e92408c8ec385f7e23 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 4 Dec 2018 18:36:12 +0330 Subject: [PATCH] wined3d: Get rid of the "colRGBA" variable in light(). Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/state.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 42c109da57b..8708aa09b3e 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -4152,35 +4152,15 @@ static void light(struct wined3d_context *context, const struct wined3d_state *s else { float quad_att; - float colRGBA[] = {0.0f, 0.0f, 0.0f, 0.0f}; /* Light settings are affected by the model view in OpenGL, the View transform in direct3d*/ gl_info->gl_ops.gl.p_glMatrixMode(GL_MODELVIEW); gl_info->gl_ops.gl.p_glPushMatrix(); gl_info->gl_ops.gl.p_glLoadMatrixf(&state->transforms[WINED3D_TS_VIEW]._11); - /* Diffuse: */ - colRGBA[0] = lightInfo->OriginalParms.diffuse.r; - colRGBA[1] = lightInfo->OriginalParms.diffuse.g; - colRGBA[2] = lightInfo->OriginalParms.diffuse.b; - colRGBA[3] = lightInfo->OriginalParms.diffuse.a; - gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + Index, GL_DIFFUSE, colRGBA); - checkGLcall("glLightfv"); - - /* Specular */ - colRGBA[0] = lightInfo->OriginalParms.specular.r; - colRGBA[1] = lightInfo->OriginalParms.specular.g; - colRGBA[2] = lightInfo->OriginalParms.specular.b; - colRGBA[3] = lightInfo->OriginalParms.specular.a; - gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + Index, GL_SPECULAR, colRGBA); - checkGLcall("glLightfv"); - - /* Ambient */ - colRGBA[0] = lightInfo->OriginalParms.ambient.r; - colRGBA[1] = lightInfo->OriginalParms.ambient.g; - colRGBA[2] = lightInfo->OriginalParms.ambient.b; - colRGBA[3] = lightInfo->OriginalParms.ambient.a; - gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + Index, GL_AMBIENT, colRGBA); + gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + Index, GL_DIFFUSE, &lightInfo->OriginalParms.diffuse.r); + gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + Index, GL_SPECULAR, &lightInfo->OriginalParms.specular.r); + gl_info->gl_ops.gl.p_glLightfv(GL_LIGHT0 + Index, GL_AMBIENT, &lightInfo->OriginalParms.ambient.r); checkGLcall("glLightfv"); if ((lightInfo->OriginalParms.range * lightInfo->OriginalParms.range) >= FLT_MIN)