]> git.tdb.fi Git - r2c2.git/commitdiff
Collection::get now returns a reference
authorMikko Rasa <tdb@tdb.fi>
Thu, 17 Jan 2013 12:31:23 +0000 (14:31 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 17 Jan 2013 12:31:23 +0000 (14:31 +0200)
source/3d/tracktype.cpp
source/3d/vehicletype.cpp

index 243da7fc4830c5279d782dc4d76499ccc2eb5fff..ab417cff171155a6c8bc4eea15b5903396b02503 100644 (file)
@@ -87,7 +87,7 @@ TrackType3D::TrackType3D(Catalogue3D &cat3d, const TrackType &tt):
        string obj_name = tt.get_object();
        if(!obj_name.empty())
        {
-               object = catalogue.get<GL::Object>(obj_name);
+               object = &catalogue.get<GL::Object>(obj_name);
                const GL::Mesh *m = object->get_mesh();
                const GL::VertexArray &vertices = m->get_vertices();
                int vertex_offs = vertices.get_format().offset(GL::VERTEX2);
@@ -120,7 +120,7 @@ TrackType3D::TrackType3D(Catalogue3D &cat3d, const TrackType &tt):
 
                object = new GL::Object;
                object->set_mesh(mesh);
-               object->set_technique(catalogue.get<GL::Technique>(cat.get_track_technique()));
+               object->set_technique(&catalogue.get<GL::Technique>(cat.get_track_technique()));
        }
  
        unsigned paths = tt.get_paths();
index 427c29fe91664aa98030487f19d299128531a187..a2f4a34415ef1954e1bdd30910123c4d235e2764 100644 (file)
@@ -137,7 +137,7 @@ GL::Object *VehicleType3D::get_object(const string &name)
                        }
                }
                else
-                       return catalogue.get<GL::Object>(name);
+                       return &catalogue.get<GL::Object>(name);
        }
        return ptr;
 }