class Loader: public DataFile::CollectionObjectLoader<Material>
{
protected:
- Loader(Material &);
Loader(Material &, Collection &);
virtual void init_actions();
class PropertyLoader: public DataFile::DerivedObjectLoader<Material, Loader>
{
protected:
- PropertyLoader(C &m): DerivedObjectLoader<Material, Loader>(m) { }
PropertyLoader(C &m, Collection &c): DerivedObjectLoader<Material, Loader>(m, c) { }
void add_property(const std::string &, void (C::*)(float), void (C::*)(const Texture *));
void operator()(const std::string &, GenericLoader &) const;
};
- DataFile::Collection *coll;
+ DataFile::Collection &coll;
Material *material;
Loader *mat_loader;
static ActionMap shared_actions;
public:
- GenericLoader();
GenericLoader(DataFile::Collection &);
~GenericLoader();
T *mat = new T;
ldr.material = mat;
- if(ldr.coll)
- ldr.mat_loader = new typename T::Loader(*mat, *ldr.coll);
- else
- ldr.mat_loader = new typename T::Loader(*mat);
+ ldr.mat_loader = new typename T::Loader(*mat, ldr.coll);
ldr.add_auxiliary_loader(*ldr.mat_loader);
}