X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmaterials%2Ftechnique.cpp;h=a4d181629a122a802d8bd66509f3f01617784a88;hb=04005f74fece3c33848ed9420dc0f9c431a9f0ec;hp=a382376eb13351e2fe03d59c29eadb55bee62289;hpb=fa2b4c8a93ebad2497cacfdeaa9a2c20be486520;p=libs%2Fgl.git diff --git a/source/materials/technique.cpp b/source/materials/technique.cpp index a382376e..a4d18162 100644 --- a/source/materials/technique.cpp +++ b/source/materials/technique.cpp @@ -39,10 +39,10 @@ bool Technique::replace_texture(const string &slot, const Texture &tex) bool replaced = false; for(PassMap::iterator i=passes.begin(); i!=passes.end(); ++i) { - int index = i->second.get_texture_index(slot); - if(index>=0) + Tag tag = i->second.get_texture_tag(slot); + if(tag.id) { - i->second.set_texture(index, &tex); + i->second.set_texture(tag, &tex); replaced = true; } } @@ -102,19 +102,21 @@ bool Technique::has_shaders() const } +DataFile::Loader::ActionMap Technique::Loader::shared_actions; + Technique::Loader::Loader(Technique &t): DataFile::CollectionObjectLoader(t, 0) { - init(); + set_actions(shared_actions); } Technique::Loader::Loader(Technique &t, Collection &c): DataFile::CollectionObjectLoader(t, &c) { - init(); + set_actions(shared_actions); } -void Technique::Loader::init() +void Technique::Loader::init_actions() { add("inherit", &Loader::inherit); add("pass", &Loader::pass);