X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmaterials%2Fmaterial.cpp;h=328d89a462ccd4db069499ab45ed5fe2d98d7c35;hb=1b23728908f5ec9beb08b2b70737c3903745fddc;hp=2d7e448788e0d81612bb191c7b4733b793e2c6c1;hpb=5b652353d545a3190ea2d86ba82a87b2e3382a0d;p=libs%2Fgl.git diff --git a/source/materials/material.cpp b/source/materials/material.cpp index 2d7e4487..328d89a4 100644 --- a/source/materials/material.cpp +++ b/source/materials/material.cpp @@ -3,6 +3,7 @@ #include "basicmaterial.h" #include "gl.h" #include "pbrmaterial.h" +#include "program.h" #include "resources.h" #include "uniform.h" #include "unlitmaterial.h" @@ -18,12 +19,12 @@ const Program *Material::create_compatible_shader(const map &extra_ map spec_values; fill_program_info(module_name, spec_values); - for(map::const_iterator i=extra_spec.begin(); i!=extra_spec.end(); ++i) - spec_values[i->first] = i->second; + for(const auto &kvp: extra_spec) + spec_values[kvp.first] = kvp.second; string info = module_name; - for(map::const_iterator i=spec_values.begin(); i!=spec_values.end(); ++i) - info += format(",%s:%d", i->first, i->second); + for(const auto &kvp: spec_values) + info += format(",%s:%d", kvp.first, kvp.second); Resources &res = Resources::get_global(); string name = format("_material_%016x.shader", hash64(info));