X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmaterials%2Ftechnique.cpp;h=163cbec60f0003245631fca2f503a9cdfc0cea5c;hp=268149f8cb4bff921d9459d2e721e99235fd6257;hb=HEAD;hpb=c0b7d6ee4a7478f5aecb1504429ec1fc846d64ed diff --git a/source/materials/technique.cpp b/source/materials/technique.cpp index 268149f8..163cbec6 100644 --- a/source/materials/technique.cpp +++ b/source/materials/technique.cpp @@ -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(t, 0) -{ - set_actions(shared_actions); -} - Technique::Loader::Loader(Technique &t, Collection &c): DataFile::CollectionObjectLoader(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");