]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/path.cpp
Streamline various block-related algorithms
[r2c2.git] / source / 3d / path.cpp
index 1a1a16ba92902f3fcd0db9f41deae4f6243d20d2..fe4a2467b57df59c64e9d3aea9f4396af922eccb 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of R²C²
-Copyright © 2010-2011  Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
 #include <msp/gl/matrix.h>
 #include <msp/gl/renderer.h>
 #include "libr2c2/tracktype.h"
@@ -13,6 +6,7 @@ Distributed under the GPL
 #include "track.h"
 #include "tracktype.h"
 
+using namespace std;
 using namespace Msp;
 
 namespace R2C2 {
@@ -39,7 +33,7 @@ void Path3D::set_automatic()
 void Path3D::set_path(unsigned p)
 {
        if(!(track.get_track().get_type().get_paths()&(1<<p)))
-               throw InvalidParameterValue("Invalid path");
+               throw invalid_argument("Path3D::set_path");
        automatic = false;
        paths = 1<<p;
 }
@@ -47,7 +41,7 @@ void Path3D::set_path(unsigned p)
 void Path3D::set_mask(unsigned p)
 {
        if(p&~track.get_track().get_type().get_paths())
-               throw InvalidParameterValue("Invalid path mask");
+               throw invalid_argument("Path3D::set_mask");
        automatic = false;
        paths = p;
 }
@@ -77,7 +71,7 @@ void Path3D::render(GL::Renderer &renderer, const GL::Tag &tag) const
                        return;
 
                GL::MatrixStack::Push push_mtx(renderer.matrix_stack());
-               GL::Matrix matrix = track.get_matrix();
+               GL::Matrix matrix = track.create_matrix();
                matrix.translate(0, 0, z_offs);
                renderer.matrix_stack() *= matrix;