class Technique
{
public:
- class Loader: public Msp::DataFile::Loader
+ class Loader: public Msp::DataFile::CollectionObjectLoader<Technique>
{
- public:
- typedef DataFile::Collection Collection;
-
- protected:
- Technique &tech;
- Collection &coll;
-
public:
Loader(Technique &, Collection &);
- Technique &get_object() const { return tech; }
- Collection &get_collection() const { return coll; }
private:
virtual void finish();
void material_inline();
};
private:
- std::vector<std::string> tex_names;
- std::vector<const Texture *> textures;
+ struct TextureSlot
+ {
+ std::string name;
+ const Texture *texture;
+
+ TextureSlot(): texture(0) { }
+ };
+
+ typedef std::map<Tag, ObjectPass> PassMap;
+
+ std::vector<TextureSlot> textures;
const Texture *main_texture;
- std::map<unsigned, ObjectPass> passes;
+ PassMap passes;
ObjectPass *normal_pass;
const Material *material;
bool has_pass(const GL::Tag &) const;
const ObjectPass &get_pass(const GL::Tag &) const;
- unsigned get_n_textures() const { return tex_names.size(); }
+ unsigned get_n_textures() const { return textures.size(); }
unsigned get_texture_index(const std::string &) const;
const Texture *get_texture(unsigned) const;
const Texture *get_main_texture() const { return main_texture; }