X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Fpath.cpp;h=fe4a2467b57df59c64e9d3aea9f4396af922eccb;hb=e621dd4120cb253417167b4295e436cee095ccb0;hp=bd6b5b18715eb68d596d084f1d1c3daa37323cd8;hpb=d91ab10fd78ef29272282b020fa4e08063cb4808;p=r2c2.git diff --git a/source/3d/path.cpp b/source/3d/path.cpp index bd6b5b1..fe4a246 100644 --- a/source/3d/path.cpp +++ b/source/3d/path.cpp @@ -1,17 +1,12 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2010 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #include +#include #include "libr2c2/tracktype.h" #include "layout.h" #include "path.h" #include "track.h" #include "tracktype.h" +using namespace std; using namespace Msp; namespace R2C2 { @@ -38,7 +33,7 @@ void Path3D::set_automatic() void Path3D::set_path(unsigned p) { if(!(track.get_track().get_type().get_paths()&(1<(&track.get_type()); +} + +void Path3D::render(GL::Renderer &renderer, const GL::Tag &tag) const { if(tag=="unlit") { @@ -70,15 +70,15 @@ void Path3D::render(const GL::Tag &tag) const if(!mask) return; - GL::MatrixStack::Push push_mtx(GL::MatrixStack::modelview()); - GL::Matrix matrix = track.get_matrix(); + GL::MatrixStack::Push push_mtx(renderer.matrix_stack()); + GL::Matrix matrix = track.create_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); } }