X-Git-Url: http://git.tdb.fi/?p=libs%2Fgltk.git;a=blobdiff_plain;f=source%2Fpartcache.cpp;fp=source%2Fpartcache.cpp;h=560db298e8edca248b42c32bbc0926f370b70e68;hp=8b425c2b0a5f255c553d91e67fcca67497c6dd0a;hb=394e5c9969a30b604bfaf78fc05a8c2d5c98ab5b;hpb=90d5f5f2ebaeb8aaa4aa47a0c2207f96758cba8c diff --git a/source/partcache.cpp b/source/partcache.cpp index 8b425c2..560db29 100644 --- a/source/partcache.cpp +++ b/source/partcache.cpp @@ -6,30 +6,6 @@ using namespace std; 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) @@ -80,7 +56,7 @@ GL::Mesh &PartCache::create_mesh(const Part &part, const GL::Texture2D &tex) { 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::TEXCOORD2, GL::COLOR4,GL::UNSIGNED_BYTE, GL::VERTEX2)); } else current->mesh->clear();