diff --git a/game/graphics.cc b/game/graphics.cc index 09f11a2..96cdef4 100644 --- a/game/graphics.cc +++ b/game/graphics.cc @@ -680,32 +680,32 @@ void Graphics::updateLights() { } // Build light position array - glm::vec3 lightSources[closestLights->size()]; - for(unsigned int i = 0; isize(); i++) { - lightSources[i] = closestLights->at(i)->getPosition(); + glm::vec3 lightSources[shadowRenderQueue.size()]; + for(unsigned int i = 0; igetPosition(); } glUniform3fv(lightingShader->getUniformLocation("lightSources"), sizeof(lightSources), (GLfloat*) lightSources); // Build light colour array - glm::vec3 lightColours[closestLights->size()]; - for(unsigned int i = 0; isize(); i++) { - lightColours[i] = closestLights->at(i)->getColour(); + glm::vec3 lightColours[shadowRenderQueue.size()]; + for(unsigned int i = 0; igetColour(); } glUniform3fv(lightingShader->getUniformLocation("lightColors"), sizeof(lightColours), (GLfloat*) lightColours); // Build light attenuation array - float lightIntensities[closestLights->size()]; - for(unsigned int i = 0; isize(); i++) { - lightIntensities[i] = closestLights->at(i)->getIntensity(); + float lightIntensities[shadowRenderQueue.size()]; + for(unsigned int i = 0; igetIntensity(); } glUniform1fv(lightingShader->getUniformLocation("lightIntensities"), sizeof(lightIntensities), (GLfloat*) lightIntensities); - bool isFlame[closestLights->size()]; + bool isFlame[shadowRenderQueue.size()]; closestFlames = std::vector(); - for (unsigned int i = 0; isize(); i++) { - if (closestLights->at(i)->isFlame()) { - closestFlames.push_back(closestLights->at(i)->getFlame()); + for(unsigned int i = 0; iisFlame()) { + closestFlames.push_back(shadowRenderQueue.at(i).light->getFlame()); isFlame[i] = true; } else {