1 #include "unlitmaterial.h"
8 const Tag UnlitMaterial::texture_tags[] =
14 UnlitMaterial::UnlitMaterial():
18 set_color(Color(1.0f));
21 void UnlitMaterial::fill_program_info(string &module_name, map<string, int> &spec_values) const
23 module_name = "unlit.glsl";
24 spec_values["use_texture"] = (texture!=0);
25 spec_values["use_vertex_color"] = vertex_color;
28 const Texture *UnlitMaterial::get_texture(Tag tag) const
30 if(tag==texture_tags[0])
36 void UnlitMaterial::set_texture(const Texture *tex)
41 void UnlitMaterial::set_color(const Color &c)
44 shdata.uniform("unlit_material.color", color);
47 void UnlitMaterial::set_vertex_color(bool vc)
53 DataFile::Loader::ActionMap UnlitMaterial::Loader::shared_actions;
55 UnlitMaterial::Loader::Loader(UnlitMaterial &m):
56 DerivedObjectLoader<UnlitMaterial, Material::PropertyLoader<UnlitMaterial> >(m)
58 set_actions(shared_actions);
61 UnlitMaterial::Loader::Loader(UnlitMaterial &m, Collection &c):
62 DerivedObjectLoader<UnlitMaterial, Material::PropertyLoader<UnlitMaterial> >(m, c)
64 set_actions(shared_actions);
67 void UnlitMaterial::Loader::init_actions()
69 Material::PropertyLoader<UnlitMaterial>::init_actions();
70 add("texture", &Loader::property_texture, &UnlitMaterial::set_texture);
71 add_property("color", &UnlitMaterial::set_color, 0, true);
72 add("vertex_color", &UnlitMaterial::vertex_color);