X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftechnique.h;h=3bb347ea4c98b9bb535cf132ec68dbb429383b4c;hb=927a1aa0a3a27e463ec0efc08bd08e7c4e969909;hp=711db79dce2af54f4adb45e411caf3b82acd2b50;hpb=5658c6ea1a5caf1b408366cebf785f79d650ff53;p=libs%2Fgl.git diff --git a/source/technique.h b/source/technique.h index 711db79d..3bb347ea 100644 --- a/source/technique.h +++ b/source/technique.h @@ -25,20 +25,11 @@ slots which Objects must override. class Technique { public: - class Loader: public Msp::DataFile::Loader + class Loader: public Msp::DataFile::CollectionObjectLoader { - 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(); @@ -50,10 +41,19 @@ public: }; private: - std::vector tex_names; - std::vector textures; + struct TextureSlot + { + std::string name; + const Texture *texture; + + TextureSlot(): texture(0) { } + }; + + typedef std::map PassMap; + + std::vector textures; const Texture *main_texture; - std::map passes; + PassMap passes; ObjectPass *normal_pass; const Material *material; @@ -63,7 +63,7 @@ public: 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; }