From da85eb77172dbd62f764a63b45c79fc059af563b Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 12 Apr 2021 15:01:48 +0300 Subject: [PATCH] Migrate from LoadableTypeRegistry to TypeRegistry --- source/builders/pipelinetemplate.cpp | 2 +- source/builders/pipelinetemplate.h | 6 +++--- source/materials/material.cpp | 2 +- source/materials/material.h | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/builders/pipelinetemplate.cpp b/source/builders/pipelinetemplate.cpp index 81d88f31..de91450e 100644 --- a/source/builders/pipelinetemplate.cpp +++ b/source/builders/pipelinetemplate.cpp @@ -62,7 +62,7 @@ PipelineTemplate::PostProcessor::PostProcessor(GL::PostProcessor::Template *ppt) PipelineTemplate::PostProcLoader::PostProcLoader() { - get_postprocessor_registry().add_all(*this); + get_postprocessor_registry().invoke_all(*this); } diff --git a/source/builders/pipelinetemplate.h b/source/builders/pipelinetemplate.h index 177c0b14..515ebfaf 100644 --- a/source/builders/pipelinetemplate.h +++ b/source/builders/pipelinetemplate.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include "blend.h" #include "postprocessor.h" @@ -24,7 +24,7 @@ private: template struct AddPostProc { - static void add(PostProcLoader &ldr, const std::string &kw) { ldr.add(kw, &PostProcLoader::postprocessor); } + void operator()(const std::string &kw, PostProcLoader &ldr) const { ldr.add(kw, &PostProcLoader::postprocessor); } }; protected: @@ -100,7 +100,7 @@ public: typedef std::vector PostProcessorArray; private: - typedef DataFile::LoadableTypeRegistry PostProcessorRegistry; + typedef TypeRegistry PostProcessorRegistry; Resources *resources; bool hdr; diff --git a/source/materials/material.cpp b/source/materials/material.cpp index 3eaf83ab..d87f2f83 100644 --- a/source/materials/material.cpp +++ b/source/materials/material.cpp @@ -110,7 +110,7 @@ Material::GenericLoader::GenericLoader(DataFile::Collection *c): void Material::GenericLoader::init_actions() { - get_material_registry().add_all(*this); + get_material_registry().invoke_all(*this); } } // namespace GL diff --git a/source/materials/material.h b/source/materials/material.h index a04e7458..2f8f38ab 100644 --- a/source/materials/material.h +++ b/source/materials/material.h @@ -1,8 +1,8 @@ #ifndef MSP_GL_MATERIAL_H_ #define MSP_GL_MATERIAL_H_ +#include #include -#include #include #include "color.h" #include "programdata.h" @@ -64,7 +64,7 @@ public: template struct AddType { - static void add(GenericLoader &ldr, const std::string &kw) { ldr.add(kw, &GenericLoader::typed_material); } + void operator()(const std::string &kw, GenericLoader &ldr) const { ldr.add(kw, &GenericLoader::typed_material); } }; DataFile::Collection *coll; @@ -86,7 +86,7 @@ public: }; private: - typedef DataFile::LoadableTypeRegistry MaterialRegistry; + typedef TypeRegistry MaterialRegistry; protected: const Sampler *sampler; -- 2.45.2