From fd75f65f5bfbf9593449b6d505875e6f83597e52 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 19 Oct 2021 12:46:39 +0300 Subject: [PATCH] Use shared actions in SequenceTemplate loaders --- source/builders/sequencetemplate.cpp | 21 +++++++++++++++++++++ source/builders/sequencetemplate.h | 17 +++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/source/builders/sequencetemplate.cpp b/source/builders/sequencetemplate.cpp index a768d6bd..03c8c7fe 100644 --- a/source/builders/sequencetemplate.cpp +++ b/source/builders/sequencetemplate.cpp @@ -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(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(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(p, &c) +{ + set_actions(shared_actions); +} + +void SequenceTemplate::Step::Loader::init_actions() { add("depth_test", &Loader::depth_test); add("depth_test", &Loader::depth_compare); diff --git a/source/builders/sequencetemplate.h b/source/builders/sequencetemplate.h index 6b943dd1..3f4b86b9 100644 --- a/source/builders/sequencetemplate.h +++ b/source/builders/sequencetemplate.h @@ -38,10 +38,14 @@ private: public: class Loader: public DataFile::CollectionObjectLoader { + 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 { + 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); -- 2.45.2