Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp
- index cf0e71e..142390e 100644
- --- a/src/graphics/opengl/gldevice.cpp
- +++ b/src/graphics/opengl/gldevice.cpp
- @@ -566,20 +566,21 @@ void CGLDevice::UpdateLightPositions()
- for (int index = 0; index < lightCount; index++)
- {
- - if (m_lights[index].type == LIGHT_SPOT)
- + const Light& light = m_lights[index];
- + if (light.type == LIGHT_SPOT)
- {
- - GLfloat direction[4] = { -m_lights[index].direction.x,
- - -m_lights[index].direction.y,
- - -m_lights[index].direction.z,
- + GLfloat direction[4] = { -light.direction.x,
- + -light.direction.y,
- + -light.direction.z,
- 1.0f };
- glLightfv(GL_LIGHT0 + index, GL_SPOT_DIRECTION, direction);
- }
- - else if (m_lights[index].type == LIGHT_DIRECTIONAL)
- + else if (light.type == LIGHT_DIRECTIONAL)
- {
- - GLfloat position[4] = { -m_lights[index].direction.x,
- - -m_lights[index].direction.y,
- - -m_lights[index].direction.z,
- + GLfloat position[4] = { -light.direction.x,
- + -light.direction.y,
- + -light.direction.z,
- 0.0f };
- glLightfv(GL_LIGHT0 + index, GL_POSITION, position);
- }
- @@ -592,11 +593,12 @@ void CGLDevice::UpdateLightPositions()
- for (int index = 0; index < lightCount; index++)
- {
- - if (m_lights[index].type == LIGHT_POINT)
- + const Light& light = m_lights[index];
- + if (light.type == LIGHT_POINT)
- {
- - GLfloat position[4] = { m_lights[index].position.x,
- - m_lights[index].position.y,
- - m_lights[index].position.z,
- + GLfloat position[4] = { light.position.x,
- + light.position.y,
- + light.position.z,
- 1.0f };
- glLightfv(GL_LIGHT0 + index, GL_POSITION, position);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement