diff options
author | Stijn Buys <ingar@osirion.org> | 2008-08-15 13:05:58 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-08-15 13:05:58 +0000 |
commit | 62de0496836e729ff955274cf153914709775bfb (patch) | |
tree | 54a868d8e4620b4dad49881af7a2614128697cbf /src/model/fragment.h | |
parent | 68fc01c7ce3f089e10a53e6dac92e2f63a9a8efd (diff) |
func_group support
Diffstat (limited to 'src/model/fragment.h')
-rw-r--r-- | src/model/fragment.h | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/model/fragment.h b/src/model/fragment.h index 0df1b79..409bb97 100644 --- a/src/model/fragment.h +++ b/src/model/fragment.h @@ -7,13 +7,15 @@ #ifndef __INCLUDED_MODEL_FRAGMENT_H__ #define __INCLUDED_MODEL_FRAGMENT_H__ +#include <list> + #include "math/vector3f.h" #include "math/color.h" namespace model { -/// a fragment of a model, a pointer into a continuues part of the VertexArray containt Tris or Quad data +/// a fragment of a model, a pointer into a continuous part of the VertexArray containing tris or quads class Fragment { public: @@ -64,6 +66,36 @@ private: unsigned int fragment_material; }; +/// a collection of fragments +/** + * a FragmentGroup contains the model fragments for one class in the .map file. + * worldspawn is a FragmentGroup + */ +class FragmentGroup +{ +public: + typedef std::list<Fragment *>::iterator iterator; + + FragmentGroup(); + ~FragmentGroup(); + + void clear(); + + inline iterator begin() { return group_fragments.begin(); } + + inline iterator end() { return group_fragments.end(); } + + inline size_t size() const { return group_fragments.size(); } + + inline void push_back(Fragment *fragment) { group_fragments.push_back(fragment); } + +private: + /// type definition for a list of model fragments + typedef std::list<Fragment *> Fragments; + + Fragments group_fragments; +}; + } #endif // __INCLUDED_MODEL_FRAGMENT_H__ |