X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fmesh.cpp;h=de05102a358a5665a51b12cd0c345c21441052d5;hb=e92de029768eef5f0fd744329e589161b46d0762;hp=38642d4e26ee7459896429a03775eba3736f1700;hpb=6955c16bb123f3b795186c99442dc4d92be0ebc9;p=libs%2Fgl.git diff --git a/source/core/mesh.cpp b/source/core/mesh.cpp index 38642d4e..de05102a 100644 --- a/source/core/mesh.cpp +++ b/source/core/mesh.cpp @@ -89,7 +89,6 @@ void Mesh::check_buffers(unsigned mask) ibuf = new Buffer; if(!batches.empty()) batches.front().change_buffer(ibuf); - vtx_setup.set_index_buffer(*ibuf); dirty |= INDEX_BUFFER; #ifdef DEBUG @@ -97,6 +96,9 @@ void Mesh::check_buffers(unsigned mask) vbuf->set_debug_name(debug_name+" [IBO]"); #endif } + + if(!batches.empty()) + vtx_setup.set_index_buffer(*ibuf, batches.front().get_index_type()); } } @@ -105,7 +107,7 @@ unsigned Mesh::get_n_vertices() const return vertices.size(); } -float *Mesh::modify_vertex(unsigned i) +char *Mesh::modify_vertex(unsigned i) { if(vertices.get_format().empty()) throw invalid_operation("Mesh::modify_vertex");