]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/technique.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / materials / technique.cpp
index 268149f8cb4bff921d9459d2e721e99235fd6257..163cbec60f0003245631fca2f503a9cdfc0cea5c 100644 (file)
@@ -79,7 +79,10 @@ bool Technique::replace_uniforms(const ProgramData &shdata)
                                continue;
 
                        if(!new_shdata)
-                               new_shdata = new ProgramData(*kvp.second.get_shader_data());
+                       {
+                               new_shdata = new ProgramData;
+                               new_shdata->copy_uniforms(*kvp.second.get_shader_data());
+                       }
 
                        new_shdata->copy_uniform(shdata, tag);
                        replaced = true;
@@ -105,12 +108,6 @@ void Technique::set_debug_name(const string &name)
 
 DataFile::Loader::ActionMap Technique::Loader::shared_actions;
 
-Technique::Loader::Loader(Technique &t):
-       DataFile::CollectionObjectLoader<Technique>(t, 0)
-{
-       set_actions(shared_actions);
-}
-
 Technique::Loader::Loader(Technique &t, Collection &c):
        DataFile::CollectionObjectLoader<Technique>(t, &c)
 {
@@ -138,14 +135,9 @@ void Technique::Loader::inherit(const string &n)
 void Technique::Loader::method(const string &n)
 {
        RenderMethod p;
-       if(coll)
-       {
-               RenderMethod::Loader ldr(p, get_collection());
-               ldr.set_inline_base_name(format("%s/%s.method", (inline_base_name.empty() ? FS::basename(get_source()) : inline_base_name), n));
-               load_sub_with(ldr);
-       }
-       else
-               load_sub(p);
+       RenderMethod::Loader ldr(p, get_collection());
+       ldr.set_inline_base_name(format("%s/%s.method", (inline_base_name.empty() ? FS::basename(get_source()) : inline_base_name), n));
+       load_sub_with(ldr);
 
        if(!p.get_shader_program())
                throw logic_error("no shader program in method");