X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fengineer%2Fengineer.cpp;h=7bd0f77d50c7721ca411745595e92fbe247a540b;hb=f42183985c65e1e12f19e9246dee90b8e7e44a34;hp=2c4e7263b4da113e3b304ab529e8229e5b47cebd;hpb=e375f8bf215058398795be1010ffec89d0150114;p=r2c2.git diff --git a/source/engineer/engineer.cpp b/source/engineer/engineer.cpp index 2c4e726..7bd0f77 100644 --- a/source/engineer/engineer.cpp +++ b/source/engineer/engineer.cpp @@ -112,6 +112,7 @@ Engineer::~Engineer() if(!simulate) trfc_mgr->save("engineer.state"); delete trfc_mgr; + delete server; } void Engineer::place_train(Train &train) @@ -179,6 +180,7 @@ int Engineer::main() Application::main(); + delete root; delete glc; delete wnd; delete dpy; @@ -227,10 +229,10 @@ void Engineer::tick() if(track.get_turnout_id()) { Turnout &trnt = control.get_turnout(track.get_turnout_id()); - (*i)->render_route(trnt.get_route()); + (*i)->render_path(trnt.get_path()); } else - (*i)->render_route(-1); + (*i)->render_path(-1); } if(placing_train && placing_block) @@ -266,7 +268,7 @@ void Engineer::tick() GL::PushMatrix _push; const Point &tp = (*i)->get_position(); - GL::translate(tp.x, tp.y, 0.02); + GL::translate(tp.x, tp.y, tp.z+0.02); GL::Immediate imm((GL::COLOR4_UBYTE, GL::VERTEX2)); imm.color(0.8f, 0.8f, 1.0f); imm.begin(GL::TRIANGLE_FAN); @@ -305,7 +307,7 @@ void Engineer::button_press(int x, int y, unsigned btn, unsigned) { set_block_color(*placing_block, GL::Color(1, 1, 1)); - placing_train->place(placing_block, placing_entry); + placing_train->place(*placing_block, placing_entry); placing_train = 0; main_panel->set_status_text(string()); } @@ -325,7 +327,7 @@ void Engineer::button_press(int x, int y, unsigned btn, unsigned) Turnout &turnout = control.get_turnout(tid); try { - turnout.set_route((turnout.get_route()+1)%track->get_track().get_type().get_n_routes()); + turnout.set_path((turnout.get_path()+1)%track->get_track().get_type().get_n_paths()); main_panel->set_status_text(format("Turnout %d switched", turnout.get_address())); } catch(const TurnoutBusy &e)