diff --git a/engines/grim/gfx_opengl.cpp b/engines/grim/gfx_opengl.cpp index ad7d7cbcccf..b9de9d0ae5e 100644 --- a/engines/grim/gfx_opengl.cpp +++ b/engines/grim/gfx_opengl.cpp @@ -158,8 +158,6 @@ byte *GfxOpenGL::setupScreen(int screenW, int screenH, bool fullscreen) { GLfloat ambientSource[] = { 0.0f, 0.0f, 0.0f, 1.0f }; glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambientSource); - GLfloat specularReflectance[] = { 0.3f, 0.3f, 0.3f, 1.0f }; - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specularReflectance); if (g_grim->getGameType() == GType_GRIM) { glPolygonOffset(-6.0, -6.0); @@ -970,17 +968,16 @@ void GfxOpenGL::setupLight(Light *light, int lightId) { } glEnable(GL_LIGHTING); - GLfloat diffuse[] = { 0.0f, 0.0f, 0.0f, 1.0f }; - GLfloat specular[] = { 0.0f, 0.0f, 0.0f, 1.0f }; + GLfloat lightColor[] = { 0.0f, 0.0f, 0.0f, 1.0f }; GLfloat lightPos[] = { 0.0f, 0.0f, 0.0f, 1.0f }; GLfloat lightDir[] = { 0.0f, 0.0f, -1.0f }; GLfloat cutoff = 180.0f; GLfloat spot_exp = 0.0f; GLfloat intensity = light->_intensity; - diffuse[0] = ((GLfloat)light->_color.getRed() / 15.0f) * intensity; - diffuse[1] = ((GLfloat)light->_color.getGreen() / 15.0f) * intensity; - diffuse[2] = ((GLfloat)light->_color.getBlue() / 15.0f) * intensity; + lightColor[0] = ((GLfloat)light->_color.getRed() / 15.0f) * intensity; + lightColor[1] = ((GLfloat)light->_color.getGreen() / 15.0f) * intensity; + lightColor[2] = ((GLfloat)light->_color.getBlue() / 15.0f) * intensity; if (light->_type == Light::Omni) { lightPos[0] = light->_pos.x(); @@ -998,16 +995,12 @@ void GfxOpenGL::setupLight(Light *light, int lightId) { lightDir[0] = light->_dir.x(); lightDir[1] = light->_dir.y(); lightDir[2] = light->_dir.z(); - specular[0] = diffuse[0]; - specular[1] = diffuse[1]; - specular[2] = diffuse[2]; spot_exp = 2.0f; cutoff = light->_penumbraangle; } glDisable(GL_LIGHT0 + lightId); - glLightfv(GL_LIGHT0 + lightId, GL_DIFFUSE, diffuse); - glLightfv(GL_LIGHT0 + lightId, GL_SPECULAR, specular); + glLightfv(GL_LIGHT0 + lightId, GL_DIFFUSE, lightColor); glLightfv(GL_LIGHT0 + lightId, GL_POSITION, lightPos); glLightfv(GL_LIGHT0 + lightId, GL_SPOT_DIRECTION, lightDir); glLightf(GL_LIGHT0 + lightId, GL_SPOT_EXPONENT, spot_exp);