X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Fpath.cpp;h=98ead14774c3ac7904f128945d292fb18291f815;hb=4236c30c0a7a48854e9634e9ad7d8d6e0fd243a3;hp=e413ace021d2bec89cb7b132832b5b93919621db;hpb=d27edb207810f0b4e44be8c3632d421faa5fed80;p=r2c2.git diff --git a/source/3d/path.cpp b/source/3d/path.cpp index e413ace..98ead14 100644 --- a/source/3d/path.cpp +++ b/source/3d/path.cpp @@ -1,12 +1,6 @@ -/* $Id$ - -This file is part of the MSP Märklin suite -Copyright © 2010 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #include -#include "libmarklin/tracktype.h" +#include +#include "libr2c2/tracktype.h" #include "layout.h" #include "path.h" #include "track.h" @@ -14,7 +8,7 @@ Distributed under the GPL using namespace Msp; -namespace Marklin { +namespace R2C2 { Path3D::Path3D(const Track3D &t): track(t), @@ -61,24 +55,30 @@ void Path3D::set_layer(float l) 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(&track.get_type()); +} + +void Path3D::render(GL::Renderer &renderer, const GL::Tag &tag) const { - if(tag==0) + if(tag=="unlit") { unsigned mask = (automatic ? 1<>=1) if(mask&1) - track.get_type().get_path_mesh(i).draw(); + track.get_type().get_path_mesh(i).draw(renderer); } } -} // namespace Marklin +} // namespace R2C2