]> git.tdb.fi Git - libs/gl.git/blobdiff - source/vertexarray.cpp
Style update: add spaces around assignment operators
[libs/gl.git] / source / vertexarray.cpp
index c6724e13a27f05d1c509ac189d379fe3f392c2e6..8381d8adb1d9663b742db5a88af857f988b6bfd0 100644 (file)
@@ -35,8 +35,8 @@ void VertexArray::use_vertex_buffer()
        if(vbuf && own_vbuf)
                return;
 
-       vbuf=new Buffer(ARRAY_BUFFER);
-       own_vbuf=true;
+       vbuf = new Buffer(ARRAY_BUFFER);
+       own_vbuf = true;
 
        update_data();
 }
@@ -45,8 +45,8 @@ void VertexArray::use_vertex_buffer(Buffer *b)
 {
        if(own_vbuf)
                delete vbuf;
-       vbuf=b;
-       own_vbuf=false;
+       vbuf = b;
+       own_vbuf = false;
 
        update_data();
 }
@@ -64,12 +64,12 @@ void VertexArray::clear()
 void VertexArray::reset(const VertexFormat &f)
 {
        clear();
-       format=f;
-       stride=get_stride(format);
+       format = f;
+       stride = get_stride(format);
 
-       bool has_gen_attrs=false;
+       bool has_gen_attrs = false;
        for(const unsigned char *c=format.begin(); (!has_gen_attrs && c!=format.end()); ++c)
-               has_gen_attrs=(*c>=ATTRIB1);
+               has_gen_attrs = (*c>=ATTRIB1);
        if(has_gen_attrs)
                static RequireExtension _ext("GL_ARB_vertex_program");
 }
@@ -82,14 +82,14 @@ void VertexArray::apply() const
        if(vbuf)
                vbuf->bind();
 
-       const float *base=vbuf?0:&data[0];
-       unsigned offset=0;
-       unsigned found=0;
-       unsigned bpv=stride*sizeof(float);
+       const float *base = vbuf?0:&data[0];
+       unsigned offset = 0;
+       unsigned found = 0;
+       unsigned bpv = stride*sizeof(float);
        for(const unsigned char *c=format.begin(); c!=format.end(); ++c)
        {
-               unsigned sz=(*c&3)+1;
-               unsigned t=*c>>2;
+               unsigned sz = (*c&3)+1;
+               unsigned t = *c>>2;
                switch(t)
                {
                case 0:
@@ -111,8 +111,8 @@ void VertexArray::apply() const
                        glVertexAttribPointerARB(t-4, sz, GL_FLOAT, false, bpv, base+offset);
                        break;
                }
-               found|=1<<t;
-               offset+=sz;
+               found |= 1<<t;
+               offset += sz;
        }
 
        set_array(GL_VERTEX_ARRAY, found&1, 1);
@@ -152,7 +152,7 @@ void VertexArray::set_array(unsigned array, bool en, unsigned mask) const
                        glDisableClientState(array);
                else
                        glDisableVertexAttribArrayARB(array);
-               enabled_arrays&=~mask;
+               enabled_arrays &= ~mask;
        }
        else if(!(enabled_arrays&mask) && en)
        {
@@ -160,11 +160,11 @@ void VertexArray::set_array(unsigned array, bool en, unsigned mask) const
                        glEnableClientState(array);
                else
                        glEnableVertexAttribArrayARB(array);
-               enabled_arrays|=mask;
+               enabled_arrays |= mask;
        }
 }
 
-unsigned VertexArray::enabled_arrays=0;
+unsigned VertexArray::enabled_arrays = 0;
 
 
 VertexArray::Loader::Loader(VertexArray &a):