]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/rendermethod.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / materials / rendermethod.cpp
index 5c838ef945624629483ea2fff992b1564285137a..78b937d017f40ae069ff0900082ca4675900dae1 100644 (file)
@@ -34,6 +34,8 @@ void RenderMethod::maybe_create_material_shader()
                extra_spec["use_shadow_map"] = true;
        if(image_based_lighting)
                extra_spec["use_image_based_lighting"] = true;
+       if(instancing)
+               extra_spec["use_instancing"] = true;
 
        shprog = material->create_compatible_shader(extra_spec);
 
@@ -81,7 +83,7 @@ void RenderMethod::set_texture(Tag tag, const Texture *tex, const Sampler *samp)
        auto i = find_member(textures, tag, &TextureSlot::tag);
        if(i==textures.end())
        {
-               textures.push_back(TextureSlot(tag));
+               textures.emplace_back(tag);
                i = textures.end()-1;
        }
        i->texture = tex;
@@ -152,8 +154,9 @@ void RenderMethod::Loader::init_actions()
        add("blend", &Loader::blend);
        add("blend", &Loader::blend_factors);
        add("face_cull", &RenderMethod::face_cull);
-       add("shader",   &Loader::shader);
+       add("shader", &Loader::shader);
        add("image_based_lighting", &RenderMethod::image_based_lighting);
+       add("instancing", &RenderMethod::instancing);
        add("material", &Loader::material_inline);
        add("material", &Loader::material);
        add("material_slot", &RenderMethod::material_slot);
@@ -216,7 +219,7 @@ void RenderMethod::Loader::texture(const string &n)
        auto i = find_member(obj.textures, Tag(n), &TextureSlot::tag);
        if(i==obj.textures.end())
        {
-               obj.textures.push_back(TextureSlot(n));
+               obj.textures.emplace_back(n);
                i = obj.textures.end()-1;
        }
        TextureSlot::Loader ldr(*i, n, coll);