namespace Msp {
namespace GLtk {
-CachedPart::CachedPart(CachedPart &&other):
- part(other.part),
- texture(other.texture),
- mesh(other.mesh)
-{
- other.mesh = nullptr;
-}
-
-CachedPart &CachedPart::operator=(CachedPart &&other)
-{
- delete mesh;
- part = other.part;
- texture = other.texture;
- mesh = other.mesh;
- other.mesh = nullptr;
- return *this;
-}
-
-CachedPart::~CachedPart()
-{
- delete mesh;
-}
-
-
void PartCache::begin_rebuild()
{
if(rebuilding)
{
current = parts.insert(next, CachedPart());
current->texture = &tex;
- current->mesh = new GL::Mesh((GL::TEXCOORD2, GL::COLOR4,GL::UNSIGNED_BYTE, GL::VERTEX2));
+ current->mesh = make_unique<GL::Mesh>((GL::TEXCOORD2, GL::COLOR4,GL::UNSIGNED_BYTE, GL::VERTEX2));
}
else
current->mesh->clear();