};
template<typename C>
- class LoaderBase: public DataFile::CollectionObjectLoader<Material>
+ class PropertyLoader: public DataFile::CollectionObjectLoader<Material>
{
protected:
- LoaderBase(C &m): CollectionObjectLoader<Material>(m, 0) { }
- LoaderBase(C &m, Collection &c): CollectionObjectLoader<Material>(m, &c) { }
+ PropertyLoader(C &m): CollectionObjectLoader<Material, Loader>(m, 0) { }
+ PropertyLoader(C &m, Collection &c): CollectionObjectLoader<Material, Loader>(m, c) { }
void add_property(const std::string &, void (C::*)(float), void (C::*)(const Texture *));
void add_property(const std::string &, void (C::*)(const Color &), void (C::*)(const Texture *), bool);
template<typename C>
-void Material::LoaderBase<C>::add_property(const std::string &kw, void (C::*set_value)(float), void (C::*set_texture)(const Texture *))
+void Material::PropertyLoader<C>::add_property(const std::string &kw, void (C::*set_value)(float), void (C::*set_texture)(const Texture *))
{
- add(kw, &LoaderBase<C>::property_value_scalar, set_value);
- add(kw+"_map", &LoaderBase<C>::property_texture, set_texture);
+ add(kw, &PropertyLoader<C>::property_value_scalar, set_value);
+ add(kw+"_map", &PropertyLoader<C>::property_texture, set_texture);
}
template<typename C>
-void Material::LoaderBase<C>::add_property(const std::string &kw, void (C::*set_value)(const Color &), void (C::*set_texture)(const Texture *), bool allow_alpha)
+void Material::PropertyLoader<C>::add_property(const std::string &kw, void (C::*set_value)(const Color &), void (C::*set_texture)(const Texture *), bool allow_alpha)
{
- add(kw, &LoaderBase<C>::property_value_rgb, set_value);
- add(kw+"_srgb", &LoaderBase<C>::property_value_srgb, set_value);
+ add(kw, &PropertyLoader<C>::property_value_rgb, set_value);
+ add(kw+"_srgb", &PropertyLoader<C>::property_value_srgb, set_value);
if(allow_alpha)
{
- add(kw, &LoaderBase<C>::property_value_rgba, set_value);
- add(kw+"_srgb", &LoaderBase<C>::property_value_srgb_alpha, set_value);
+ add(kw, &PropertyLoader<C>::property_value_rgba, set_value);
+ add(kw+"_srgb", &PropertyLoader<C>::property_value_srgb_alpha, set_value);
}
- add(kw+"_map", &LoaderBase<C>::property_texture, set_texture);
+ add(kw+"_map", &PropertyLoader<C>::property_texture, set_texture);
}
template<typename C>
-void Material::LoaderBase<C>::add_property(const std::string &kw, void (C::*set_texture)(const Texture *))
+void Material::PropertyLoader<C>::add_property(const std::string &kw, void (C::*set_texture)(const Texture *))
{
- add(kw+"_map", &LoaderBase<C>::property_texture, set_texture);
+ add(kw+"_map", &PropertyLoader<C>::property_texture, set_texture);
}
template<typename C>
-void Material::LoaderBase<C>::property_value_scalar(void (C::*set_value)(float), float value)
+void Material::PropertyLoader<C>::property_value_scalar(void (C::*set_value)(float), float value)
{
(static_cast<C &>(obj).*set_value)(value);
}
template<typename C>
-void Material::LoaderBase<C>::property_value_rgb(void (C::*set_value)(const Color &), float r, float g, float b)
+void Material::PropertyLoader<C>::property_value_rgb(void (C::*set_value)(const Color &), float r, float g, float b)
{
(static_cast<C &>(obj).*set_value)(Color(r, g, b));
}
template<typename C>
-void Material::LoaderBase<C>::property_value_rgba(void (C::*set_value)(const Color &), float r, float g, float b, float a)
+void Material::PropertyLoader<C>::property_value_rgba(void (C::*set_value)(const Color &), float r, float g, float b, float a)
{
(static_cast<C &>(obj).*set_value)(Color(r, g, b, a));
}
template<typename C>
-void Material::LoaderBase<C>::property_value_srgb(void (C::*set_value)(const Color &), float r, float g, float b)
+void Material::PropertyLoader<C>::property_value_srgb(void (C::*set_value)(const Color &), float r, float g, float b)
{
(static_cast<C &>(obj).*set_value)(Color(r, g, b).to_linear());
}
template<typename C>
-void Material::LoaderBase<C>::property_value_srgb_alpha(void (C::*set_value)(const Color &), float r, float g, float b, float a)
+void Material::PropertyLoader<C>::property_value_srgb_alpha(void (C::*set_value)(const Color &), float r, float g, float b, float a)
{
(static_cast<C &>(obj).*set_value)(Color(r, g, b, a).to_linear());
}
template<typename C>
-void Material::LoaderBase<C>::property_texture(void (C::*set_texture)(const Texture *), const std::string &name)
+void Material::PropertyLoader<C>::property_texture(void (C::*set_texture)(const Texture *), const std::string &name)
{
/* The static_cast around get_collection is needed because otherwise Android
SDK's g++ 4.9 fails to parse get<Texture> as a template function call */