/* $Id$
-This file is part of the MSP Märklin suite
+This file is part of R²C²
Copyright © 2010 Mikkosoft Productions, Mikko Rasa
Distributed under the GPL
*/
#include <msp/gl/matrix.h>
-#include "libmarklin/tracktype.h"
+#include "libr2c2/tracktype.h"
#include "layout.h"
#include "path.h"
#include "track.h"
using namespace Msp;
-namespace Marklin {
+namespace R2C2 {
Path3D::Path3D(const Track3D &t):
track(t),
void Path3D::render(const GL::Tag &tag) const
{
- if(tag==0)
+ if(tag=="unlit")
{
unsigned mask = (automatic ? 1<<track.get_track().get_active_path() : paths);
mask &= track.get_track().get_type().get_paths();
if(!mask)
return;
- GL::PushMatrix push_mat;
- track.apply_matrix();
- GL::translate(0, 0, z_offs);
+ GL::MatrixStack::Push push_mtx(GL::MatrixStack::modelview());
+ GL::Matrix matrix = track.get_matrix();
+ matrix.translate(0, 0, z_offs);
+ GL::MatrixStack::modelview() *= matrix;
glColor4f(color.r, color.g, color.b, color.a);
for(unsigned i=0; mask; ++i, mask>>=1)
}
}
-} // namespace Marklin
+} // namespace R2C2