{
const vector<SequenceTemplate::Step> &steps = tmpl.get_steps();
for(vector<SequenceTemplate::Step>::const_iterator i=steps.begin(); i!=steps.end(); ++i)
- renderables[i->slot_name] = 0;
+ renderables[i->slot_name] = i->default_renderable;
const vector<SequenceTemplate::PostProcessor> &postprocs = tmpl.get_postprocessors();
for(SequenceTemplate::PostProcessorArray::const_iterator i=postprocs.begin(); i!=postprocs.end(); ++i)
if(!i->slot_name.empty())
#include "bloom.h"
#include "colorcurve.h"
#include "lighting.h"
+#include "object.h"
#include "resources.h"
+#include "scene.h"
#include "sequencetemplate.h"
#include "tests.h"
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;
}
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;
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)
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
class DepthTest;
class Lighting;
+class Renderable;
class SequenceTemplate
{
void multisample(unsigned);
void multisample_range(unsigned, unsigned);
void postprocessor(const std::string &);
- void step(const std::string &, const std::string &);
+ void step(const std::string &);
+ void step_with_slot(const std::string &, const std::string &);
};
struct Step
void depth_test_predefined(const std::string &);
void lighting(const std::string &);
void lighting_inline();
- // TODO requires support for scenes in Resources
- //void scene(const std::string &);
+ void object(const std::string &);
+ void scene(const std::string &);
};
std::string tag;
RefPtr<const DepthTest> depth_test;
RefPtr<const Blend> blend;
std::string slot_name;
- //Renderable *default_renderable;
+ Renderable *default_renderable;
~Step();
};