X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fengineer%2Ftrainview.cpp;h=1ab236f4c797a7464bc7e42d5d8369d92b89febd;hb=66c2c7ca5a4bd369293959bc211b040834343381;hp=df336d577197763080a68fca2360f97fc52c6d52;hpb=62ce775d9af8f3321dbdebd6243b551fbbb0b976;p=r2c2.git diff --git a/source/engineer/trainview.cpp b/source/engineer/trainview.cpp index df336d5..1ab236f 100644 --- a/source/engineer/trainview.cpp +++ b/source/engineer/trainview.cpp @@ -1,20 +1,13 @@ -/* $Id$ - -This file is part of the MSP Märklin suite -Copyright © 2010 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #include #include #include -#include "libmarklin/vehicle.h" -#include "libmarklin/vehicletype.h" +#include "libr2c2/vehicle.h" +#include "libr2c2/vehicletype.h" #include "engineer.h" #include "trainview.h" using namespace Msp; -using namespace Marklin; +using namespace R2C2; TrainView::TrainView(Engineer &e, const Train &t): engineer(e), @@ -27,7 +20,7 @@ TrainView::TrainView(Engineer &e, const Train &t): set_size(300, 330); tex.set_min_filter(GL::LINEAR); - tex.storage(GL::RGB, 280, 280, 0); + tex.storage(GL::RGB, 280, 280); tex.image(0, GL::RGB, GL::UNSIGNED_BYTE, 0); fbo.attach(GL::COLOR_ATTACHMENT0, tex, 0); depth.storage(GL::DEPTH_COMPONENT, 280, 280); @@ -40,9 +33,9 @@ TrainView::TrainView(Engineer &e, const Train &t): pipeline.add_renderable(engineer.get_layout_3d().get_scene()); - GL::PipelinePass *pass = &pipeline.add_pass(0); - pass->depth_test = &GL::DepthTest::lequal(); - pass->lighting = &engineer.get_lighting(); + GL::Pipeline::Pass *pass = &pipeline.add_pass(0); + pass->set_depth_test(&GL::DepthTest::lequal()); + pass->set_lighting(&engineer.get_lighting()); GLtk::Image *image; add(*(image = new GLtk::Image(&tex))); @@ -92,7 +85,7 @@ void TrainView::set_forward(bool f) void TrainView::prepare() { const Vehicle &veh = train.get_vehicle(0); - const Point &pos = veh.get_position(); + const Vector &pos = veh.get_position(); float angle = veh.get_direction(); if(!forward) angle += M_PI; @@ -118,7 +111,7 @@ void TrainView::prepare() GL::Bind _bind_fbo(fbo); fbo.clear(GL::COLOR_BUFFER_BIT|GL::DEPTH_BUFFER_BIT); - pipeline.render_all(); + pipeline.render(); } void TrainView::button_release(int x, int y, unsigned btn)