From 7ab8bc0724f40b46d7f5da1bcb05ab6d0cecbb43 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 11 Mar 2022 11:24:39 +0200 Subject: [PATCH] Support specifying enabled methods in effect templates --- source/effects/effect.cpp | 15 +++++++++++++++ source/effects/effect.h | 5 +++++ source/effects/environmentmap.cpp | 2 ++ source/effects/shadowmap.cpp | 2 ++ source/effects/sky.cpp | 6 +++++- 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/source/effects/effect.cpp b/source/effects/effect.cpp index 878e23fb..0ead01c3 100644 --- a/source/effects/effect.cpp +++ b/source/effects/effect.cpp @@ -1,6 +1,8 @@ #include #include "effect.h" +using namespace std; + namespace Msp { namespace GL { @@ -31,6 +33,13 @@ bool Effect::is_enabled_for_method(Tag tag) const } +void Effect::Template::create_base(Effect &effect) const +{ + for(Tag m: enabled_methods) + effect.enable_for_method(m); +} + + Effect::Template::Loader::Loader(Template &t, Collection &c): CollectionObjectLoader