]> git.tdb.fi Git - libs/gl.git/commitdiff
Use shared actions in SequenceTemplate loaders
authorMikko Rasa <tdb@tdb.fi>
Tue, 19 Oct 2021 09:46:39 +0000 (12:46 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 19 Oct 2021 11:52:34 +0000 (14:52 +0300)
source/builders/sequencetemplate.cpp
source/builders/sequencetemplate.h

index a768d6bd8bc39ddca833735d7c248198631c9c98..03c8c7fe1cafa0b26f3fc20e37080e94c8fafe0a 100644 (file)
@@ -43,8 +43,15 @@ SequenceTemplate::PostProcessor::PostProcessor(GL::PostProcessor::Template *ppt)
 { }
 
 
+DataFile::Loader::ActionMap SequenceTemplate::Loader::shared_actions;
+
 SequenceTemplate::Loader::Loader(SequenceTemplate &t, Collection &c):
        CollectionObjectLoader<SequenceTemplate>(t, &c)
+{
+       set_actions(shared_actions);
+}
+
+void SequenceTemplate::Loader::init_actions()
 {
        add("hdr", &SequenceTemplate::hdr);
        add("alpha", &SequenceTemplate::alpha);
@@ -120,8 +127,15 @@ void SequenceTemplate::Loader::step(const string &tag, const string &rend)
 }
 
 
+DataFile::Loader::ActionMap SequenceTemplate::ClearLoader::shared_actions;
+
 SequenceTemplate::ClearLoader::ClearLoader(SequenceTemplate &t):
        ObjectLoader<SequenceTemplate>(t)
+{
+       set_actions(shared_actions);
+}
+
+void SequenceTemplate::ClearLoader::init_actions()
 {
        add("color", &ClearLoader::color);
        add("depth", &ClearLoader::depth);
@@ -144,8 +158,15 @@ void SequenceTemplate::ClearLoader::stencil(int s)
 }
 
 
+DataFile::Loader::ActionMap SequenceTemplate::Step::Loader::shared_actions;
+
 SequenceTemplate::Step::Loader::Loader(Step &p, Collection &c):
        DataFile::CollectionObjectLoader<Step>(p, &c)
+{
+       set_actions(shared_actions);
+}
+
+void SequenceTemplate::Step::Loader::init_actions()
 {
        add("depth_test", &Loader::depth_test);
        add("depth_test", &Loader::depth_compare);
index 6b943dd1499f962bea05968643a936d01e16a8f9..3f4b86b956d3499ee1020a96595cbf78818db106 100644 (file)
@@ -38,10 +38,14 @@ private:
 public:
        class Loader: public DataFile::CollectionObjectLoader<SequenceTemplate>
        {
+       private:
+               static ActionMap shared_actions;
+
        public:
                Loader(SequenceTemplate &, Collection &);
-
        private:
+               virtual void init_actions();
+
                void clear();
                void multisample(unsigned);
                void multisample_range(unsigned, unsigned);
@@ -65,9 +69,14 @@ public:
                private:
                        std::string inline_base_name;
 
+                       static ActionMap shared_actions;
+
                public:
                        Loader(Step &, Collection &);
+               private:
+                       virtual void init_actions();
 
+               public:
                        void set_inline_base_name(const std::string &);
 
                private:
@@ -96,10 +105,14 @@ public:
 private:
        class ClearLoader: public DataFile::ObjectLoader<SequenceTemplate>
        {
+       private:
+               static ActionMap shared_actions;
+
        public:
                ClearLoader(SequenceTemplate &);
-
        private:
+               virtual void init_actions();
+
                void color(float, float, float, float);
                void depth(float);
                void stencil(int);