]> git.tdb.fi Git - r2c2.git/blobdiff - source/designer/trackwrap.cpp
Get rid of the TrainAI tagging system
[r2c2.git] / source / designer / trackwrap.cpp
index 47225e3904af04c39f6ae2afcd49efce68083b4a..523c9678658c0b31acc94c66f42728eb6571c85d 100644 (file)
@@ -1,12 +1,6 @@
-/* $Id$
-
-This file is part of R²C²
-Copyright © 2010  Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
 #include <msp/gl/matrix.h>
 #include <msp/gl/meshbuilder.h>
+#include <msp/gl/renderer.h>
 #include "3d/tracktype.h"
 #include "selection.h"
 #include "trackwrap.h"
@@ -28,15 +22,15 @@ TrackWrap::~TrackWrap()
                delete i->second;
 }
 
-void TrackWrap::render(const GL::Tag &) const
+void TrackWrap::render(GL::Renderer &renderer, const GL::Tag &) const
 {
        for(list<Wrap>::const_iterator i=wraps.begin(); i!=wraps.end(); ++i)
        {
-               GL::PushMatrix _pushm;
+               GL::MatrixStack::Push push(renderer.matrix_stack());
                const Vector &pos = i->track->get_position();
-               GL::translate(pos.x, pos.y, pos.z);
-               GL::rotate(i->track->get_rotation()*180/M_PI, 0, 0, 1);
-               i->mesh->draw();
+               renderer.matrix_stack() *= GL::Matrix::translation(pos.x, pos.y, pos.z);
+               renderer.matrix_stack() *= GL::Matrix::rotation(i->track->get_rotation(), 0, 0, 1);
+               i->mesh->draw(renderer);
        }
 }