]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/object.cpp
Mark constant data as const
[libs/gl.git] / source / render / object.cpp
index 067686d205cee62f8b117ce429c75f58c2e1b21a..479e77afa986ac124137a4726717d055af56910a 100644 (file)
@@ -17,7 +17,7 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
-Matrix Object::identity_matrix;
+const Matrix Object::identity_matrix;
 
 Object::Object():
        lods(1),
@@ -76,12 +76,12 @@ void Object::set_mesh(unsigned i, const Mesh *m)
 void Object::update_bounding_sphere()
 {
        vector<Vector3> points;
-       for(vector<LevelOfDetail>::const_iterator i=lods.begin(); i!=lods.end(); ++i)
+       for(const LevelOfDetail &l: lods)
        {
-               if(!i->mesh || !i->mesh->is_loaded())
+               if(!l.mesh || !l.mesh->is_loaded())
                        continue;
 
-               const VertexArray &vertices = i->mesh->get_vertices();
+               const VertexArray &vertices = l.mesh->get_vertices();
 
                int offset = vertices.get_format().offset(VERTEX3);
                bool three = true;