]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/material.h
Remove collection-less constructor overloads from most loaders
[libs/gl.git] / source / materials / material.h
index 4f8e23ccc972001c892bb6e37a65f9448e3f1c9d..ea02df6b1e00dad8d0dc5275399a55104c5086d5 100644 (file)
@@ -19,7 +19,6 @@ private:
        class Loader: public DataFile::CollectionObjectLoader<Material>
        {
        protected:
-               Loader(Material &);
                Loader(Material &, Collection &);
 
                virtual void init_actions();
@@ -42,7 +41,6 @@ protected:
        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 *));
@@ -67,14 +65,13 @@ public:
                        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();
 
@@ -200,10 +197,7 @@ void Material::GenericLoader::CreateMaterial<T>::operator()(const std::string &,
 
        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);
 }