X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fbatch.cpp;h=d99bb95e24e53a2878143c949f5113fdfca980a5;hb=e9a898f315b5d1396f196d785913a283c30940f2;hp=d53156bd7a66c7bba1bc922e92aa07c4d190c30b;hpb=ebef7085e2672866189ccdb3a89e977e678a89b9;p=libs%2Fgl.git diff --git a/source/core/batch.cpp b/source/core/batch.cpp index d53156bd..d99bb95e 100644 --- a/source/core/batch.cpp +++ b/source/core/batch.cpp @@ -48,14 +48,12 @@ void shrink(vector &data) namespace Msp { namespace GL { -unsigned Batch::restart_index = 0; - Batch::Batch(PrimitiveType t): prim_type(t), + gl_prim_type(GL::get_gl_primitive_type(prim_type)), index_type(UNSIGNED_SHORT), gl_index_type(get_gl_type(index_type)), - max_index(0), - restart(false) + max_index(0) { } Batch::~Batch() @@ -98,8 +96,8 @@ Batch &Batch::append(const vector &ind) return *this; data.reserve(data.size()+ind.size()*get_index_size()); - for(vector::const_iterator i=ind.begin(); i!=ind.end(); ++i) - append_index(*i); + for(unsigned i: ind) + append_index(i); update_offset(); dirty = true; @@ -133,7 +131,6 @@ Batch &Batch::append(const Batch &other) ; else if(MSP_primitive_restart) { - restart = true; if(index_type==UNSIGNED_INT) ::append(data, 0xFFFFFFFF); else