From 73facb40b97bb006a408ef93b866fbc6fd14d1c3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 14 Apr 2021 14:46:05 +0300 Subject: [PATCH 1/1] Use a vector instead of a list for Sequence's steps They're not large or numerous enough to warrant a list. --- source/render/sequence.cpp | 6 +++--- source/render/sequence.h | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/source/render/sequence.cpp b/source/render/sequence.cpp index 6898e668..51b2a4f7 100644 --- a/source/render/sequence.cpp +++ b/source/render/sequence.cpp @@ -140,7 +140,7 @@ void Sequence::add_postprocessor(PostProcessor *pp, bool keep) void Sequence::setup_frame(Renderer &renderer) { - for(StepList::const_iterator i=steps.begin(); i!=steps.end(); ++i) + for(vector::const_iterator i=steps.begin(); i!=steps.end(); ++i) if(Renderable *renderable = i->get_renderable()) renderable->setup_frame(renderer); for(vector::const_iterator i=renderables.begin(); i!=renderables.end(); ++i) @@ -149,7 +149,7 @@ void Sequence::setup_frame(Renderer &renderer) void Sequence::finish_frame() { - for(StepList::const_iterator i=steps.begin(); i!=steps.end(); ++i) + for(vector::const_iterator i=steps.begin(); i!=steps.end(); ++i) if(Renderable *renderable = i->get_renderable()) renderable->finish_frame(); for(vector::const_iterator i=renderables.begin(); i!=renderables.end(); ++i) @@ -174,7 +174,7 @@ void Sequence::render(Renderer &renderer, Tag tag) const fbo.clear(); } - for(StepList::const_iterator i=steps.begin(); i!=steps.end(); ++i) + for(vector::const_iterator i=steps.begin(); i!=steps.end(); ++i) { if(const DepthTest *dt = i->get_depth_test()) dt->bind(); diff --git a/source/render/sequence.h b/source/render/sequence.h index 97d376d1..11f22a76 100644 --- a/source/render/sequence.h +++ b/source/render/sequence.h @@ -74,9 +74,7 @@ private: Slot(Renderable *); }; - typedef std::list StepList; - - StepList steps; + std::vector steps; const Camera *camera; std::vector renderables; std::vector > postproc; -- 2.45.2