X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmaterials%2Funlitmaterial.cpp;h=e1979051672481f277b953253589e88925c23716;hp=e81be8ae136c3b8a915ef3b440b4c6946ffd5cb0;hb=HEAD;hpb=2bf5645d38492c5ef829478f3e04e78f31802fe6 diff --git a/source/materials/unlitmaterial.cpp b/source/materials/unlitmaterial.cpp index e81be8ae..e1979051 100644 --- a/source/materials/unlitmaterial.cpp +++ b/source/materials/unlitmaterial.cpp @@ -5,9 +5,13 @@ using namespace std; namespace Msp { namespace GL { -UnlitMaterial::UnlitMaterial(): - texture(0), - vertex_color(false) +const Tag UnlitMaterial::texture_tags[] = +{ + Tag("color_tex"), + Tag() +}; + +UnlitMaterial::UnlitMaterial() { set_color(Color(1.0f)); } @@ -19,9 +23,12 @@ void UnlitMaterial::fill_program_info(string &module_name, map &spe spec_values["use_vertex_color"] = vertex_color; } -void UnlitMaterial::attach_textures_to(Texturing &texturing, ProgramData &tex_shdata) const +const Texture *UnlitMaterial::get_texture(Tag tag) const { - attach_texture_to(texture, texturing, tex_shdata, "color_tex"); + if(tag==texture_tags[0]) + return texture; + else + return 0; } void UnlitMaterial::set_texture(const Texture *tex) @@ -43,12 +50,6 @@ void UnlitMaterial::set_vertex_color(bool vc) DataFile::Loader::ActionMap UnlitMaterial::Loader::shared_actions; -UnlitMaterial::Loader::Loader(UnlitMaterial &m): - DerivedObjectLoader >(m) -{ - set_actions(shared_actions); -} - UnlitMaterial::Loader::Loader(UnlitMaterial &m, Collection &c): DerivedObjectLoader >(m, c) {