]> git.tdb.fi Git - libs/gl.git/commitdiff
Use a vector instead of a list for Sequence's steps
authorMikko Rasa <tdb@tdb.fi>
Wed, 14 Apr 2021 11:46:05 +0000 (14:46 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 14 Apr 2021 12:24:27 +0000 (15:24 +0300)
They're not large or numerous enough to warrant a list.

source/render/sequence.cpp
source/render/sequence.h

index 6898e6688f793438cd553ea73e60ea9688df4e93..51b2a4f7368181df469694b5fd3e08ca9c39e0eb 100644 (file)
@@ -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<Step>::const_iterator i=steps.begin(); i!=steps.end(); ++i)
                if(Renderable *renderable = i->get_renderable())
                        renderable->setup_frame(renderer);
        for(vector<Slot>::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<Step>::const_iterator i=steps.begin(); i!=steps.end(); ++i)
                if(Renderable *renderable = i->get_renderable())
                        renderable->finish_frame();
        for(vector<Slot>::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<Step>::const_iterator i=steps.begin(); i!=steps.end(); ++i)
        {
                if(const DepthTest *dt = i->get_depth_test())
                        dt->bind();
index 97d376d112100e68903c23dce25bfae96977253c..11f22a76f9326cbf76c9868eb83157954261e2cd 100644 (file)
@@ -74,9 +74,7 @@ private:
                Slot(Renderable *);
        };
 
-       typedef std::list<Step> StepList;
-
-       StepList steps;
+       std::vector<Step> steps;
        const Camera *camera;
        std::vector<Slot> renderables;
        std::vector<RefPtr<PostProcessor> > postproc;