]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/batch.cpp
Use C++11 features with containers
[libs/gl.git] / source / core / batch.cpp
index d53156bd7a66c7bba1bc922e92aa07c4d190c30b..d99bb95e24e53a2878143c949f5113fdfca980a5 100644 (file)
@@ -48,14 +48,12 @@ void shrink(vector<Msp::UInt8> &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<unsigned> &ind)
                return *this;
 
        data.reserve(data.size()+ind.size()*get_index_size());
-       for(vector<unsigned>::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<UInt32>(data, 0xFFFFFFFF);
                else