return get_item(passes, tag);
}
+bool Technique::has_shaders() const
+{
+ for(PassMap::const_iterator i=passes.begin(); i!=passes.end(); ++i)
+ if(i->second.get_shader_program())
+ return true;
+ return false;
+}
+
Technique::Loader::Loader(Technique &t):
DataFile::CollectionObjectLoader<Technique>(t, 0)
void Technique::Loader::inherit(const string &n)
{
- obj.passes = get_collection().get<Technique>(n)->get_passes();
+ obj.passes = get_collection().get<Technique>(n).get_passes();
InheritLoader ldr(obj, get_collection());
load_sub_with(ldr);
}
void Technique::InheritLoader::texture(const std::string &slot, const string &name)
{
- Texture *tex = get_collection().get<Texture>(name);
+ Texture &tex = get_collection().get<Texture>(name);
for(PassMap::iterator i=obj.passes.begin(); i!=obj.passes.end(); ++i)
{
int index = i->second.get_texture_index(slot);
if(index<0)
continue;
- i->second.set_texture(index, tex);
+ i->second.set_texture(index, &tex);
}
}