- if(eqsign!=string::npos)
- {
- obj.textures.push_back(&coll.get<Texture>(n.substr(eqsign+1)));
- textures.push_back(n.substr(0, eqsign));
- }
- else
- {
- obj.textures.push_back(&coll.get<Texture>(n));
- textures.push_back(n);
- }
+ if(eqsign==string::npos)
+ throw InvalidParameterValue("Must specify texture slot name");
+
+ obj.textures[obj.technique->get_texture_index(n.substr(0, eqsign))]=coll.get<Texture>(n.substr(eqsign+1));
+}
+
+void Object::Loader::technique(const string &n)
+{
+ obj.technique=coll.get<Technique>(n);
+ obj.textures.resize(obj.technique->get_n_textures());
+ obj.material=obj.technique->get_material();
+}
+
+void Object::Loader::texture(const string &n)
+{
+ if(obj.main_texture)
+ throw Exception("Only one main texture may be specified");
+
+ Texture *tex=coll.get<Texture>(n);
+ if(obj.technique)
+ obj.textures[obj.technique->get_texture_index("texture")]=tex;
+ obj.main_texture=tex;