X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fengineer%2Fengineer.cpp;h=1f3b7dc4accc617e56eb8c587f4064c0d9e091d2;hb=1ff06c5bc46a677fa389ef86c6b26664368f1653;hp=32b77eda830989c4f1fc918afeec8bc2c4e49b59;hpb=f74ce147edde73319e55475433adb8e1d87b7201;p=r2c2.git diff --git a/source/engineer/engineer.cpp b/source/engineer/engineer.cpp index 32b77ed..1f3b7dc 100644 --- a/source/engineer/engineer.cpp +++ b/source/engineer/engineer.cpp @@ -1,6 +1,6 @@ /* $Id$ -This file is part of the MSP Märklin suite +This file is part of R²C² Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ @@ -25,8 +25,8 @@ Distributed under the GPL #include #include #include -#include "libmarklin/driver.h" -#include "libmarklin/tracktype.h" +#include "libr2c2/driver.h" +#include "libr2c2/tracktype.h" #include "3d/path.h" #include "3d/track.h" #include "3d/vehicle.h" @@ -37,7 +37,7 @@ Distributed under the GPL #include "trainview.h" using namespace std; -using namespace Marklin; +using namespace R2C2; using namespace Msp; Application::RegApp Engineer::reg; @@ -61,13 +61,13 @@ Engineer::Engineer(int argc, char **argv): window.set_title("Railroad Engineer"); window.signal_close.connect(sigc::bind(sigc::mem_fun(this, &Engineer::exit), 0)); - DataFile::load(ui_res, "marklin.res"); + DataFile::load(ui_res, "r2c2.res"); root = new GLtk::Root(ui_res, window); root->signal_button_press.connect(sigc::mem_fun(this, &Engineer::button_press)); root->signal_pointer_motion.connect(sigc::mem_fun(this, &Engineer::pointer_motion)); root->set_visible(true); - main_panel = new MainPanel(*this, ui_res); + main_panel = new MainPanel(*this); root->add(*main_panel); main_panel->set_position(0, window.get_height()-main_panel->get_geometry().h); main_panel->set_visible(true); @@ -219,7 +219,7 @@ void Engineer::tick() delete picking_path; picking_path = new Path3D(*track); if(picking_entry>=0) - picking_path->set_mask(picking_track->get_type().get_endpoints()[picking_entry].paths); + picking_path->set_mask(picking_track->get_type().get_endpoint(picking_entry).paths); else picking_path->set_mask(picking_track->get_type().get_paths()); picking_path->set_color(GL::Color(0)); @@ -271,7 +271,7 @@ void Engineer::button_press(int x, int y, unsigned btn, unsigned) else if(btn==3 && picking_entry>=0) { picking_entry = (picking_entry+1)%picking_track->get_type().get_endpoints().size(); - picking_path->set_mask(picking_track->get_type().get_endpoints()[picking_entry].paths); + picking_path->set_mask(picking_track->get_type().get_endpoint(picking_entry).paths); } } else @@ -319,7 +319,7 @@ void Engineer::pointer_motion(int x, int y) void Engineer::view_all() { - const list &tracks = layout_3d.get_tracks(); + const Layout3D::TrackMap &tracks = layout_3d.get_tracks(); float view_aspect = float(window.get_width()-200)/window.get_height(); float view_height = tan(camera.get_field_of_view()/2)*2; @@ -332,10 +332,10 @@ void Engineer::view_all() float max_x = 0; float min_y = 0; float max_y = 0; - for(list::const_iterator i=tracks.begin(); i!=tracks.end(); ++i) + for(Layout3D::TrackMap::const_iterator i=tracks.begin(); i!=tracks.end(); ++i) { Point minp, maxp; - (*i)->get_bounds(angle, minp, maxp); + i->second->get_bounds(angle, minp, maxp); min_x = min(min_x, minp.x); max_x = max(max_x, maxp.x); min_y = min(min_y, minp.y); @@ -428,7 +428,7 @@ Track3D *Engineer::pick_track(int x, int y) void Engineer::train_added(Train &train) { - TrainPanel *tpanel = new TrainPanel(*this, ui_res, train); + TrainPanel *tpanel = new TrainPanel(*this, train); root->add(*tpanel); train_panels.push_back(tpanel); rearrange_panels();