#include "bloom.h"
#include "colorcurve.h"
#include "lighting.h"
+#include "object.h"
#include "resources.h"
+#include "scene.h"
#include "sequencetemplate.h"
#include "tests.h"
namespace GL {
SequenceTemplate::SequenceTemplate():
- resources(0),
hdr(false),
alpha(false),
required_multisample(0),
delete i->postprocessor_template;
}
-Resources &SequenceTemplate::get_resources() const
-{
- if(!resources)
- throw logic_error("no resources");
- return *resources;
-}
-
SequenceTemplate::PostProcessorRegistry &SequenceTemplate::get_postprocessor_registry()
{
add("multisample", &Loader::multisample_range);
add("postprocessor", &Loader::postprocessor);
add("step", &Loader::step);
+ add("step", &Loader::step_with_slot);
// Deprecated
- add("pass", &Loader::step);
-
- obj.resources = &c;
+ add("pass", &Loader::step_with_slot);
}
void SequenceTemplate::Loader::postprocessor_loaded()
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;
stp.slot_name = rend;
if(coll)
- load_sub(stp, *coll);
+ {
+ Step::Loader ldr(stp, *coll);
+ ldr.set_inline_base_name(format("%s/%d.step", get_source(), obj.steps.size()));
+ load_sub_with(ldr);
+ }
else
load_sub(stp);
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::set_inline_base_name(const string &n)
+{
+ inline_base_name = n;
}
void SequenceTemplate::Step::Loader::blend_predefined(const string &name)
{
RefPtr<Lighting> lightn = new Lighting;
load_sub(*lightn);
- obj.lighting = lightn;
+ get_collection().add(inline_base_name+".lightn", lightn.get());
+ obj.lighting = lightn.release();
}
void SequenceTemplate::Step::Loader::lighting(const string &name)
{
obj.lighting = &get_collection().get<Lighting>(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