From b280ad8c1228f6eecafa1c3e92f5e4deaf2d496a Mon Sep 17 00:00:00 2001 From: Faerbit Date: Mon, 1 Jun 2015 16:17:37 +0200 Subject: [PATCH] Small performance optimization. --- game/graphics.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/game/graphics.cc b/game/graphics.cc index 09135cf..12fedfd 100644 --- a/game/graphics.cc +++ b/game/graphics.cc @@ -352,9 +352,10 @@ void Graphics::render(double time) for(unsigned int i = 0; i std::get<1>(renderQueue.at(j)) && ! enqueued){ + if (shadowRenderQueue.at(i).currentPriority > std::get<1>(renderQueue.at(j))){ renderQueue.at(j) = std::make_tuple(shadowRenderQueue.at(i).light, shadowRenderQueue.at(i).currentPriority, i); enqueued = true; + break; } } if (enqueued) {