Commit c95d7b06 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke
Browse files

Instead of iterating over the render objects three times, iterate over them once.

Each of the getNum*Objects iterates over the entire renderObjects_ vector.
parent 114f4d9e
......@@ -505,9 +505,19 @@ void IRenderer::prepareRenderingPipeline(ACG::GLState* _glState, ACG::SceneGraph
// Filter for overlay, lines etc.
// ==========================================================
const size_t numRenderObjects = getNumRenderObjects(),
numOverlayObjects = getNumOverlayObjects(),
numLineObjects = getNumLineGL42Objects();
size_t numRenderObjects = 0,
numOverlayObjects = 0,
numLineObjects = 0;
for (std::vector<ACG::RenderObject>::const_iterator it = renderObjects_.begin();
it != renderObjects_.end(); ++it) {
if (!it->overlay && !(it->isDefaultLineObject() && enableLineThicknessGL42_))
numRenderObjects++;
if (it->overlay)
numOverlayObjects++;
if (enableLineThicknessGL42_ && it->isDefaultLineObject())
numLineObjects++;
}
// sort for priority
if (sortedObjects_.size() < numRenderObjects)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment