]> git.tdb.fi Git - libs/gl.git/blobdiff - source/mesh.cpp
Style update: add spaces around assignment operators
[libs/gl.git] / source / mesh.cpp
index 2ca040e6feb68e3eb65239a4c05e4eadfd997053..d421769abc257a775d53a4b0c73909cd92c36abb 100644 (file)
@@ -29,14 +29,14 @@ void Mesh::use_vertex_buffer(bool b)
        {
                vertices.use_vertex_buffer();
                if(!ibuf)
-                       ibuf=new Buffer(ELEMENT_ARRAY_BUFFER);
+                       ibuf = new Buffer(ELEMENT_ARRAY_BUFFER);
                update_index_buffer();
        }
        else
        {
                vertices.use_vertex_buffer(0);
                delete ibuf;
-               ibuf=0;
+               ibuf = 0;
        }
 }
 
@@ -63,11 +63,11 @@ void Mesh::draw() const
        if(ibuf)
        {
                ibuf->bind();
-               unsigned offset=0;
+               unsigned offset = 0;
                for(list<Batch>::const_iterator i=batches.begin(); i!=batches.end(); ++i)
                {
                        i->draw_with_buffer(offset);
-                       offset+=i->size();
+                       offset += i->size();
                }
                ibuf->unbind();
        }
@@ -83,16 +83,16 @@ void Mesh::update_index_buffer()
        if(!ibuf)
                return;
 
-       unsigned total=0;
+       unsigned total = 0;
        for(list<Batch>::const_iterator i=batches.begin(); i!=batches.end(); ++i)
-               total+=i->size();
+               total += i->size();
 
        ibuf->data(total*sizeof(unsigned), 0);
-       unsigned offset=0;
+       unsigned offset = 0;
        for(list<Batch>::const_iterator i=batches.begin(); i!=batches.end(); ++i)
        {
                ibuf->sub_data(offset*sizeof(unsigned), i->size()*sizeof(unsigned), &i->get_indices()[0]);
-               offset+=i->size();
+               offset += i->size();
        }
        ibuf->unbind();
 }