X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmaterials%2Fmaterial.cpp;h=b2ee973ad11c0b8d55fc4d6ea14dabaebf31a3a8;hp=ace87e70954847d299061205826d9dacf9029919;hb=fe2fc291a4fc618425c64112c9ffd3519f0b8a3e;hpb=08d0a9f283b71e874b769b2661389b0aca598f4f diff --git a/source/materials/material.cpp b/source/materials/material.cpp index ace87e70..b2ee973a 100644 --- a/source/materials/material.cpp +++ b/source/materials/material.cpp @@ -13,7 +13,7 @@ using namespace std; namespace Msp { namespace GL { -const Program *Material::create_compatible_shader(DataFile::Collection &coll, const map &extra_spec) const +const Program *Material::create_compatible_shader(const map &extra_spec) const { string module_name; map spec_values; @@ -26,16 +26,17 @@ const Program *Material::create_compatible_shader(DataFile::Collection &coll, co for(map::const_iterator i=spec_values.begin(); i!=spec_values.end(); ++i) info += format(",%s:%d", i->first, i->second); + Resources &res = Resources::get_global(); string name = format("_material_%016x.shader", hash64(info)); - Program *shprog = coll.find(name); + Program *shprog = res.find(name); if(shprog) return shprog; - const Module &module = coll.get(module_name); + const Module &module = res.get(module_name); shprog = new Program(module, spec_values); try { - coll.add(name, shprog); + res.add(name, shprog); } catch(...) {