-/* $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/renderer.h>
#include "libr2c2/tracktype.h"
#include "layout.h"
#include "path.h"
z_offs = l*track.get_track().get_layout().get_catalogue().get_gauge()*0.01;
}
-void Path3D::render(const GL::Tag &tag) const
+long Path3D::get_instance_key() const
+{
+ return reinterpret_cast<long>(&track.get_type());
+}
+
+void Path3D::render(GL::Renderer &renderer, const GL::Tag &tag) const
{
if(tag=="unlit")
{
if(!mask)
return;
- GL::MatrixStack::Push push_mtx(GL::MatrixStack::modelview());
+ GL::MatrixStack::Push push_mtx(renderer.matrix_stack());
GL::Matrix matrix = track.get_matrix();
matrix.translate(0, 0, z_offs);
- GL::MatrixStack::modelview() *= matrix;
+ renderer.matrix_stack() *= matrix;
glColor4f(color.r, color.g, color.b, color.a);
for(unsigned i=0; mask; ++i, mask>>=1)
if(mask&1)
- track.get_type().get_path_mesh(i).draw();
+ track.get_type().get_path_mesh(i).draw(renderer);
}
}