Improved scheduling of point lights for the render queue by fixing a bug.

This commit is contained in:
Faerbit 2015-06-02 00:33:55 +02:00
parent 819584ef15
commit e8c1dee3b5

View File

@ -353,6 +353,9 @@ void Graphics::render(double time)
bool enqueued = false; bool enqueued = false;
for(unsigned int j = 0; j<renderQueue.size(); j++){ for(unsigned int j = 0; j<renderQueue.size(); j++){
if (shadowRenderQueue.at(i).currentPriority > std::get<1>(renderQueue.at(j))){ if (shadowRenderQueue.at(i).currentPriority > std::get<1>(renderQueue.at(j))){
if (j<renderQueue.size() - 2) {
renderQueue.at(j+1) = renderQueue.at(j);
}
renderQueue.at(j) = std::make_tuple(shadowRenderQueue.at(i).light, shadowRenderQueue.at(i).currentPriority, i); renderQueue.at(j) = std::make_tuple(shadowRenderQueue.at(i).light, shadowRenderQueue.at(i).currentPriority, i);
enqueued = true; enqueued = true;
break; break;