X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Ftracktype.cpp;h=243da7fc4830c5279d782dc4d76499ccc2eb5fff;hb=d5cac397cab236ac3e1e0bbbc38204890f87d164;hp=47c85ab4dea6f85562346380ccaf86085358f1f7;hpb=f8a7788cee0261babfc4c804a58515aad6dfbc3d;p=r2c2.git diff --git a/source/3d/tracktype.cpp b/source/3d/tracktype.cpp index 47c85ab..243da7f 100644 --- a/source/3d/tracktype.cpp +++ b/source/3d/tracktype.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2010-2011 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #include #include #include @@ -95,7 +88,17 @@ TrackType3D::TrackType3D(Catalogue3D &cat3d, const TrackType &tt): if(!obj_name.empty()) { object = catalogue.get(obj_name); - // XXX border + const GL::Mesh *m = object->get_mesh(); + const GL::VertexArray &vertices = m->get_vertices(); + int vertex_offs = vertices.get_format().offset(GL::VERTEX2); + if(vertex_offs>=0) + { + for(unsigned i=0; i=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]; }