+};
+
+class MSPGLTK_API PartCache
+{
+public:
+ class Rebuild
+ {
+ private:
+ PartCache &cache;
+
+ public:
+ Rebuild(PartCache &c): cache(c) { cache.begin_rebuild(); }
+ ~Rebuild() { cache.end_rebuild(); }
+ };
+
+private:
+ bool rebuilding = false;
+ std::vector<CachedPart> parts;
+ std::vector<CachedPart>::iterator next;
+ std::vector<CachedPart>::iterator current;
+
+public:
+ void begin_rebuild();
+ void insert_special(const Part &);
+ GL::Mesh &create_mesh(const Part &, const GL::Texture2D &);
+ void end_rebuild();