X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Ftracktype.cpp;h=ab417cff171155a6c8bc4eea15b5903396b02503;hb=c984792845515b18f7b886c488c2500fd5443c8a;hp=cf33d054345f362dc393d20f1ddf09b39a647f9a;hpb=d15ac13f2e170f155b4bbd124df48400c339b644;p=r2c2.git diff --git a/source/3d/tracktype.cpp b/source/3d/tracktype.cpp index cf33d05..ab417cf 100644 --- a/source/3d/tracktype.cpp +++ b/source/3d/tracktype.cpp @@ -87,7 +87,7 @@ TrackType3D::TrackType3D(Catalogue3D &cat3d, const TrackType &tt): string obj_name = tt.get_object(); if(!obj_name.empty()) { - object = catalogue.get(obj_name); + object = &catalogue.get(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(cat.get_track_technique())); + object->set_technique(&catalogue.get(cat.get_track_technique())); } unsigned paths = tt.get_paths(); @@ -177,8 +177,10 @@ void TrackType3D::get_bounds(float angle, Vector &minp, Vector &maxp) const const GL::Mesh &TrackType3D::get_path_mesh(unsigned p) const { - if(p>=path_meshes.size() || !path_meshes[p]) - throw InvalidParameterValue("Invalid path"); + if(p>=path_meshes.size()) + throw out_of_range("TrackType3D::get_path_mesh"); + if(!path_meshes[p]) + throw invalid_argument("TrackType3D::get_path_mesh"); return *path_meshes[p]; }