struct CachedPart
{
- const Part *part = 0;
- const GL::Texture2D *texture = 0;
- GL::Mesh *mesh = 0;
+ const Part *part = nullptr;
+ const GL::Texture2D *texture = nullptr;
+ GL::Mesh *mesh = nullptr;
+ CachedPart() = default;
+ CachedPart(CachedPart &&);
+ CachedPart &operator=(CachedPart &&);
~CachedPart();
};
~Rebuild() { cache.end_rebuild(); }
};
- typedef std::list<CachedPart> PartList;
-
private:
bool rebuilding = false;
- PartList parts;
- PartList::iterator next;
- PartList::iterator current;
+ std::vector<CachedPart> parts;
+ std::vector<CachedPart>::iterator next;
+ std::vector<CachedPart>::iterator current;
public:
void begin_rebuild();
GL::Mesh &create_mesh(const Part &, const GL::Texture2D &);
void end_rebuild();
- const PartList &get_parts() const { return parts; }
+ const std::vector<CachedPart> &get_parts() const { return parts; }
};
} // namespace GLtk