X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmesh.cpp;h=572ac6195502afc97259a45857d94998c666fa4d;hb=d7e7f87d173156aa12694ce54d688c40a2eabe2e;hp=508054a521346ac45e394848fb0c7ec11f0fe799;hpb=43c6495ff3d14a85ee5de169a80fdacf13b7147e;p=libs%2Fgl.git diff --git a/source/mesh.cpp b/source/mesh.cpp index 508054a5..572ac619 100644 --- a/source/mesh.cpp +++ b/source/mesh.cpp @@ -1,6 +1,5 @@ #include "buffer.h" #include "mesh.h" -#include "nv_primitive_restart.h" #include "renderer.h" using namespace std; @@ -63,22 +62,13 @@ float *Mesh::modify_vertex(unsigned i) void Mesh::add_batch(const Batch &b) { - bool can_append = false; - if(!batches.empty()) - { - PrimitiveType type = b.get_type(); - can_append = (type==batches.back().get_type() && - type!=LINE_STRIP && type!=LINE_LOOP && type!=POLYGON && - (type!=TRIANGLE_FAN || NV_primitive_restart)); - } - if(defer_ibuf) { ibuf = new Buffer(ELEMENT_ARRAY_BUFFER); defer_ibuf = false; } - if(can_append) + if(!batches.empty() && batches.back().can_append(b.get_type())) batches.back().append(b); else {