void Object::Loader::technique()
{
- RefPtr<Technique> tch=new Technique;
- load_sub(*tch, get_collection());
- obj.technique=tch.release();
+ RefPtr<Technique> tech=new Technique;
+ if(coll)
+ load_sub(*tech, get_collection());
+ else
+ load_sub(*tech);
+ obj.technique=tech.release();
obj.own_technique=true;
}
}
+RenderPass::Loader::Loader(RenderPass &p):
+ DataFile::CollectionObjectLoader<RenderPass>(p, 0)
+{
+ init();
+}
+
RenderPass::Loader::Loader(RenderPass &p, Collection &c):
DataFile::CollectionObjectLoader<RenderPass>(p, &c)
+{
+ init();
+}
+
+void RenderPass::Loader::init()
{
allow_pointer_reload=false;
class Loader: public DataFile::CollectionObjectLoader<RenderPass>
{
public:
+ Loader(RenderPass &);
Loader(RenderPass &, Collection &);
private:
+ void init();
virtual void finish();
void material();
void shader(const std::string &);
}
+Technique::Loader::Loader(Technique &t):
+ DataFile::CollectionObjectLoader<Technique>(t, 0)
+{
+ init();
+}
+
Technique::Loader::Loader(Technique &t, Collection &c):
DataFile::CollectionObjectLoader<Technique>(t, &c)
+{
+ init();
+}
+
+void Technique::Loader::init()
{
add("inherit", &Loader::inherit);
add("pass", &Loader::pass);
throw KeyError("Duplicate pass name", n);
RenderPass p;
- load_sub(p, *coll);
+ if(coll)
+ load_sub(p, get_collection());
+ else
+ load_sub(p);
obj.passes.insert(PassMap::value_type(tag, p));
}
class Loader: public Msp::DataFile::CollectionObjectLoader<Technique>
{
public:
+ Loader(Technique &);
Loader(Technique &, Collection &);
private:
+ void init();
void inherit(const std::string &);
void pass(const std::string &);
};