storage(f);
}
+Mesh::Mesh(Mesh &&other):
+ Resource(move(other)),
+ vertices(move(other.vertices)),
+ batches(move(other.batches)),
+ vbuf(other.vbuf),
+ ibuf(other.ibuf),
+ vtx_setup(move(other.vtx_setup)),
+ dirty(other.dirty),
+ disallow_rendering(other.disallow_rendering),
+ face_winding(other.face_winding),
+ debug_name(move(other.debug_name))
+{
+ other.vbuf = 0;
+ other.ibuf = 0;
+}
+
Mesh::~Mesh()
{
set_manager(0);
return vertices.modify(i);
}
-void Mesh::add_batch(const Batch &b)
+void Mesh::add_batch(Batch &&b)
{
if(batches.empty())
{
- batches.push_back(b);
+ batches.emplace_back(move(b));
if(ibuf)
batches.back().use_buffer(ibuf);
}
}
Batch *prev = &batches.back();
- batches.push_back(b);
+ batches.emplace_back(move(b));
if(reallocate)
{
prev = 0;
{
Batch btc(p);
load_sub(btc);
- obj.add_batch(btc);
+ obj.add_batch(move(btc));
}