-
-template<typename T>
-void Material::GenericLoader::CreateMaterial<T>::operator()(const std::string &, GenericLoader &ldr) const
-{
- if(ldr.material)
- throw std::logic_error("Material type was already specified");
-
- 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.add_auxiliary_loader(*ldr.mat_loader);
-}
-