]> git.tdb.fi Git - libs/gl.git/blobdiff - source/builders/sequencetemplate.cpp
Allow renderables to be specified in SequenceTemplate passes
[libs/gl.git] / source / builders / sequencetemplate.cpp
index 46ffec702c300e5ae5f393abdbdabc8929525c9f..f158c630083b8e82110028c031c4edfe63bb2396 100644 (file)
@@ -5,7 +5,9 @@
 #include "bloom.h"
 #include "colorcurve.h"
 #include "lighting.h"
+#include "object.h"
 #include "resources.h"
+#include "scene.h"
 #include "sequencetemplate.h"
 #include "tests.h"
 
@@ -75,9 +77,10 @@ SequenceTemplate::Loader::Loader(SequenceTemplate &t, Collection &c):
        add("multisample", &Loader::multisample_range);
        add("postprocessor", &Loader::postprocessor);
        add("step", &Loader::step);
+       add("step", &Loader::step_with_slot);
 
        // Deprecated
-       add("pass", &Loader::step);
+       add("pass", &Loader::step_with_slot);
 
        obj.resources = &c;
 }
@@ -109,7 +112,12 @@ void SequenceTemplate::Loader::postprocessor(const string &slot)
        obj.postprocessors.push_back(pp);
 }
 
-void SequenceTemplate::Loader::step(const string &tag, const string &rend)
+void SequenceTemplate::Loader::step(const string &tag)
+{
+       step_with_slot(tag, string());
+}
+
+void SequenceTemplate::Loader::step_with_slot(const string &tag, const string &rend)
 {
        Step stp;
        stp.tag = tag;
@@ -143,6 +151,8 @@ void SequenceTemplate::Step::Loader::init()
        add("depth_test", &Loader::depth_test_predefined);
        add("lighting", &Loader::lighting);
        add("lighting", &Loader::lighting_inline);
+       add("object", &Loader::object);
+       add("scene", &Loader::scene);
 }
 
 void SequenceTemplate::Step::Loader::blend_predefined(const string &name)
@@ -196,10 +206,15 @@ void SequenceTemplate::Step::Loader::lighting(const string &name)
        obj.lighting.keep();
 }
 
-/*void SequenceTemplate::Step::Loader::scene(const string &name)
+void SequenceTemplate::Step::Loader::object(const string &name)
 {
-       obj.default_renderable = get_collection().get<Scene>(name);
-}*/
+       obj.default_renderable = &get_collection().get<GL::Object>(name);
+}
+
+void SequenceTemplate::Step::Loader::scene(const string &name)
+{
+       obj.default_renderable = &get_collection().get<Scene>(name);
+}
 
 } // namespace GL
 } // namespace Msp